Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to assign track links to Spotify/Youtube/... ? #16

Open
gordielachance opened this issue Mar 4, 2020 · 7 comments
Open

How to assign track links to Spotify/Youtube/... ? #16

gordielachance opened this issue Mar 4, 2020 · 7 comments

Comments

@gordielachance
Copy link

Hi, could you add a :link property for tracks ?
it differs from the :location property, as seen on the XSPF specs :

4.1.1.2.14.1.1.1.1 location
URI of resource to be rendered. Probably an audio resource, but MAY be any type of resource with a well-known duration, such as video, a SMIL document, or an XSPF document. The duration of the resource defined in this element defines the duration of rendering. xspf:track elements MAY contain zero or more location elements, but a user-agent MUST NOT render more than one of the named resources.

4.1.1.2.14.1.1.1.11 link
The link element allows XSPF to be extended without the use of XML namespaces. xspf:track elements MAY contain zero or more link elements.

I would use this to define links to audio services (like Spotify, Youtube, Soundcloud), which are not really an audio ressource. + I need to be able to add several links.

Thanks a lot, again.

@njh
Copy link
Owner

njh commented Mar 9, 2020

XSPF shows using a rel= attribute on links.

I am wondering about how to translate something like this:

track.links[:spotify] = 'https://play.spotify.com/track/0tY6yscxkyjm0o0ppVhd5b'

But I am not sure what the real URI should be:

<link rel="http://something.com/spotify">https://play.spotify.com/track/0tY6yscxkyjm0o0ppVhd5b</link>

Maybe a URI relative to the playlist itself:

<link rel="#spotify">https://play.spotify.com/track/0tY6yscxkyjm0o0ppVhd5b</link>

@gordielachance
Copy link
Author

Yes, the documentation is not really obvious on this.
I wrote a post on Stackoverflow to try to know more.

@njh
Copy link
Owner

njh commented Mar 24, 2020

It might be worth asking on the Mailing List - even if just to point people who know about XSPF to the Stackoverflow question,

@gordielachance
Copy link
Author

gordielachance commented Mar 25, 2020

I just had an email reply from one of the specs author (which also did reply to the stackoverflow post), where he says that we could put those links in the location or identifier tags.
I would have chosen location since those are "playable" links (which a musicbrainz ID is not), but it seems that he suggests to use identifer in its stackoverflow answer.

You could put a YouTube link in the location element, or have multiple identifier elements, each one with a different YouTube link.

The important thing is for user agents to support the convention. You'd want to put a little work into adoption in things like VLC.

So I guess this issue can be closed. Do your gem supports multiple locations for a track ?

@gordielachance gordielachance changed the title add track link property How to assign track links to Spotify/Youtube/... ? Mar 25, 2020
@gordielachance
Copy link
Author

...Which leads me to new problems :

Your 'location' attribute doesn't support multiple values (at least this is what is said in the documentation),
while your 'identifiers' do but is readonly only. When trying

  track = Playlist::Track.new(
    ...
    :identifiers =>    ...
    ....
  )

I get

undefined method `identifiers=' for #Playlist::Track:0x000055954524db98

Thanks man !

@njh
Copy link
Owner

njh commented Mar 25, 2020

It doesn't currently support multiple locations for a track, but I will have a think about how best to do it. Please can you open a separate issue for adding multiple locations?

@gordielachance
Copy link
Author

multiple locations --> #17
Should I open one for the readonly identifiers attribute ?
Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants