Implement updateShare and deleteShare Subsonic endpoints

This commit is contained in:
Deluan
2023-01-22 20:21:06 -05:00
parent 20271df4fb
commit d5df102f9f
6 changed files with 52 additions and 7 deletions
+7 -1
View File
@@ -148,7 +148,13 @@ func (r *shareRepositoryWrapper) Save(entity interface{}) (string, error) {
}
func (r *shareRepositoryWrapper) Update(id string, entity interface{}, _ ...string) error {
return r.Persistable.Update(id, entity, "description", "expires_at")
cols := []string{"description"}
// TODO Better handling of Share expiration
if !entity.(*model.Share).ExpiresAt.IsZero() {
cols = append(cols, "expires_at")
}
return r.Persistable.Update(id, entity, cols...)
}
func (r *shareRepositoryWrapper) shareContentsFromAlbums(shareID string, ids string) string {