GetCoverArt generates a tiled (2x2) image for playlists

This commit is contained in:
Deluan
2022-12-27 18:28:56 -05:00
committed by Deluan Quintão
parent 501386b11f
commit 949331ed24
5 changed files with 177 additions and 14 deletions
+6 -5
View File
@@ -30,15 +30,16 @@ func newMediafileArtworkReader(ctx context.Context, artwork *artwork, artID mode
album: *al,
}
a.cacheKey.artID = artID
a.cacheKey.lastUpdate = a.LastUpdated()
if al.UpdatedAt.After(mf.UpdatedAt) {
a.cacheKey.lastUpdate = al.UpdatedAt
} else {
a.cacheKey.lastUpdate = mf.UpdatedAt
}
return a, nil
}
func (a *mediafileArtworkReader) LastUpdated() time.Time {
if a.album.UpdatedAt.After(a.mediafile.UpdatedAt) {
return a.album.UpdatedAt
}
return a.mediafile.UpdatedAt
return a.lastUpdate
}
func (a *mediafileArtworkReader) Reader(ctx context.Context) (io.ReadCloser, string, error) {