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
=== modified file 'scopes/gmusicbrowser/unity-scope-gmusicbrowser'
--- scopes/gmusicbrowser/unity-scope-gmusicbrowser 2012-03-23 05:14:53 +0000
+++ scopes/gmusicbrowser/unity-scope-gmusicbrowser 2012-03-31 01:44:19 +0000
@@ -59,18 +59,20 @@
59 fields = song.split("\t")59 fields = song.split("\t")
60 track = {}60 track = {}
61 track[0] = fields[30] #title61 track[0] = fields[30] #title
62 track[1] = fields[20] + "/" + fields[10] # Location62 track[1] = fields[20] + "/" + fields[10] # Location
63 track[2] = fields[4] # Artist63 track[2] = fields[4] # Artist
64 track[3] = fields[2] # Album Name64 track[3] = fields[2] # Album Name
65 track[4] = "audio/mp3" # mimetype65 track[4] = "audio/mp3" # mimetype
66 track[5] = fields[3] # Album Artist66 track[5] = fields[3] # Album Artist
67 track[6] = fields[12] # Genre67 track[6] = fields[12] # Genre
68 if len(fields) < 34:68 if len(fields) < 34:
69 track[7] = "0"69 track[7] = 0
70 else:70 else:
71 track[7] = str(fields[33])[0:4] # Year71 track[7] = str(fields[33])[0:4] # Year
72 if track[7] == "0Non":72 try:
73 track[7] = "0"73 track[7] = int(track[7])
74 except:
75 track[7] = 0
74 track[8] = 0 if fields[31] is None else fields[31]76 track[8] = 0 if fields[31] is None else fields[31]
75 tracks.append(track)77 tracks.append(track)
76 78
@@ -205,21 +207,21 @@
205 continue207 continue
206 else:208 else:
207 model.append (uri, # uri209 model.append (uri, # uri
208 albumart, # string formatted GIcon210 albumart, # string formatted GIcon
209 SONGS, # numeric group id211 SONGS, # numeric group id
210 mimetype, # mimetype212 mimetype, # mimetype
211 title, # display name213 title, # display name
212 artist + "\n" + album, # comment214 artist + "\n" + album, # comment
213 uri) # dnduri215 uri) # dnduri
214 216
215 if album not in albums:217 if album not in albums:
216 model.append (albumuri, # uri218 model.append (albumuri, # uri
217 albumart, # string formatted GIcon219 albumart, # string formatted GIcon
218 ALBUMS, # numeric group id220 ALBUMS, # numeric group id
219 mimetype, # mimetype221 mimetype, # mimetype
220 album, # display name222 album, # display name
221 artist + "\n" + album, # comment223 artist + "\n" + album, # comment
222 uri) # dnduri224 uri) # dnduri
223 if album != None:225 if album != None:
224 albums.append(album)226 albums.append(album)
225 227
@@ -227,12 +229,8 @@
227 self.i = self.i + 1229 self.i = self.i + 1
228230
229 def activate_uri(self, scope, uri):231 def activate_uri(self, scope, uri):
230 print uri
231 import subprocess232 import subprocess
232 albumtracks = []233 command = ["gmusicbrowser", "-playlist"]
233 albumtracks.append("gmusicbrowser")
234 albumtracks.append("-play")
235 albumtracks.append("-playlist")
236 # If uri starts with album:// then we need to play all the songs on it234 # If uri starts with album:// then we need to play all the songs on it
237 if uri.startswith("album://"):235 if uri.startswith("album://"):
238 trackdetails = []236 trackdetails = []
@@ -246,12 +244,11 @@
246 trackdetails.append(trackdetail)244 trackdetails.append(trackdetail)
247 trackdetails.sort(key=lambda track: int(track[1]))245 trackdetails.sort(key=lambda track: int(track[1]))
248 for track in trackdetails:246 for track in trackdetails:
249 albumtracks.append(track[0])247 command.append(track[0])
250 print albumtracks248 subprocess.Popen(command)
251 subprocess.Popen(albumtracks)
252 else:249 else:
253 albumtracks.append("file://" + uri)250 command.append(uri)
254 subprocess.Popen(albumtracks)251 subprocess.Popen(command)
255 return Unity.ActivationResponse (handled = Unity.HandledType.HIDE_DASH, goto_uri = '')252 return Unity.ActivationResponse (handled = Unity.HandledType.HIDE_DASH, goto_uri = '')
256253
257if __name__ == "__main__":254if __name__ == "__main__":

Subscribers

People subscribed via source and target branches