Make SmartPlaylists read-only

This commit is contained in:
Deluan
2021-10-22 21:11:44 -04:00
committed by Deluan Quintão
parent d169f54e7d
commit 2e2a647e67
9 changed files with 54 additions and 26 deletions
+4
View File
@@ -176,6 +176,10 @@ func reorderItem(ds model.DataStore) http.HandlerFunc {
}
tracksRepo := ds.Playlist(r.Context()).Tracks(playlistId)
err = tracksRepo.Reorder(id, newPos)
if err == rest.ErrPermissionDenied {
http.Error(w, err.Error(), http.StatusForbidden)
return
}
if err != nil {
http.Error(w, err.Error(), http.StatusBadRequest)
return