njh / ruby-playlist Goto Github PK
View Code? Open in Web Editor NEWA ruby gem to convert playlists between different formats
Home Page: https://rubygems.org/gems/playlist
License: MIT License
A ruby gem to convert playlists between different formats
Home Page: https://rubygems.org/gems/playlist
License: MIT License
Hi, is there a way to assign an image to a playlist and to tracks ?
Thanks !
Hi,
The XSPF specs do support multiple locations for a track, which you should probably reflect in your code.
Thanks !
Hi, is there a way to output the tracklist as a JSON object, based, ideally, on the XSPF playlist (since it's a standard) ?
Thanks !
playlist convert foo.xspf output.txt
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.
Hi, I got a Internal Server Error when I'm trying to set the identifier attribute for a track ๐
track = Playlist::Track.new(
:artist => 'U2',
:title => 'Sunday Bloody Sunday',
:duration => '54321',
:identifiers => {
"http://example.com/rel/1/" => "http://example.com/body/1/",
"http://example.com/rel/2/" => "http://example.com/body/2/"
}
)
It seems that it is related to the :identifier attribute, since it does work if I use :location instead.
"error": "Internal Server Error", "exception": "#<NoMethodError: undefined method `identifiers=' for #<Playlist::Track:0x0000557337d59e40>\nDid you mean? identifiers>",
"Framework Trace": [
{
"exception_object_id": 63840,
"id": 0,
"trace": "ruby-playlist (65154d8) lib/playlist/track.rb:68:inblock in initialize'" }, { "exception_object_id": 63840, "id": 1, "trace": "ruby-playlist (65154d859585) lib/playlist/track.rb:67:in
each_pair'"
},
{
"exception_object_id": 63840,
"id": 2,
"trace": "ruby-playlist (65154d8) lib/playlist/track.rb:67:ininitialize'" }, { "exception_object_id": 63840, "id": 5, "trace": "actionpack (6.0.3.3) lib/action_controller/metal/basic_implicit_render.rb:6:in
send_action'"
},
{
"exception_object_id": 63840,
"id": 6,
"trace": "actionpack (6.0.3.3) lib/abstract_controller/base.rb:195:inprocess_action'" }, { "exception_object_id": 63840, "id": 7, "trace": "actionpack (6.0.3.3) lib/action_controller/metal/rendering.rb:30:in
process_action'"
},
{
"exception_object_id": 63840,
"id": 8,
"trace": "actionpack (6.0.3.3) lib/abstract_controller/callbacks.rb:42:inblock in process_action'" }, { "exception_object_id": 63840, "id": 9, "trace": "activesupport (6.0.3.3) lib/active_support/callbacks.rb:101:in
run_callbacks'"
},
{
"exception_object_id": 63840,
"id": 10,
"trace": "actionpack (6.0.3.3) lib/abstract_controller/callbacks.rb:41:inprocess_action'" }, { "exception_object_id": 63840, "id": 11, "trace": "actionpack (6.0.3.3) lib/action_controller/metal/rescue.rb:22:in
process_action'"
},
{
"exception_object_id": 63840,
"id": 12,
"trace": "actionpack (6.0.3.3) lib/action_controller/metal/instrumentation.rb:33:inblock in process_action'" }, { "exception_object_id": 63840, "id": 13, "trace": "activesupport (6.0.3.3) lib/active_support/notifications.rb:180:in
block in instrument'"
},
{
"exception_object_id": 63840,
"id": 14,
"trace": "activesupport (6.0.3.3) lib/active_support/notifications/instrumenter.rb:24:ininstrument'" }, { "exception_object_id": 63840, "id": 15, "trace": "activesupport (6.0.3.3) lib/active_support/notifications.rb:180:in
instrument'"
},
{
"exception_object_id": 63840,
"id": 16,
"trace": "actionpack (6.0.3.3) lib/action_controller/metal/instrumentation.rb:32:inprocess_action'" }, { "exception_object_id": 63840, "id": 17, "trace": "actionpack (6.0.3.3) lib/action_controller/metal/params_wrapper.rb:245:in
process_action'"
},
{
"exception_object_id": 63840,
"id": 18,
"trace": "activerecord (6.0.3.3) lib/active_record/railties/controller_runtime.rb:27:inprocess_action'" }, { "exception_object_id": 63840, "id": 19, "trace": "actionpack (6.0.3.3) lib/abstract_controller/base.rb:136:in
process'"
},
{
"exception_object_id": 63840,
"id": 20,
"trace": "actionview (6.0.3.3) lib/action_view/rendering.rb:39:inprocess'" }, { "exception_object_id": 63840, "id": 21, "trace": "actionpack (6.0.3.3) lib/action_controller/metal.rb:190:in
dispatch'"
},
{
"exception_object_id": 63840,
"id": 22,
"trace": "actionpack (6.0.3.3) lib/action_controller/metal.rb:254:indispatch'" }, { "exception_object_id": 63840, "id": 23, "trace": "actionpack (6.0.3.3) lib/action_dispatch/routing/route_set.rb:50:in
dispatch'"
},
{
"exception_object_id": 63840,
"id": 24,
"trace": "actionpack (6.0.3.3) lib/action_dispatch/routing/route_set.rb:33:inserve'" }, { "exception_object_id": 63840, "id": 25, "trace": "actionpack (6.0.3.3) lib/action_dispatch/journey/router.rb:49:in
block in serve'"
},
{
"exception_object_id": 63840,
"id": 26,
"trace": "actionpack (6.0.3.3) lib/action_dispatch/journey/router.rb:32:ineach'" }, { "exception_object_id": 63840, "id": 27, "trace": "actionpack (6.0.3.3) lib/action_dispatch/journey/router.rb:32:in
serve'"
},
{
"exception_object_id": 63840,
"id": 28,
"trace": "actionpack (6.0.3.3) lib/action_dispatch/routing/route_set.rb:834:incall'" }, { "exception_object_id": 63840, "id": 29, "trace": "rack (2.2.3) lib/rack/etag.rb:27:in
call'"
},
{
"exception_object_id": 63840,
"id": 30,
"trace": "rack (2.2.3) lib/rack/conditional_get.rb:40:incall'" }, { "exception_object_id": 63840, "id": 31, "trace": "rack (2.2.3) lib/rack/head.rb:12:in
call'"
},
{
"exception_object_id": 63840,
"id": 32,
"trace": "activerecord (6.0.3.3) lib/active_record/migration.rb:567:incall'" }, { "exception_object_id": 63840, "id": 33, "trace": "actionpack (6.0.3.3) lib/action_dispatch/middleware/callbacks.rb:27:in
block in call'"
},
{
"exception_object_id": 63840,
"id": 34,
"trace": "activesupport (6.0.3.3) lib/active_support/callbacks.rb:101:inrun_callbacks'" }, { "exception_object_id": 63840, "id": 35, "trace": "actionpack (6.0.3.3) lib/action_dispatch/middleware/callbacks.rb:26:in
call'"
},
{
"exception_object_id": 63840,
"id": 36,
"trace": "actionpack (6.0.3.3) lib/action_dispatch/middleware/executor.rb:14:incall'" }, { "exception_object_id": 63840, "id": 37, "trace": "actionpack (6.0.3.3) lib/action_dispatch/middleware/actionable_exceptions.rb:17:in
call'"
},
{
"exception_object_id": 63840,
"id": 38,
"trace": "actionpack (6.0.3.3) lib/action_dispatch/middleware/debug_exceptions.rb:32:incall'" }, { "exception_object_id": 63840, "id": 39, "trace": "actionpack (6.0.3.3) lib/action_dispatch/middleware/show_exceptions.rb:33:in
call'"
},
{
"exception_object_id": 63840,
"id": 40,
"trace": "railties (6.0.3.3) lib/rails/rack/logger.rb:37:incall_app'" }, { "exception_object_id": 63840, "id": 41, "trace": "railties (6.0.3.3) lib/rails/rack/logger.rb:26:in
block in call'"
},
{
"exception_object_id": 63840,
"id": 42,
"trace": "activesupport (6.0.3.3) lib/active_support/tagged_logging.rb:80:inblock in tagged'" }, { "exception_object_id": 63840, "id": 43, "trace": "activesupport (6.0.3.3) lib/active_support/tagged_logging.rb:28:in
tagged'"
},
{
"exception_object_id": 63840,
"id": 44,
"trace": "activesupport (6.0.3.3) lib/active_support/tagged_logging.rb:80:intagged'" }, { "exception_object_id": 63840, "id": 45, "trace": "railties (6.0.3.3) lib/rails/rack/logger.rb:26:in
call'"
},
{
"exception_object_id": 63840,
"id": 46,
"trace": "actionpack (6.0.3.3) lib/action_dispatch/middleware/remote_ip.rb:81:incall'" }, { "exception_object_id": 63840, "id": 47, "trace": "actionpack (6.0.3.3) lib/action_dispatch/middleware/request_id.rb:27:in
call'"
},
{
"exception_object_id": 63840,
"id": 48,
"trace": "rack (2.2.3) lib/rack/runtime.rb:22:incall'" }, { "exception_object_id": 63840, "id": 49, "trace": "activesupport (6.0.3.3) lib/active_support/cache/strategy/local_cache_middleware.rb:29:in
call'"
},
{
"exception_object_id": 63840,
"id": 50,
"trace": "actionpack (6.0.3.3) lib/action_dispatch/middleware/executor.rb:14:incall'" }, { "exception_object_id": 63840, "id": 51, "trace": "actionpack (6.0.3.3) lib/action_dispatch/middleware/static.rb:126:in
call'"
},
{
"exception_object_id": 63840,
"id": 52,
"trace": "rack (2.2.3) lib/rack/sendfile.rb:110:incall'" }, { "exception_object_id": 63840, "id": 53, "trace": "actionpack (6.0.3.3) lib/action_dispatch/middleware/host_authorization.rb:82:in
call'"
},
{
"exception_object_id": 63840,
"id": 54,
"trace": "rack-cors (1.1.1) lib/rack/cors.rb:100:incall'" }, { "exception_object_id": 63840, "id": 55, "trace": "railties (6.0.3.3) lib/rails/engine.rb:527:in
call'"
},
{
"exception_object_id": 63840,
"id": 56,
"trace": "puma (4.3.6) lib/puma/configuration.rb:228:incall'" }, { "exception_object_id": 63840, "id": 57, "trace": "puma (4.3.6) lib/puma/server.rb:713:in
handle_request'"
},
{
"exception_object_id": 63840,
"id": 58,
"trace": "puma (4.3.6) lib/puma/server.rb:472:inprocess_client'" }, { "exception_object_id": 63840, "id": 59, "trace": "puma (4.3.6) lib/puma/server.rb:328:in
block in run'"
},
{
"exception_object_id": 63840,
"id": 60,
"trace": "puma (4.3.6) lib/puma/thread_pool.rb:134:in `block in spawn_thread'"
}
],
XML parsed and generated using Nokogiri
Hi, how could I assign a Musicbrainz/Spotify ID to a track ?
See the XSPF identifer specs.
Thanks !
Hi again !
Looks like generating XSPF playlists is broken, the artist is missing in the output !
puts Playlist::Format::SimpleText.generate(playlist)
give me
Victor Wooten - Flip Flop (Bonus Track)
while
puts Playlist::Format::XSPF.generate(playlist)
gives me
<track> <title>Flip Flop (Bonus Track)</title> <album>A Show of Hands 15</album> </track>
Any chance that you could fix this ?
Thanks a lot for your work !
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.