Add option to download playlist

This commit is contained in:
Deluan
2020-08-21 13:28:20 -04:00
parent 073e40dc87
commit 8fa5544af7
6 changed files with 56 additions and 13 deletions
+4
View File
@@ -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
+3
View File
@@ -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
}