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
1=== modified file 'debian/control'
2--- debian/control 2013-03-15 09:11:48 +0000
3+++ debian/control 2013-03-19 22:07:22 +0000
4@@ -29,6 +29,7 @@
5 unity-scopes-runner,
6 gir1.2-glib-2.0,
7 python3-dbus,
8+Suggests: musique
9 Description: Musique scope for Unity
10 This package contains the "musique" scope which allows Unity
11 to search datas from the "musique" media player.
12
13=== modified file 'src/unity_musique_daemon.py'
14--- src/unity_musique_daemon.py 2013-03-14 12:28:52 +0000
15+++ src/unity_musique_daemon.py 2013-03-19 22:07:22 +0000
16@@ -39,9 +39,9 @@
17 PROVIDER_CREDITS = _('')
18 SVG_DIR = '/usr/share/icons/unity-icon-theme/places/svg/'
19 PROVIDER_ICON = SVG_DIR + 'service-musique.svg'
20-DEFAULT_RESULT_ICON = SVG_DIR + 'result-help.svg'
21-DEFAULT_RESULT_MIMETYPE = 'text-html'
22-DEFAULT_RESULT_TYPE = Unity.ResultType.DEFAULT
23+DEFAULT_RESULT_ICON = SVG_DIR + 'result-musique.svg'
24+DEFAULT_RESULT_MIMETYPE = 'taglib/mp3'
25+DEFAULT_RESULT_TYPE = Unity.ResultType.PERSONAL
26 MUSIQUE_DBFILE = os.getenv("HOME") + "/.local/share/data/Flavio Tordini/Musique/musique.db"
27 MUSIQUE_BACKUP_DBFILE = os.getenv("HOME") + "/.local/share/data/Flavio Tordini/Musique/musiquee-scope-backup.db"
28
29@@ -57,7 +57,19 @@
30
31 FILTERS = []
32
33-EXTRA_METADATA = []
34+m1 = {'id' :'album',
35+ 'type' :'s',
36+ 'field':Unity.SchemaFieldType.OPTIONAL}
37+m2 = {'id' :'artist',
38+ 'type' :'s',
39+ 'field':Unity.SchemaFieldType.OPTIONAL}
40+m3 = {'id' :'genre',
41+ 'type' :'s',
42+ 'field':Unity.SchemaFieldType.OPTIONAL}
43+m4 = {'id' :'year',
44+ 'type' :'i',
45+ 'field':Unity.SchemaFieldType.OPTIONAL}
46+EXTRA_METADATA = [m1, m2, m3, m4]
47
48 REFRESH_TIMEOUT = 300
49 PREVIEW_PLAYER_DBUS_NAME = "com.canonical.Unity.Lens.Music.PreviewPlayer"
50@@ -152,6 +164,8 @@
51 album = u"" if track[3] is None else str(track[3])
52 mimetype = u"" if track[4] is None else str(track[4])
53 albumartist = u"" if track[2] is None else str(track[2])
54+ year = 0 if track[5] is None else int(track[5])
55+ genre = ""
56 trackname = title + u" - " + album + u" - " + artist
57 if search.lower() in trackname.lower():
58 albumart = get_album_art(track)
59@@ -162,7 +176,11 @@
60 'category': 0,
61 'mimetype': mimetype,
62 'title': title,
63- 'comment': artist})
64+ 'comment': artist,
65+ 'album':GLib.Variant('s', album),
66+ 'artist':GLib.Variant('s', artist),
67+ 'genre':GLib.Variant('s', genre),
68+ 'year':GLib.Variant('i', year)})
69 trackresults.append(track)
70
71 if album not in albumresults:
72@@ -171,7 +189,11 @@
73 'category': 1,
74 'mimetype': mimetype,
75 'title': album,
76- 'comment': artist})
77+ 'comment': artist,
78+ 'album':GLib.Variant('s', album),
79+ 'artist':GLib.Variant('s', artist),
80+ 'genre':GLib.Variant('s', genre),
81+ 'year':GLib.Variant('i', year)})
82 albumresults.append(album)
83 return results
84

Subscribers

People subscribed via source and target branches

to all changes: