mirror of
https://github.com/navidrome/navidrome.git
synced 2026-11-06 18:28:39 +01:00
Add option to download playlist
This commit is contained in:
parent
073e40dc87
commit
8fa5544af7
6 changed files with 56 additions and 13 deletions
|
|
@ -269,6 +269,10 @@ func getEntityByID(ctx context.Context, ds model.DataStore, id string) (interfac
|
|||
if err == nil {
|
||||
return al, nil
|
||||
}
|
||||
pls, err := ds.Playlist(ctx).Get(id)
|
||||
if err == nil {
|
||||
return pls, nil
|
||||
}
|
||||
mf, err := ds.MediaFile(ctx).Get(id)
|
||||
if err == nil {
|
||||
return mf, nil
|
||||
|
|
|
|||
|
|
@ -109,6 +109,9 @@ func (c *StreamController) Download(w http.ResponseWriter, r *http.Request) (*re
|
|||
case *model.Artist:
|
||||
setHeaders(v.Name)
|
||||
err = c.archiver.ZipArtist(ctx, id, w)
|
||||
case *model.Playlist:
|
||||
setHeaders(v.Name)
|
||||
err = c.archiver.ZipPlaylist(ctx, id, w)
|
||||
default:
|
||||
err = model.ErrNotFound
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue