Update services.ts
This commit is contained in:
parent
355855677f
commit
ec73419656
@ -556,9 +556,9 @@ export const disabledSongsService = {
|
|||||||
throw new Error('Song path is required');
|
throw new Error('Song path is required');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!song.artist || !song.title) {
|
// Use empty strings as fallbacks for missing artist or title
|
||||||
throw new Error('Song artist and title are required');
|
const artist = song.artist || '';
|
||||||
}
|
const title = song.title || '';
|
||||||
|
|
||||||
const songKey = disabledSongsService.generateSongKey(song.path);
|
const songKey = disabledSongsService.generateSongKey(song.path);
|
||||||
debugLog('Generated song key:', songKey);
|
debugLog('Generated song key:', songKey);
|
||||||
@ -566,8 +566,8 @@ export const disabledSongsService = {
|
|||||||
const disabledSongRef = ref(database, `controllers/${controllerName}/disabledSongs/${songKey}`);
|
const disabledSongRef = ref(database, `controllers/${controllerName}/disabledSongs/${songKey}`);
|
||||||
const disabledSong = {
|
const disabledSong = {
|
||||||
path: song.path,
|
path: song.path,
|
||||||
artist: song.artist,
|
artist: artist,
|
||||||
title: song.title,
|
title: title,
|
||||||
key: song.key,
|
key: song.key,
|
||||||
disabledAt: new Date().toISOString(),
|
disabledAt: new Date().toISOString(),
|
||||||
};
|
};
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user