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

Proposed by Mark Tully
Status: Merged
Approved by: James Henstridge
Approved revision: 20
Merged at revision: 17
Proposed branch: lp:~submarine/ubuntu-scopes/gmusicbrowser-extra-metadata
Merge into: lp:~submarine/ubuntu-scopes/gmusicbrowser
Diff against target: 91 lines (+29/-7)
2 files modified
debian/control (+1/-0)
src/unity_gmusicbrowser_daemon.py (+28/-7)
To merge this branch: bzr merge lp:~submarine/ubuntu-scopes/gmusicbrowser-extra-metadata
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Approve
James Henstridge Approve
Review via email: mp+154129@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.

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

review: Needs Fixing (continuous-integration)
Revision history for this message
James Henstridge (jamesh) wrote :

On further inspection, please update the existing tests to show this additional metadata is included in results.

review: Needs Fixing
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/1157671

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:33 +0000
3+++ debian/control 2013-03-19 22:07:21 +0000
4@@ -29,6 +29,7 @@
5 gir1.2-dee-1.0,
6 unity-scopes-runner,
7 gir1.2-glib-2.0,
8+Suggests: gmusicbrowser
9 Description: gmusicbrowser scope for Unity
10 This package contains the "gmusicbrowser" scope which allows Unity
11 to search for gmusicbrowser content.
12
13=== modified file 'src/unity_gmusicbrowser_daemon.py'
14--- src/unity_gmusicbrowser_daemon.py 2013-03-14 12:28:15 +0000
15+++ src/unity_gmusicbrowser_daemon.py 2013-03-19 22:07:21 +0000
16@@ -35,9 +35,9 @@
17 PROVIDER_CREDITS = _('')
18 SVG_DIR = '/usr/share/icons/unity-icon-theme/places/svg/'
19 PROVIDER_ICON = SVG_DIR + 'service-gmusicbrowser.svg'
20-DEFAULT_RESULT_ICON = SVG_DIR + 'result-help.svg'
21-DEFAULT_RESULT_MIMETYPE = 'x-scheme-handler/man'
22-DEFAULT_RESULT_TYPE = Unity.ResultType.DEFAULT
23+DEFAULT_RESULT_ICON = SVG_DIR + 'result-gmusicbrowser.svg'
24+DEFAULT_RESULT_MIMETYPE = 'taglib/mp3'
25+DEFAULT_RESULT_TYPE = Unity.ResultType.PERSONAL
26 GMUSICBROWSER_DBFILE = os.getenv("HOME") + "/.config/gmusicbrowser/gmbrc"
27
28 c1 = {'id': 'songs',
29@@ -52,7 +52,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@@ -139,7 +151,6 @@
51 '''
52 results = []
53 albums, tracks = get_music_from_gmusicbrowser()
54- print(tracks)
55 trackresults = []
56 albumresults = []
57 for track in tracks:
58@@ -149,6 +160,8 @@
59 album = "" if track[3] is None else track[3]
60 mimetype = "" if track[4] is None else track[4]
61 albumartist = "" if track[5] is None else track[5]
62+ year = 0 if track[7] is None else int(track[7])
63+ genre = "" if track[6] is None else track[6]
64 trackname = title + " - " + album + " - " + artist
65 if search.lower() in trackname.lower():
66 albumart = get_album_art(track, albums)
67@@ -159,7 +172,11 @@
68 'category': 0,
69 'mimetype': mimetype,
70 'title': title,
71- 'comment': artist})
72+ 'comment': artist,
73+ 'album':GLib.Variant('s', album),
74+ 'artist':GLib.Variant('s', artist),
75+ 'genre':GLib.Variant('s', genre),
76+ 'year':GLib.Variant('i', year)})
77 trackresults.append(track)
78
79 if album not in albumresults:
80@@ -168,7 +185,11 @@
81 'category': 1,
82 'mimetype': mimetype,
83 'title': album,
84- 'comment': artist})
85+ 'comment': artist,
86+ 'album':GLib.Variant('s', album),
87+ 'artist':GLib.Variant('s', artist),
88+ 'genre':GLib.Variant('s', genre),
89+ 'year':GLib.Variant('i', year)})
90 albumresults.append(album)
91 return results
92

Subscribers

People subscribed via source and target branches

to all changes: