Fix `DevFastAccessCoverArt` flag

This commit is contained in:
Deluan 2022-12-22 11:47:18 -05:00 committed by Deluan Quintão
parent 57c3334ea0
commit 045b023b35
5 changed files with 3 additions and 4 deletions

View File

@ -114,7 +114,7 @@ func (a *artwork) extractMediaFileImage(ctx context.Context, artID model.Artwork
}
var ff []fromFunc
if mf.HasCoverArt {
if mf.CoverArtID().Kind == model.KindMediaFileArtwork {
ff = []fromFunc{
fromTag(mf.Path),
fromFFmpegTag(ctx, a.ffmpeg, mf.Path),

View File

@ -45,7 +45,6 @@ func serveIndex(ds model.DataStore, fs fs.FS) http.HandlerFunc {
"gaTrackingId": conf.Server.GATrackingID,
"losslessFormats": strings.ToUpper(strings.Join(consts.LosslessFormats, ",")),
"devActivityPanel": conf.Server.DevActivityPanel,
"devFastAccessCoverArt": conf.Server.DevFastAccessCoverArt,
"enableUserEditing": conf.Server.EnableUserEditing,
"devEnableShare": conf.Server.DevEnableShare,
"devSidebarPlaylists": conf.Server.DevSidebarPlaylists,

View File

@ -15,7 +15,6 @@ const defaultConfig = {
welcomeMessage: '',
gaTrackingId: '',
devActivityPanel: true,
devFastAccessCoverArt: false,
enableStarRating: true,
defaultTheme: 'Dark',
defaultLanguage: '',

View File

@ -37,7 +37,7 @@ const mapToAudioLists = (item) => {
musicSrc: subsonic.streamUrl(trackId),
cover: subsonic.getCoverArtUrl(
{
id: config.devFastAccessCoverArt ? item.albumId : trackId,
id: trackId,
updatedAt: item.updatedAt,
album: item.album,
},

View File

@ -51,6 +51,7 @@ const getCoverArtUrl = (record, size) => {
...(size && { size }),
}
// TODO Move this logic to server. `song` and `album` should have a CoverArtID
const lastUpdate = Math.floor(Date.parse(record.updatedAt) / 1000)
const id = record.id + '-' + Math.max(lastUpdate, 0).toString(16)
if (record.album) {