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
=== modified file 'debian/control'
--- debian/control 2013-03-15 09:13:16 +0000
+++ debian/control 2013-03-19 22:08:22 +0000
@@ -6,7 +6,6 @@
6 python3,6 python3,
7 python3-distutils-extra,7 python3-distutils-extra,
8 python3-gi,8 python3-gi,
9 python3-gi,
10 pkg-config,9 pkg-config,
11 python3-nose,10 python3-nose,
12 python3-dbus,11 python3-dbus,
@@ -30,6 +29,7 @@
30 gir1.2-dee-1.0,29 gir1.2-dee-1.0,
31 unity-scopes-runner,30 unity-scopes-runner,
32 gir1.2-glib-2.031 gir1.2-glib-2.0
32Suggests: audacious
33Description: Audacious scope for Unity33Description: Audacious scope for Unity
34 This package contains the "audacious" scope which allows Unity34 This package contains the "audacious" scope which allows Unity
35 to search for audacious content.35 to search for audacious content.
3636
=== modified file 'src/unity_audacious_daemon.py'
--- src/unity_audacious_daemon.py 2013-03-14 12:27:15 +0000
+++ src/unity_audacious_daemon.py 2013-03-19 22:08:22 +0000
@@ -40,10 +40,10 @@
40NO_RESULTS_HINT = _('Sorry, there are no Audacious results that match your search.')40NO_RESULTS_HINT = _('Sorry, there are no Audacious results that match your search.')
41PROVIDER_CREDITS = _('')41PROVIDER_CREDITS = _('')
42SVG_DIR = '/usr/share/icons/unity-icon-theme/places/svg/'42SVG_DIR = '/usr/share/icons/unity-icon-theme/places/svg/'
43PROVIDER_ICON = SVG_DIR + 'service-yelp.svg'43PROVIDER_ICON = SVG_DIR + 'service-audacious.svg'
44DEFAULT_RESULT_ICON = SVG_DIR + 'result-help.svg'44DEFAULT_RESULT_ICON = SVG_DIR + 'result-audacious.svg'
45DEFAULT_RESULT_MIMETYPE = 'x-scheme-handler/man'45DEFAULT_RESULT_MIMETYPE = 'taglib/mp3'
46DEFAULT_RESULT_TYPE = Unity.ResultType.DEFAULT46DEFAULT_RESULT_TYPE = Unity.ResultType.PERSONAL
47AUDACIOUS_DBFILE = os.getenv("HOME") + "/.config/audacious/playlists/"47AUDACIOUS_DBFILE = os.getenv("HOME") + "/.config/audacious/playlists/"
4848
49c1 = {'id': 'songs',49c1 = {'id': 'songs',
@@ -58,7 +58,19 @@
5858
59FILTERS = []59FILTERS = []
6060
61EXTRA_METADATA = []61m1 = {'id' :'album',
62 'type' :'s',
63 'field':Unity.SchemaFieldType.OPTIONAL}
64m2 = {'id' :'artist',
65 'type' :'s',
66 'field':Unity.SchemaFieldType.OPTIONAL}
67m3 = {'id' :'genre',
68 'type' :'s',
69 'field':Unity.SchemaFieldType.OPTIONAL}
70m4 = {'id' :'year',
71 'type' :'i',
72 'field':Unity.SchemaFieldType.OPTIONAL}
73EXTRA_METADATA = [m1, m2, m3, m4]
6274
63REFRESH_TIMEOUT = 30075REFRESH_TIMEOUT = 300
64PREVIEW_PLAYER_DBUS_NAME = "com.canonical.Unity.Lens.Music.PreviewPlayer"76PREVIEW_PLAYER_DBUS_NAME = "com.canonical.Unity.Lens.Music.PreviewPlayer"
@@ -170,6 +182,8 @@
170 album = "" if track[3] is None else track[3]182 album = "" if track[3] is None else track[3]
171 mimetype = "" if track[4] is None else track[4]183 mimetype = "" if track[4] is None else track[4]
172 albumartist = "" if track[5] is None else track[2]184 albumartist = "" if track[5] is None else track[2]
185 year = 0 if track[5] is None else int(track[5])
186 genre = u"" if track[6] is None else track[6]
173 trackname = title + " - " + album + " - " + artist187 trackname = title + " - " + album + " - " + artist
174 if search.lower() in trackname.lower():188 if search.lower() in trackname.lower():
175 albumart = get_album_art(track)189 albumart = get_album_art(track)
@@ -180,7 +194,11 @@
180 'category': 0,194 'category': 0,
181 'mimetype': mimetype,195 'mimetype': mimetype,
182 'title': title,196 'title': title,
183 'comment': artist})197 'comment': artist,
198 'album':GLib.Variant('s', album),
199 'artist':GLib.Variant('s', artist),
200 'genre':GLib.Variant('s', genre),
201 'year':GLib.Variant('i', year)})
184 trackresults.append(track)202 trackresults.append(track)
185203
186 if album not in albumresults:204 if album not in albumresults:
@@ -189,7 +207,11 @@
189 'category': 1,207 'category': 1,
190 'mimetype': mimetype,208 'mimetype': mimetype,
191 'title': album,209 'title': album,
192 'comment': artist})210 'comment': artist,
211 'album':GLib.Variant('s', album),
212 'artist':GLib.Variant('s', artist),
213 'genre':GLib.Variant('s', genre),
214 'year':GLib.Variant('i', year)})
193 albumresults.append(album)215 albumresults.append(album)
194 return results216 return results
195217

Subscribers

People subscribed via source and target branches

to all changes: