Merge lp:~submarine/ubuntu-scopes/audacious-extra-metadata into lp:~submarine/ubuntu-scopes/audacious

Proposed by Mark Tully
Status: Merged
Approved by: James Henstridge
Approved revision: 28
Merged at revision: 25
Proposed branch: lp:~submarine/ubuntu-scopes/audacious-extra-metadata
Merge into: lp:~submarine/ubuntu-scopes/audacious
Diff against target: 93 lines (+30/-8)
2 files modified
debian/control (+1/-1)
src/unity_audacious_daemon.py (+29/-7)
To merge this branch: bzr merge lp:~submarine/ubuntu-scopes/audacious-extra-metadata
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Approve
James Henstridge Approve
Review via email: mp+154132@code.launchpad.net

Commit message

Added year, genre, artist and album to result's metadata.

Also changing DEFAULT_RESULT_TYPE to PERSONAL & fixing other variables

Description of the change

Added year, genre, artist and album to result's metadata.

Also changing DEFAULT_RESULT_TYPE to PERSONAL & fixing other variables

To post a comment you must log in.
28. By Mark Tully

Added Suggests: audacious to debian/control

Revision history for this message
David Callé (davidc3) wrote :

+1

Revision history for this message
David Callé (davidc3) wrote :

Extra metadata needs testing, this will be added in another merge to fix https://bugs.launchpad.net/ubuntu-scopes/+bug/1157672

Revision history for this message
James Henstridge (jamesh) wrote :

Looks good.

review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/control'
2--- debian/control 2013-03-15 09:13:16 +0000
3+++ debian/control 2013-03-19 22:08:22 +0000
4@@ -6,7 +6,6 @@
5 python3,
6 python3-distutils-extra,
7 python3-gi,
8- python3-gi,
9 pkg-config,
10 python3-nose,
11 python3-dbus,
12@@ -30,6 +29,7 @@
13 gir1.2-dee-1.0,
14 unity-scopes-runner,
15 gir1.2-glib-2.0
16+Suggests: audacious
17 Description: Audacious scope for Unity
18 This package contains the "audacious" scope which allows Unity
19 to search for audacious content.
20
21=== modified file 'src/unity_audacious_daemon.py'
22--- src/unity_audacious_daemon.py 2013-03-14 12:27:15 +0000
23+++ src/unity_audacious_daemon.py 2013-03-19 22:08:22 +0000
24@@ -40,10 +40,10 @@
25 NO_RESULTS_HINT = _('Sorry, there are no Audacious results that match your search.')
26 PROVIDER_CREDITS = _('')
27 SVG_DIR = '/usr/share/icons/unity-icon-theme/places/svg/'
28-PROVIDER_ICON = SVG_DIR + 'service-yelp.svg'
29-DEFAULT_RESULT_ICON = SVG_DIR + 'result-help.svg'
30-DEFAULT_RESULT_MIMETYPE = 'x-scheme-handler/man'
31-DEFAULT_RESULT_TYPE = Unity.ResultType.DEFAULT
32+PROVIDER_ICON = SVG_DIR + 'service-audacious.svg'
33+DEFAULT_RESULT_ICON = SVG_DIR + 'result-audacious.svg'
34+DEFAULT_RESULT_MIMETYPE = 'taglib/mp3'
35+DEFAULT_RESULT_TYPE = Unity.ResultType.PERSONAL
36 AUDACIOUS_DBFILE = os.getenv("HOME") + "/.config/audacious/playlists/"
37
38 c1 = {'id': 'songs',
39@@ -58,7 +58,19 @@
40
41 FILTERS = []
42
43-EXTRA_METADATA = []
44+m1 = {'id' :'album',
45+ 'type' :'s',
46+ 'field':Unity.SchemaFieldType.OPTIONAL}
47+m2 = {'id' :'artist',
48+ 'type' :'s',
49+ 'field':Unity.SchemaFieldType.OPTIONAL}
50+m3 = {'id' :'genre',
51+ 'type' :'s',
52+ 'field':Unity.SchemaFieldType.OPTIONAL}
53+m4 = {'id' :'year',
54+ 'type' :'i',
55+ 'field':Unity.SchemaFieldType.OPTIONAL}
56+EXTRA_METADATA = [m1, m2, m3, m4]
57
58 REFRESH_TIMEOUT = 300
59 PREVIEW_PLAYER_DBUS_NAME = "com.canonical.Unity.Lens.Music.PreviewPlayer"
60@@ -170,6 +182,8 @@
61 album = "" if track[3] is None else track[3]
62 mimetype = "" if track[4] is None else track[4]
63 albumartist = "" if track[5] is None else track[2]
64+ year = 0 if track[5] is None else int(track[5])
65+ genre = u"" if track[6] is None else track[6]
66 trackname = title + " - " + album + " - " + artist
67 if search.lower() in trackname.lower():
68 albumart = get_album_art(track)
69@@ -180,7 +194,11 @@
70 'category': 0,
71 'mimetype': mimetype,
72 'title': title,
73- 'comment': artist})
74+ 'comment': artist,
75+ 'album':GLib.Variant('s', album),
76+ 'artist':GLib.Variant('s', artist),
77+ 'genre':GLib.Variant('s', genre),
78+ 'year':GLib.Variant('i', year)})
79 trackresults.append(track)
80
81 if album not in albumresults:
82@@ -189,7 +207,11 @@
83 'category': 1,
84 'mimetype': mimetype,
85 'title': album,
86- 'comment': artist})
87+ 'comment': artist,
88+ 'album':GLib.Variant('s', album),
89+ 'artist':GLib.Variant('s', artist),
90+ 'genre':GLib.Variant('s', genre),
91+ 'year':GLib.Variant('i', year)})
92 albumresults.append(album)
93 return results
94

Subscribers

People subscribed via source and target branches

to all changes: