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

Proposed by Mark Tully
Status: Merged
Approved by: James Henstridge
Approved revision: 20
Merged at revision: 17
Proposed branch: lp:~submarine/ubuntu-scopes/guayadeque-extra-metadata
Merge into: lp:~submarine/ubuntu-scopes/guayadeque
Diff against target: 90 lines (+30/-6)
3 files modified
.bzrignore (+1/-0)
debian/control (+1/-0)
src/unity_guayadeque_daemon.py (+28/-6)
To merge this branch: bzr merge lp:~submarine/ubuntu-scopes/guayadeque-extra-metadata
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Approve
James Henstridge Approve
Review via email: mp+154133@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.
Revision history for this message
David Callé (davidc3) wrote :

+1

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

Looks good. You don't need to use the u"" syntax for text strings in Python 3 though, which would be good to keep in mind.

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/guayadeque-extra-metadata/+merge/154133/+edit-commit-message

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

Fixed commit message.

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

On further inspection, I'd like you to update the test suite to show that this new data makes it into the results from the scope.

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

FAILED: Autolanding.
Approved revid is not set in launchpad (maybe a permission problem?).
http://jenkins.qa.ubuntu.com/job/submarine-ubuntu-scopes-guayadeque-autolanding/1/
Executed test runs:
    SUCCESS: http://jenkins.qa.ubuntu.com/job/submarine-ubuntu-scopes-guayadeque-raring-amd64-autolanding/1/console

review: Needs Fixing (continuous-integration)
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/1157674

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
=== added file '.bzrignore'
--- .bzrignore 1970-01-01 00:00:00 +0000
+++ .bzrignore 2013-03-19 22:08:23 +0000
@@ -0,0 +1,1 @@
1./tests/data/Collection/guayadeque-scope-backup.db
02
=== modified file 'debian/control'
--- debian/control 2013-03-15 09:12:13 +0000
+++ debian/control 2013-03-19 22:08:23 +0000
@@ -29,6 +29,7 @@
29 gir1.2-dee-1.0,29 gir1.2-dee-1.0,
30 unity-scopes-runner,30 unity-scopes-runner,
31 gir1.2-glib-2.031 gir1.2-glib-2.0
32Suggests: guayadeque
32Description: Guayadeque scope for Unity33Description: Guayadeque scope for Unity
33 This package contains the "guayadeque" scope which allows Unity34 This package contains the "guayadeque" scope which allows Unity
34 to search for guayadeque content.35 to search for guayadeque content.
3536
=== modified file 'src/unity_guayadeque_daemon.py'
--- src/unity_guayadeque_daemon.py 2013-03-14 12:28:29 +0000
+++ src/unity_guayadeque_daemon.py 2013-03-19 22:08:23 +0000
@@ -39,10 +39,10 @@
39NO_RESULTS_HINT = _('Sorry, there are no Guayadeque results that match your search.')39NO_RESULTS_HINT = _('Sorry, there are no Guayadeque results that match your search.')
40PROVIDER_CREDITS = _('')40PROVIDER_CREDITS = _('')
41SVG_DIR = '/usr/share/icons/unity-icon-theme/places/svg/'41SVG_DIR = '/usr/share/icons/unity-icon-theme/places/svg/'
42PROVIDER_ICON = SVG_DIR + 'service-yelp.svg'42PROVIDER_ICON = SVG_DIR + 'service-guayadeque.svg'
43DEFAULT_RESULT_ICON = SVG_DIR + 'result-guayadeque.svg'43DEFAULT_RESULT_ICON = SVG_DIR + 'result-guayadeque.svg'
44DEFAULT_RESULT_MIMETYPE = 'x-scheme-handler/man'44DEFAULT_RESULT_MIMETYPE = 'taglib/mp3'
45DEFAULT_RESULT_TYPE = Unity.ResultType.DEFAULT45DEFAULT_RESULT_TYPE = Unity.ResultType.PERSONAL
46GUAYADEQUE_DBFILE = os.getenv("HOME") + "/.guayadeque/Collections"46GUAYADEQUE_DBFILE = os.getenv("HOME") + "/.guayadeque/Collections"
4747
48c1 = {'id': 'songs',48c1 = {'id': 'songs',
@@ -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"
@@ -146,6 +158,8 @@
146 album = u"" if track[3] is None else track[4]158 album = u"" if track[3] is None else track[4]
147 mimetype = u"" if track[4] is None else track[5]159 mimetype = u"" if track[4] is None else track[5]
148 albumartist = u"" if track[5] is None else track[6]160 albumartist = u"" if track[5] is None else track[6]
161 year = 0 if track[8] is None else track[8]
162 genre = u"" if track[9] is None else track[9]
149 trackname = title + u" - " + album + u" - " + artist163 trackname = title + u" - " + album + u" - " + artist
150 if search.lower() in trackname.lower():164 if search.lower() in trackname.lower():
151 try:165 try:
@@ -159,7 +173,11 @@
159 'category': 0,173 'category': 0,
160 'mimetype': mimetype,174 'mimetype': mimetype,
161 'title': title,175 'title': title,
162 'comment': artist})176 'comment': artist,
177 'album':GLib.Variant('s', album),
178 'artist':GLib.Variant('s', artist),
179 'genre':GLib.Variant('s', genre),
180 'year':GLib.Variant('i', year)})
163 trackresults.append(track)181 trackresults.append(track)
164182
165 if album not in albumresults:183 if album not in albumresults:
@@ -168,7 +186,11 @@
168 'category': 1,186 'category': 1,
169 'mimetype': mimetype,187 'mimetype': mimetype,
170 'title': album,188 'title': album,
171 'comment': artist})189 'comment': artist,
190 'album':GLib.Variant('s', album),
191 'artist':GLib.Variant('s', artist),
192 'genre':GLib.Variant('s', genre),
193 'year':GLib.Variant('i', year)})
172 albumresults.append(album)194 albumresults.append(album)
173 return results195 return results
174196

Subscribers

People subscribed via source and target branches

to all changes: