diff options
author | (quasar) nebula <qznebula@protonmail.com> | 2023-04-18 21:12:48 -0300 |
---|---|---|
committer | (quasar) nebula <qznebula@protonmail.com> | 2023-04-18 21:12:48 -0300 |
commit | fba7d3d6e6d4271744e66efa101d98777995d878 (patch) | |
tree | 768d29f36f5ea6e08f44e92b6199f1d8491683fe | |
parent | 985feb1437831198383f37bc93982a11a857fd6b (diff) |
yeet another replaced misc-template function
-rw-r--r-- | src/misc-templates.js | 64 |
1 files changed, 0 insertions, 64 deletions
diff --git a/src/misc-templates.js b/src/misc-templates.js index cf41991d..dfff4d88 100644 --- a/src/misc-templates.js +++ b/src/misc-templates.js @@ -18,67 +18,6 @@ import { sortChronologically, } from './util/wiki-data.js'; -// Divided track lists - -function unbound_generateTrackListDividedByGroups(tracks, { - html, - language, - - getTrackItem, - wikiData, -}) { - const {divideTrackListsByGroups: groups} = wikiData.wikiInfo; - - if (empty(groups)) { - return html.tag('ul', - tracks.map(t => getTrackItem(t))); - } - - const lists = Object.fromEntries( - groups.map((group) => [ - group.directory, - {group, tracks: []} - ])); - - const other = []; - - for (const track of tracks) { - const {album} = track; - const group = groups.find((g) => g.albums.includes(album)); - if (group) { - lists[group.directory].tracks.push(track); - } else { - other.push(track); - } - } - - const dt = name => - html.tag('dt', - language.$('trackList.group', { - group: name, - })); - - const ddul = tracks => - html.tag('dd', - html.tag('ul', - tracks.map(t => getTrackItem(t)))); - - return html.tag('dl', [ - ...Object.values(lists) - .filter(({tracks}) => tracks.length) - .flatMap(({group, tracks}) => [ - dt(group.name), - ddul(tracks), - ]), - - ...html.fragment( - other.length && [ - dt(language.$('trackList.group.other')), - ddul(other), - ]), - ]); -} - // Grids function unbound_getGridHTML({ @@ -259,11 +198,8 @@ function unbound_getCarouselHTML({ // Exports export { - unbound_generateTrackListDividedByGroups as generateTrackListDividedByGroups, - unbound_getGridHTML as getGridHTML, unbound_getAlbumGridHTML as getAlbumGridHTML, unbound_getFlashGridHTML as getFlashGridHTML, - unbound_getCarouselHTML as getCarouselHTML, } |