« get me outta code hell

hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/page/album.js160
1 files changed, 0 insertions, 160 deletions
diff --git a/src/page/album.js b/src/page/album.js
index af410763..c7327cc8 100644
--- a/src/page/album.js
+++ b/src/page/album.js
@@ -72,31 +72,6 @@ export function pathsTargetless({wikiData: {wikiInfo}}) {
 
 /*
 export function write(album, {wikiData}) {
-  const getSocialEmbedDescription = ({
-    getArtistString: _getArtistString,
-    language,
-  }) => {
-    const hasDuration = albumDuration > 0;
-    const hasTracks = album.tracks.length > 0;
-    const hasDate = !!album.date;
-    if (!hasDuration && !hasTracks && !hasDate) return '';
-
-    return language.formatString(
-      'albumPage.socialEmbed.body' + [
-        hasDuration && '.withDuration',
-        hasTracks && '.withTracks',
-        hasDate && '.withReleaseDate',
-      ].filter(Boolean).join(''),
-      Object.fromEntries([
-        hasDuration &&
-          ['duration', language.formatDuration(albumDuration)],
-        hasTracks &&
-          ['tracks', language.countTracks(album.tracks.length, {unit: true})],
-        hasDate &&
-          ['date', language.formatDate(album.date)],
-      ].filter(Boolean)));
-  };
-
   const data = {
     type: 'data',
     path: ['album', album.directory],
@@ -133,140 +108,5 @@ export function write(album, {wikiData}) {
       })),
     }),
   };
-
-  // TODO: only gen if there are any tracks with art
-  const galleryPage = {
-    type: 'page',
-    path: ['albumGallery', album.directory],
-    page: ({
-      // generateInfoGalleryLinks,
-      // generateNavigationLinks,
-      getAlbumCover,
-      getAlbumStylesheet,
-      getGridHTML,
-      getTrackCover,
-      // getLinkThemeString,
-      getThemeString,
-      html,
-      language,
-      link,
-    }) => ({
-      title: language.$('albumGalleryPage.title', {album: album.name}),
-      stylesheet: getAlbumStylesheet(album),
-
-      themeColor: album.color,
-      theme: getThemeString(album.color),
-
-      main: {
-        classes: ['top-index'],
-        headingMode: 'static',
-
-        content: [
-          html.tag('p',
-            {class: 'quick-info'},
-            (album.date
-              ? language.$('albumGalleryPage.infoLine.withDate', {
-                  tracks: html.tag('b',
-                    language.countTracks(album.tracks.length, {unit: true})),
-                  duration: html.tag('b',
-                    language.formatDuration(albumDuration, {unit: true})),
-                  date: html.tag('b',
-                    language.formatDate(album.date)),
-                })
-              : language.$('albumGalleryPage.infoLine', {
-                  tracks: html.tag('b',
-                    language.countTracks(album.tracks.length, {unit: true})),
-                  duration: html.tag('b',
-                    language.formatDuration(albumDuration, {unit: true})),
-                }))),
-
-          html.tag('div',
-            {class: 'grid-listing'},
-            getGridHTML({
-              linkFn: (t, opts) => t.album ? link.track(t, opts) : link.album(t, opts),
-              noSrcTextFn: t =>
-                language.$('misc.albumGalleryGrid.noCoverArt', {
-                  name: t.name,
-                }),
-
-              srcFn(t) {
-                if (!t.album) {
-                  return getAlbumCover(t);
-                } else if (t.hasUniqueCoverArt) {
-                  return getTrackCover(t);
-                } else {
-                  return null;
-                }
-              },
-
-              entries: [
-                // {item: album},
-                ...album.tracks.map(track => ({item: track})),
-              ],
-            })),
-        ],
-      },
-
-      nav: generateAlbumExtrasPageNav(album, 'gallery', {
-        html,
-        language,
-        link,
-      }),
-    }),
-  };
-}
-
-export function generateAlbumSecondaryNav(album, currentTrack, {
-  getLinkThemeString,
-  html,
-  language,
-  link,
-}) {
-  const isAlbumPage = !currentTrack;
-
-  const {groups} = album;
-
-  if (empty(groups)) {
-    return null;
-  }
-
-  const groupParts = groups
-    .map((group) => {
-      const albums = group.albums.filter((album) => album.date);
-      const index = albums.indexOf(album);
-      const next = index >= 0 && albums[index + 1];
-      const previous = index > 0 && albums[index - 1];
-      return {group, next, previous};
-    })
-    .map(({group, next, previous}) => {
-      const previousLink =
-        isAlbumPage &&
-        previous &&
-          link.album(previous, {
-            color: false,
-            text: language.$('misc.nav.previous'),
-          });
-      const nextLink =
-        isAlbumPage &&
-        next &&
-          link.album(next, {
-            color: false,
-            text: language.$('misc.nav.next'),
-          });
-      const links = [previousLink, nextLink].filter(Boolean);
-      return html.tag('span',
-        {style: getLinkThemeString(group.color)},
-        [
-          language.$('albumSidebar.groupBox.title', {
-            group: link.groupInfo(group),
-          }),
-          !empty(links) && `(${language.formatUnitList(links)})`,
-        ]);
-    });
-
-  return {
-    classes: ['nav-links-groups'],
-    content: groupParts,
-  };
 }
 */