Commit d51c1abd authored by Rémi Duraffort's avatar Rémi Duraffort

librivox: create a node for each book of the podcast.

parent 470dea53
...@@ -45,12 +45,17 @@ function main() ...@@ -45,12 +45,17 @@ function main()
simplexml.add_name_maps( podcast ) simplexml.add_name_maps( podcast )
local channel = podcast.children_map['channel'][1] local channel = podcast.children_map['channel'][1]
local arturl = '' local arturl = ''
local books = {}
for _, item in ipairs( channel.children ) do for _, item in ipairs( channel.children ) do
if( item.name == 'item' ) if( item.name == 'item' )
then then
simplexml.add_name_maps( item ) simplexml.add_name_maps( item )
local new_item = vlc.sd.add_item( { path = item.children_map['link'][1].children[1], local book_title = item.children_map['itunes:subtitle'][1].children[1]
if(books[book_title] == nil) then
books[book_title] = vlc.sd.add_node( { title = book_title } )
end
books[book_title]:add_subitem( { path = item.children_map['link'][1].children[1],
title = item.children_map['title'][1].children[1], title = item.children_map['title'][1].children[1],
album = item.children_map['itunes:subtitle'][1].children[1], album = item.children_map['itunes:subtitle'][1].children[1],
duration = string_2_duration( item.children_map['itunes:duration'][1].children[1] ), duration = string_2_duration( item.children_map['itunes:duration'][1].children[1] ),
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment