mirror of
https://github.com/navidrome/navidrome.git
synced 2026-11-21 09:29:46 +01:00
Add Share to Context menus, also share artist
This commit is contained in:
parent
051e9c556d
commit
433da37982
5 changed files with 50 additions and 8 deletions
|
|
@ -78,6 +78,15 @@ func (r *shareRepository) loadMedia(share *model.Share) error {
|
|||
return nil
|
||||
}
|
||||
switch share.ResourceType {
|
||||
case "artist":
|
||||
albumRepo := NewAlbumRepository(r.ctx, r.ormer)
|
||||
share.Albums, err = albumRepo.GetAll(model.QueryOptions{Filters: Eq{"album_artist_id": ids}, Sort: "artist"})
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
mfRepo := NewMediaFileRepository(r.ctx, r.ormer)
|
||||
share.Tracks, err = mfRepo.GetAll(model.QueryOptions{Filters: Eq{"album_artist_id": ids}, Sort: "artist"})
|
||||
return err
|
||||
case "album":
|
||||
albumRepo := NewAlbumRepository(r.ctx, r.ormer)
|
||||
share.Albums, err = albumRepo.GetAll(model.QueryOptions{Filters: Eq{"id": ids}})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue