diff options
Diffstat (limited to 'src/page/album.js')
-rw-r--r-- | src/page/album.js | 31 |
1 files changed, 20 insertions, 11 deletions
diff --git a/src/page/album.js b/src/page/album.js index 8c08b960..e585618c 100644 --- a/src/page/album.js +++ b/src/page/album.js @@ -8,15 +8,22 @@ export function targets({wikiData}) { export function pathsForTarget(album) { return [ - { - type: 'page', - path: ['album', album.directory], - - contentFunction: { - name: 'generateAlbumInfoPage', - args: [album], - }, - }, + (album.style === 'single' + ? { + type: 'redirect', + fromPath: ['album', album.directory], + toPath: ['track', album.tracks[0].directory], + title: album.name, + } + : { + type: 'page', + path: ['album', album.directory], + + contentFunction: { + name: 'generateAlbumInfoPage', + args: [album], + }, + }), { type: 'page', @@ -43,7 +50,8 @@ export function pathsForTarget(album) { path: ['albumReferencedArtworks', album.directory], condition: () => - !empty(album.referencedArtworks), + album.hasCoverArt && + !empty(album.coverArtworks[0].referencedArtworks), contentFunction: { name: 'generateAlbumReferencedArtworksPage', @@ -56,7 +64,8 @@ export function pathsForTarget(album) { path: ['albumReferencingArtworks', album.directory], condition: () => - !empty(album.referencedByArtworks), + album.hasCoverArt && + !empty(album.coverArtworks[0].referencedByArtworks), contentFunction: { name: 'generateAlbumReferencingArtworksPage', |