feat: Add Share option for artists, albums, and tracks
This feature is only available on the Subsonic media provider. Using a Jellyfin server will make Supersonic hide the "Share" option. * Artists: Option available in grid view and in Artist view. * Albums: Option available in grid view and in Album view. * Tracks: Option available in tracklist, when a single track is selected.
This commit is contained in:
@@ -5,6 +5,7 @@ import (
|
||||
"image"
|
||||
"io"
|
||||
"math"
|
||||
"net/url"
|
||||
"strconv"
|
||||
"strings"
|
||||
"sync"
|
||||
@@ -315,6 +316,20 @@ func (s *subsonicMediaProvider) SetRating(params mediaprovider.RatingFavoritePar
|
||||
return err
|
||||
}
|
||||
|
||||
func (s *subsonicMediaProvider) CreateShareURL(id string) (*url.URL, error) {
|
||||
share, err := s.client.CreateShare(id, nil)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
shareUrl, err := url.Parse(share.Url)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return shareUrl, nil
|
||||
}
|
||||
|
||||
func (s *subsonicMediaProvider) DownloadTrack(trackID string) (io.Reader, error) {
|
||||
return s.client.Download(trackID)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user