Fix incorrect slug location on album
This commit is contained in:
parent
2e008a603d
commit
e38c97f774
|
@ -51,10 +51,12 @@ export default class AlbumInfoParser {
|
|||
artist.url = basic.byArtist['@id'];
|
||||
}
|
||||
|
||||
const url = basic['@id'];
|
||||
|
||||
const album: Album = {
|
||||
type: 'album',
|
||||
name: basic.name,
|
||||
url: basic['@id'],
|
||||
url,
|
||||
numTracks: basic.numTracks,
|
||||
keywords: basic.keywords,
|
||||
description: basic.description.replaceAll('\r\n', '\n') || '',
|
||||
|
@ -83,6 +85,11 @@ export default class AlbumInfoParser {
|
|||
artist.url = publisher.url;
|
||||
}
|
||||
|
||||
if (url) {
|
||||
const urlParts = url.split('/');
|
||||
album.slug = urlParts[urlParts.length - 1];
|
||||
}
|
||||
|
||||
if (Array.isArray(basic.albumRelease)) {
|
||||
const releases = basic.albumRelease.filter(
|
||||
(release: any) => release.musicReleaseFormat).map((release: any) => {
|
||||
|
@ -96,9 +103,6 @@ export default class AlbumInfoParser {
|
|||
const releaseUrl = normalizeUrl(release['@id'], album.url);
|
||||
if (releaseUrl) {
|
||||
releaseItem.url = releaseUrl;
|
||||
|
||||
const urlParts = releaseUrl.split('/');
|
||||
releaseItem.slug = urlParts[urlParts.length - 1];
|
||||
}
|
||||
if (release.image) {
|
||||
if (Array.isArray(release.image) && release.image[0]) {
|
||||
|
|
|
@ -6,6 +6,7 @@ interface Album extends MediaKind {
|
|||
numTracks?: number;
|
||||
keywords?: string[];
|
||||
description?: string;
|
||||
slug?: string;
|
||||
genre?: string;
|
||||
location?: string;
|
||||
featuredTrack?: Omit<Track, 'type'>;
|
||||
|
@ -17,7 +18,6 @@ export interface AlbumRelease {
|
|||
name: string;
|
||||
format: string;
|
||||
url?: string;
|
||||
slug?: string;
|
||||
imageUrl?: string;
|
||||
description?: string;
|
||||
}
|
||||
|
|
|
@ -4,7 +4,6 @@ import MediaKind from './MediaKind.js';
|
|||
interface Track extends MediaKind {
|
||||
type: 'track';
|
||||
description?: string;
|
||||
url?: string;
|
||||
slug?: string;
|
||||
duration?: number;
|
||||
seekPosition?: number;
|
||||
|
|
Loading…
Reference in New Issue
Block a user