mirror of
https://github.com/navidrome/navidrome.git
synced 2025-04-04 04:57:37 +03:00
Optimize playlist cover generation
This commit is contained in:
parent
c46a2a5f5f
commit
16c869ec86
5 changed files with 42 additions and 28 deletions
|
@ -205,7 +205,7 @@ func (s *playlists) Update(ctx context.Context, playlistID string,
|
|||
pls.AddTracks(idsToAdd)
|
||||
} else {
|
||||
if len(idsToAdd) > 0 {
|
||||
_, err = repo.Tracks(playlistID).Add(idsToAdd)
|
||||
_, err = repo.Tracks(playlistID, true).Add(idsToAdd)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
@ -232,7 +232,7 @@ func (s *playlists) Update(ctx context.Context, playlistID string,
|
|||
}
|
||||
// Special case: The playlist is now empty
|
||||
if len(idxToRemove) > 0 && len(pls.Tracks) == 0 {
|
||||
if err = repo.Tracks(playlistID).DeleteAll(); err != nil {
|
||||
if err = repo.Tracks(playlistID, true).DeleteAll(); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue