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

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

Commit message

Add year, genre, artist and album to result's metadata. Change DEFAULT_RESULT_TYPE to PERSONAL and fix 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.
Revision history for this message
David Callé (davidc3) wrote :

+1

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

Looks good.

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

Actually, looking closer: please update the test to verify that the metadata actually gets included in the result. It looks like it should be pretty easy to update the existing test.

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

Currently, the metadata is not passed to the model. This needs further changes to the way we deal with add_result(). This applies to pretty much all new-API scopes with extra metadata.

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/1157673

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

Looks good.

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

FAILED: Autolanding.
No commit message was specified in the merge proposal. Hit 'Add commit message' on the merge proposal web page or follow the link below. You can approve the merge proposal yourself to rerun.
https://code.launchpad.net/~submarine/ubuntu-scopes/musique-extra-metadata/+merge/154130/+edit-commit-message

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

FAILED: Autolanding.
No commit message was specified in the merge proposal. Hit 'Add commit message' on the merge proposal web page or follow the link below. You can approve the merge proposal yourself to rerun.
https://code.launchpad.net/~submarine/ubuntu-scopes/musique-extra-metadata/+merge/154130/+edit-commit-message

review: Needs Fixing (continuous-integration)
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:11:48 +0000
+++ debian/control 2013-03-19 22:07:22 +0000
@@ -29,6 +29,7 @@
29 unity-scopes-runner,29 unity-scopes-runner,
30 gir1.2-glib-2.0,30 gir1.2-glib-2.0,
31 python3-dbus,31 python3-dbus,
32Suggests: musique
32Description: Musique scope for Unity33Description: Musique scope for Unity
33 This package contains the "musique" scope which allows Unity34 This package contains the "musique" scope which allows Unity
34 to search datas from the "musique" media player.35 to search datas from the "musique" media player.
3536
=== modified file 'src/unity_musique_daemon.py'
--- src/unity_musique_daemon.py 2013-03-14 12:28:52 +0000
+++ src/unity_musique_daemon.py 2013-03-19 22:07:22 +0000
@@ -39,9 +39,9 @@
39PROVIDER_CREDITS = _('')39PROVIDER_CREDITS = _('')
40SVG_DIR = '/usr/share/icons/unity-icon-theme/places/svg/'40SVG_DIR = '/usr/share/icons/unity-icon-theme/places/svg/'
41PROVIDER_ICON = SVG_DIR + 'service-musique.svg'41PROVIDER_ICON = SVG_DIR + 'service-musique.svg'
42DEFAULT_RESULT_ICON = SVG_DIR + 'result-help.svg'42DEFAULT_RESULT_ICON = SVG_DIR + 'result-musique.svg'
43DEFAULT_RESULT_MIMETYPE = 'text-html'43DEFAULT_RESULT_MIMETYPE = 'taglib/mp3'
44DEFAULT_RESULT_TYPE = Unity.ResultType.DEFAULT44DEFAULT_RESULT_TYPE = Unity.ResultType.PERSONAL
45MUSIQUE_DBFILE = os.getenv("HOME") + "/.local/share/data/Flavio Tordini/Musique/musique.db"45MUSIQUE_DBFILE = os.getenv("HOME") + "/.local/share/data/Flavio Tordini/Musique/musique.db"
46MUSIQUE_BACKUP_DBFILE = os.getenv("HOME") + "/.local/share/data/Flavio Tordini/Musique/musiquee-scope-backup.db"46MUSIQUE_BACKUP_DBFILE = os.getenv("HOME") + "/.local/share/data/Flavio Tordini/Musique/musiquee-scope-backup.db"
4747
@@ -57,7 +57,19 @@
5757
58FILTERS = []58FILTERS = []
5959
60EXTRA_METADATA = []60m1 = {'id' :'album',
61 'type' :'s',
62 'field':Unity.SchemaFieldType.OPTIONAL}
63m2 = {'id' :'artist',
64 'type' :'s',
65 'field':Unity.SchemaFieldType.OPTIONAL}
66m3 = {'id' :'genre',
67 'type' :'s',
68 'field':Unity.SchemaFieldType.OPTIONAL}
69m4 = {'id' :'year',
70 'type' :'i',
71 'field':Unity.SchemaFieldType.OPTIONAL}
72EXTRA_METADATA = [m1, m2, m3, m4]
6173
62REFRESH_TIMEOUT = 30074REFRESH_TIMEOUT = 300
63PREVIEW_PLAYER_DBUS_NAME = "com.canonical.Unity.Lens.Music.PreviewPlayer"75PREVIEW_PLAYER_DBUS_NAME = "com.canonical.Unity.Lens.Music.PreviewPlayer"
@@ -152,6 +164,8 @@
152 album = u"" if track[3] is None else str(track[3])164 album = u"" if track[3] is None else str(track[3])
153 mimetype = u"" if track[4] is None else str(track[4])165 mimetype = u"" if track[4] is None else str(track[4])
154 albumartist = u"" if track[2] is None else str(track[2])166 albumartist = u"" if track[2] is None else str(track[2])
167 year = 0 if track[5] is None else int(track[5])
168 genre = ""
155 trackname = title + u" - " + album + u" - " + artist169 trackname = title + u" - " + album + u" - " + artist
156 if search.lower() in trackname.lower():170 if search.lower() in trackname.lower():
157 albumart = get_album_art(track)171 albumart = get_album_art(track)
@@ -162,7 +176,11 @@
162 'category': 0,176 'category': 0,
163 'mimetype': mimetype,177 'mimetype': mimetype,
164 'title': title,178 'title': title,
165 'comment': artist})179 'comment': artist,
180 'album':GLib.Variant('s', album),
181 'artist':GLib.Variant('s', artist),
182 'genre':GLib.Variant('s', genre),
183 'year':GLib.Variant('i', year)})
166 trackresults.append(track)184 trackresults.append(track)
167185
168 if album not in albumresults:186 if album not in albumresults:
@@ -171,7 +189,11 @@
171 'category': 1,189 'category': 1,
172 'mimetype': mimetype,190 'mimetype': mimetype,
173 'title': album,191 'title': album,
174 'comment': artist})192 'comment': artist,
193 'album':GLib.Variant('s', album),
194 'artist':GLib.Variant('s', artist),
195 'genre':GLib.Variant('s', genre),
196 'year':GLib.Variant('i', year)})
175 albumresults.append(album)197 albumresults.append(album)
176 return results198 return results
177199

Subscribers

People subscribed via source and target branches

to all changes: