Enable sharing only selected songs with the Subsonic API

This commit is contained in:
Deluan
2023-01-23 19:40:26 -05:00
parent e34f26588e
commit d639da9eb5
2 changed files with 9 additions and 5 deletions
+4
View File
@@ -99,6 +99,10 @@ func (r *shareRepository) loadMedia(share *model.Share) error {
share.Tracks = tracks.MediaFiles()
}
return nil
case "media_file":
mfRepo := NewMediaFileRepository(r.ctx, r.ormer)
share.Tracks, err = mfRepo.GetAll(model.QueryOptions{Filters: Eq{"id": ids}})
return err
}
log.Warn(r.ctx, "Unsupported Share ResourceType", "share", share.ID, "resourceType", share.ResourceType)
return nil