Make SmartPlaylists read-only

This commit is contained in:
Deluan authored and Deluan Quintão committed 2021-10-23 20:25:28 -04:00
1 parent d169f54e7d
commit 2e2a647e67
9 files changed
+54 -26

No files matched your search

+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