Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc
Commits
00f8541d
Commit
00f8541d
authored
Feb 27, 2010
by
Fabio Ritrovato
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Lua SD: Jamendo - using album_image will give better results than album_id
parent
1cf9988a
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
7 deletions
+7
-7
share/lua/playlist/jamendo.lua
share/lua/playlist/jamendo.lua
+1
-1
share/lua/sd/jamendo.lua
share/lua/sd/jamendo.lua
+6
-6
No files found.
share/lua/playlist/jamendo.lua
View file @
00f8541d
...
@@ -56,7 +56,7 @@ function parse()
...
@@ -56,7 +56,7 @@ function parse()
stream_url
=
track
.
children_map
[
"stream"
][
1
].
children
[
1
]
stream_url
=
track
.
children_map
[
"stream"
][
1
].
children
[
1
]
end
end
table.insert
(
tracks
,
{
path
=
stream_url
,
table.insert
(
tracks
,
{
path
=
stream_url
,
arturl
=
track
.
children_map
[
"album_i
d"
]
and
"http://imgjam.com/albums/"
..
track
.
children_map
[
"album_id"
][
1
].
children
[
1
]
..
"/covers/1.500.jpg"
or
(
track
.
children_map
[
"album_image"
]
and
track
.
children_map
[
"album_image"
][
1
].
children
[
1
]
or
nil
),
arturl
=
track
.
children_map
[
"album_i
mage"
]
and
track
.
children_map
[
"album_image"
][
1
].
children
[
1
]
or
(
track
.
children_map
[
"album_id"
]
and
"http://imgjam.com/albums/"
..
track
.
children_map
[
"album_id"
][
1
].
children
[
1
]
..
"/covers/1.500.jpg"
or
nil
),
title
=
track
.
children_map
[
"name"
]
and
track
.
children_map
[
"name"
][
1
].
children
[
1
]
or
nil
,
title
=
track
.
children_map
[
"name"
]
and
track
.
children_map
[
"name"
][
1
].
children
[
1
]
or
nil
,
artist
=
track
.
children_map
[
"artist_name"
]
and
track
.
children_map
[
"artist_name"
][
1
].
children
[
1
]
or
nil
,
artist
=
track
.
children_map
[
"artist_name"
]
and
track
.
children_map
[
"artist_name"
][
1
].
children
[
1
]
or
nil
,
album
=
track
.
children_map
[
"album_name"
]
and
track
.
children_map
[
"album_name"
][
1
].
children
[
1
]
or
nil
,
album
=
track
.
children_map
[
"album_name"
]
and
track
.
children_map
[
"album_name"
][
1
].
children
[
1
]
or
nil
,
...
...
share/lua/sd/jamendo.lua
View file @
00f8541d
...
@@ -38,7 +38,7 @@ function main()
...
@@ -38,7 +38,7 @@ function main()
end
end
function
add_top_albums
(
album_order
,
tag
,
max_results
)
function
add_top_albums
(
album_order
,
tag
,
max_results
)
local
url
=
"http://api.jamendo.com/get2/id+name+artist_name
/album/xml/?
order="
..
album_order
..
"&n="
..
max_results
local
url
=
"http://api.jamendo.com/get2/id+name+artist_name
+image/album/xml/?imagesize=500&
order="
..
album_order
..
"&n="
..
max_results
if
tag
~=
nil
then
if
tag
~=
nil
then
url
=
url
..
"&tag_idstr="
..
tag
url
=
url
..
"&tag_idstr="
..
tag
end
end
...
@@ -61,11 +61,11 @@ function add_top_albums( album_order, tag, max_results )
...
@@ -61,11 +61,11 @@ function add_top_albums( album_order, tag, max_results )
for
_
,
album
in
ipairs
(
tree
.
children
)
do
for
_
,
album
in
ipairs
(
tree
.
children
)
do
simplexml
.
add_name_maps
(
album
)
simplexml
.
add_name_maps
(
album
)
local
album_node
=
node
:
add_node
(
{
title
=
album
.
children_map
[
"artist_name"
][
1
].
children
[
1
]
..
" - "
..
album
.
children_map
[
"name"
][
1
].
children
[
1
],
local
album_node
=
node
:
add_node
(
{
title
=
album
.
children_map
[
"artist_name"
][
1
].
children
[
1
]
..
" - "
..
album
.
children_map
[
"name"
][
1
].
children
[
1
],
arturl
=
"http://imgjam.com/albums/"
..
album
.
children_map
[
"id"
][
1
].
children
[
1
]
..
"/covers/1.500.jpg"
}
)
arturl
=
album
.
children_map
[
"image"
][
1
].
children
[
1
]
}
)
local
tracks
=
get_tracks_from_album
(
album
.
children_map
[
"id"
][
1
].
children
[
1
]
)
local
tracks
=
get_tracks_from_album
(
album
.
children_map
[
"id"
][
1
].
children
[
1
]
)
for
_
,
track
in
ipairs
(
tracks
)
do
for
_
,
track
in
ipairs
(
tracks
)
do
album_node
:
add_subitem
(
{
path
=
"http://api.jamendo.com/get2/stream/track/redirect/?id="
..
track
.
id
,
album_node
:
add_subitem
(
{
path
=
"http://api.jamendo.com/get2/stream/track/redirect/?id="
..
track
.
id
,
arturl
=
"http://imgjam.com/albums/"
..
album
.
children_map
[
"id"
][
1
].
children
[
1
]
..
"/covers/1.500.jpg"
,
arturl
=
album
.
children_map
[
"image"
][
1
].
children
[
1
]
,
title
=
track
.
title
,
title
=
track
.
title
,
artist
=
album
.
children_map
[
"artist_name"
][
1
].
children
[
1
],
artist
=
album
.
children_map
[
"artist_name"
][
1
].
children
[
1
],
album
=
album
.
children_map
[
"name"
][
1
].
children
[
1
],
album
=
album
.
children_map
[
"name"
][
1
].
children
[
1
],
...
@@ -77,7 +77,7 @@ function add_top_albums( album_order, tag, max_results )
...
@@ -77,7 +77,7 @@ function add_top_albums( album_order, tag, max_results )
end
end
function
add_top_tracks
(
track_order
,
tag
,
max_results
)
function
add_top_tracks
(
track_order
,
tag
,
max_results
)
local
url
=
"http://api.jamendo.com/get2/id+name+artist_name+album_name+album_id+duration+album_genre+album_
dates/track/xml/track_album+album_artist/?
order="
..
track_order
..
"&n="
..
max_results
local
url
=
"http://api.jamendo.com/get2/id+name+artist_name+album_name+album_id+duration+album_genre+album_
image+album_dates/track/xml/track_album+album_artist/?imagesize=500&
order="
..
track_order
..
"&n="
..
max_results
if
tag
~=
nil
then
if
tag
~=
nil
then
url
=
url
..
"&tag_idstr="
..
tag
url
=
url
..
"&tag_idstr="
..
tag
end
end
...
@@ -105,7 +105,7 @@ function add_top_tracks( track_order, tag, max_results )
...
@@ -105,7 +105,7 @@ function add_top_tracks( track_order, tag, max_results )
album
=
track
.
children_map
[
"album_name"
][
1
].
children
[
1
],
album
=
track
.
children_map
[
"album_name"
][
1
].
children
[
1
],
genre
=
track
.
children_map
[
"album_genre"
][
1
].
children
[
1
],
genre
=
track
.
children_map
[
"album_genre"
][
1
].
children
[
1
],
date
=
track
.
children_map
[
"album_dates"
][
1
].
children_map
[
"year"
][
1
].
children
[
1
],
date
=
track
.
children_map
[
"album_dates"
][
1
].
children_map
[
"year"
][
1
].
children
[
1
],
arturl
=
"http://imgjam.com/albums/"
..
track
.
children_map
[
"album_id"
][
1
].
children
[
1
]
..
"/covers/1.500.jpg"
,
arturl
=
track
.
children_map
[
"album_image"
][
1
].
children
[
1
]
,
duration
=
track
.
children_map
[
"duration"
][
1
].
children
[
1
]}
)
duration
=
track
.
children_map
[
"duration"
][
1
].
children
[
1
]}
)
end
end
end
end
...
@@ -133,7 +133,7 @@ function add_radio_from_id( id, max_results )
...
@@ -133,7 +133,7 @@ function add_radio_from_id( id, max_results )
elseif
id
==
"7"
then
radio_name
=
"Lounge"
elseif
id
==
"7"
then
radio_name
=
"Lounge"
elseif
id
==
"4"
then
radio_name
=
"Dance / Electro"
elseif
id
==
"4"
then
radio_name
=
"Dance / Electro"
end
end
vlc
.
sd
.
add_item
(
{
path
=
"http://api.jamendo.com/get2/id+name+artist_name+album_name+duration+album_genre+album_
dates/track/xml/radio_track_inradioplaylist+track_album+album_artist/?
order=random_desc&radio_id="
..
id
..
"&n="
..
max_results
,
vlc
.
sd
.
add_item
(
{
path
=
"http://api.jamendo.com/get2/id+name+artist_name+album_name+duration+album_genre+album_
image+album_dates/track/xml/radio_track_inradioplaylist+track_album+album_artist/?imagesize=500&
order=random_desc&radio_id="
..
id
..
"&n="
..
max_results
,
title
=
radio_name
}
)
title
=
radio_name
}
)
end
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment