Merge lp:~markjtully/ubuntu-app-review-board/unity-scopes-music-extras-oneiric into lp:~app-review-board/ubuntu-app-review-board/unity-scopes-music-extras-oneiric

Proposed by Allison Randal
Status: Merged
Merged at revision: 16
Proposed branch: lp:~markjtully/ubuntu-app-review-board/unity-scopes-music-extras-oneiric
Merge into: lp:~app-review-board/ubuntu-app-review-board/unity-scopes-music-extras-oneiric
Diff against target: 93 lines (+23/-26)
1 file modified
scopes/gmusicbrowser/unity-scope-gmusicbrowser (+23/-26)
To merge this branch: bzr merge lp:~markjtully/ubuntu-app-review-board/unity-scopes-music-extras-oneiric
Reviewer Review Type Date Requested Status
Allison Randal (community) Approve
Review via email: mp+100265@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Allison Randal (allison) :
review: Approve
16. By Allison Randal

Merging fixes for gmusicbrowser from markjtully

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'scopes/gmusicbrowser/unity-scope-gmusicbrowser'
2--- scopes/gmusicbrowser/unity-scope-gmusicbrowser 2012-03-23 05:14:53 +0000
3+++ scopes/gmusicbrowser/unity-scope-gmusicbrowser 2012-03-31 01:44:19 +0000
4@@ -59,18 +59,20 @@
5 fields = song.split("\t")
6 track = {}
7 track[0] = fields[30] #title
8- track[1] = fields[20] + "/" + fields[10] # Location
9+ track[1] = fields[20] + "/" + fields[10] # Location
10 track[2] = fields[4] # Artist
11 track[3] = fields[2] # Album Name
12 track[4] = "audio/mp3" # mimetype
13 track[5] = fields[3] # Album Artist
14 track[6] = fields[12] # Genre
15 if len(fields) < 34:
16- track[7] = "0"
17+ track[7] = 0
18 else:
19- track[7] = str(fields[33])[0:4] # Year
20- if track[7] == "0Non":
21- track[7] = "0"
22+ track[7] = str(fields[33])[0:4] # Year
23+ try:
24+ track[7] = int(track[7])
25+ except:
26+ track[7] = 0
27 track[8] = 0 if fields[31] is None else fields[31]
28 tracks.append(track)
29
30@@ -205,21 +207,21 @@
31 continue
32 else:
33 model.append (uri, # uri
34- albumart, # string formatted GIcon
35- SONGS, # numeric group id
36- mimetype, # mimetype
37- title, # display name
38- artist + "\n" + album, # comment
39- uri) # dnduri
40+ albumart, # string formatted GIcon
41+ SONGS, # numeric group id
42+ mimetype, # mimetype
43+ title, # display name
44+ artist + "\n" + album, # comment
45+ uri) # dnduri
46
47 if album not in albums:
48 model.append (albumuri, # uri
49- albumart, # string formatted GIcon
50- ALBUMS, # numeric group id
51- mimetype, # mimetype
52- album, # display name
53+ albumart, # string formatted GIcon
54+ ALBUMS, # numeric group id
55+ mimetype, # mimetype
56+ album, # display name
57 artist + "\n" + album, # comment
58- uri) # dnduri
59+ uri) # dnduri
60 if album != None:
61 albums.append(album)
62
63@@ -227,12 +229,8 @@
64 self.i = self.i + 1
65
66 def activate_uri(self, scope, uri):
67- print uri
68 import subprocess
69- albumtracks = []
70- albumtracks.append("gmusicbrowser")
71- albumtracks.append("-play")
72- albumtracks.append("-playlist")
73+ command = ["gmusicbrowser", "-playlist"]
74 # If uri starts with album:// then we need to play all the songs on it
75 if uri.startswith("album://"):
76 trackdetails = []
77@@ -246,12 +244,11 @@
78 trackdetails.append(trackdetail)
79 trackdetails.sort(key=lambda track: int(track[1]))
80 for track in trackdetails:
81- albumtracks.append(track[0])
82- print albumtracks
83- subprocess.Popen(albumtracks)
84+ command.append(track[0])
85+ subprocess.Popen(command)
86 else:
87- albumtracks.append("file://" + uri)
88- subprocess.Popen(albumtracks)
89+ command.append(uri)
90+ subprocess.Popen(command)
91 return Unity.ActivationResponse (handled = Unity.HandledType.HIDE_DASH, goto_uri = '')
92
93 if __name__ == "__main__":

Subscribers

People subscribed via source and target branches