Merge lp:~dobey/rhythmbox-ubuntuone/update-from-trunk into lp:rhythmbox-ubuntuone/stable-3-0

Proposed by dobey on 2012-03-06
Status: Merged
Approved by: dobey on 2012-03-07
Approved revision: no longer in the source branch.
Merged at revision: 112
Proposed branch: lp:~dobey/rhythmbox-ubuntuone/update-from-trunk
Merge into: lp:rhythmbox-ubuntuone/stable-3-0
Diff against target: 151 lines (+35/-19)
6 files modified
MANIFEST.in (+1/-0)
po/POTFILES.in (+1/-0)
rhythmbox-ubuntuone.desktop.in (+12/-0)
setup.cfg (+1/-1)
ubuntuone/MusicStoreWidget.py (+18/-18)
ubuntuone/ubuntuone.plugin.in (+2/-0)
To merge this branch: bzr merge lp:~dobey/rhythmbox-ubuntuone/update-from-trunk
Reviewer Review Type Date Requested Status
Manuel de la Peña (community) 2012-03-06 Approve on 2012-03-07
Review via email: mp+96250@code.launchpad.net

Commit Message

Fix the handling of preview playback in the store
Fix the handling of purchased music playback from the My Downloads page
Add a .desktop file for registering rhythmbox as the u1ms:// url handler when rhythmbox-ubuntuone is installed
Fix the url handling API inside the plug-in to align with new Rhythmbox API

To post a comment you must log in.
Manuel de la Peña (mandel) wrote :

Looks god!

review: Approve
112. By dobey on 2012-03-07

Fix the handling of preview playback in the store
Fix the handling of purchased music playback from the My Downloads page
Add a .desktop file for registering rhythmbox as the u1ms:// url handler when rhythmbox-ubuntuone is installed
Fix the url handling API inside the plug-in to align with new Rhythmbox API

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'MANIFEST.in'
2--- MANIFEST.in 2012-02-02 19:27:36 +0000
3+++ MANIFEST.in 2012-03-07 16:22:17 +0000
4@@ -1,4 +1,5 @@
5 include COPYING COPYING.LIB MANIFEST.in README
6 include run-tests
7+include rhythmbox-ubuntuone.desktop.in
8 recursive-include po *.po POTFILES.in
9 recursive-include ubuntuone *.py *.in
10
11=== modified file 'po/POTFILES.in'
12--- po/POTFILES.in 2012-01-14 01:59:34 +0000
13+++ po/POTFILES.in 2012-03-07 16:22:17 +0000
14@@ -1,3 +1,4 @@
15+rhythmbox-ubuntuone.desktop.in
16 ubuntuone/ubuntuone.py
17 ubuntuone/MusicStoreWidget.py
18 [type: gettext/ini]ubuntuone/ubuntuone.plugin.in
19
20=== added file 'rhythmbox-ubuntuone.desktop.in'
21--- rhythmbox-ubuntuone.desktop.in 1970-01-01 00:00:00 +0000
22+++ rhythmbox-ubuntuone.desktop.in 2012-03-07 16:22:17 +0000
23@@ -0,0 +1,12 @@
24+[Desktop Entry]
25+Name=Ubuntu One Music Store
26+_Comment=Purchase music on Ubuntu One in Rhythmbox
27+Exec=rhythmbox %U
28+Terminal=false
29+Type=Application
30+Icon=rhythmbox
31+Categories=GNOME;GTK;AudioVideo;
32+MimeType=x-scheme-handler/u1ms
33+StartupNotify=true
34+X-Ubuntu-Gettext-Domain=rhythmbox-ubuntuone
35+NoDisplay=true
36
37=== modified file 'setup.cfg'
38--- setup.cfg 2012-01-14 01:59:34 +0000
39+++ setup.cfg 2012-03-07 16:22:17 +0000
40@@ -1,2 +1,2 @@
41 [build_i18n]
42-desktop_files=[("lib/rhythmbox/plugins/ubuntuone", ("ubuntuone/ubuntuone.plugin.in",))]
43+desktop_files=[("lib/rhythmbox/plugins/ubuntuone", ("ubuntuone/ubuntuone.plugin.in",)), ("share/applications", ("rhythmbox-ubuntuone.desktop.in",))]
44
45=== modified file 'ubuntuone/MusicStoreWidget.py'
46--- ubuntuone/MusicStoreWidget.py 2012-01-31 15:04:32 +0000
47+++ ubuntuone/MusicStoreWidget.py 2012-03-07 16:22:17 +0000
48@@ -83,6 +83,9 @@
49 self.source.connect("download-finished", self.download_finished)
50 self.source.connect("url-loaded", self.url_loaded)
51
52+ self.source.props.query_model = RB.RhythmDBQueryModel.new_empty(
53+ self.db)
54+
55 # Do these every time
56 self.add_u1_library()
57
58@@ -99,7 +102,6 @@
59
60 def url_loaded(self, source, url):
61 """A URL is loaded in the plugin"""
62- print "URL loaded:", url
63 if urlparse.urlparse(url)[2] == "https":
64 pass
65 else:
66@@ -127,42 +129,37 @@
67 """A file is finished downloading"""
68 library_uri = self._udf_path_to_library_uri(path)
69 # Import the URI
70- if not self.shell.props.db.entry_lookup_by_location(library_uri):
71+ if not self.db.entry_lookup_by_location(library_uri):
72 self.db.add_uri(library_uri)
73
74 def play_library(self, source, path):
75 """Switch to and start playing a song from the library"""
76 uri = self._udf_path_to_library_uri(path)
77- entry = self.shell.props.db.entry_lookup_by_location(uri)
78+ entry = self.db.entry_lookup_by_location(uri)
79 if not entry:
80 print "couldn't find entry", uri
81 return
82 libsrc = self.shell.props.library_source
83 artist_view, album_view = libsrc.get_property_views()[0:2]
84 song_view = libsrc.get_entry_view()
85- artist = self.shell.props.db.entry_get(entry,
86- RB.RhythmDBPropType.ARTIST)
87- album = self.shell.props.db.entry_get(entry,
88- RB.RhythmDBPropType.ALBUM)
89+ artist = entry.get_string(RB.RhythmDBPropType.ARTIST)
90+ album = entry.get_string(RB.RhythmDBPropType.ALBUM)
91 self.shell.props.display_page_tree.select(libsrc)
92 artist_view.set_selection([artist])
93 album_view.set_selection([album])
94 song_view.scroll_to_entry(entry)
95- player = self.shell.get_player()
96+ player = self.shell.get_property('shell-player')
97 player.stop()
98 player.play_entry(entry, libsrc)
99
100 def play_preview_mp3(self, source, url, title):
101 """Play a passed mp3; signal handler for preview-mp3 signal."""
102 # create an entry, don't save it, and play it
103- entry = self.shell.props.db.entry_lookup_by_location(url)
104- if entry is None:
105- entry = self.shell.props.db.entry_new(self.entry_type, url)
106- self.shell.props.db.set(entry, RB.RhythmDBPropType.TITLE, title)
107- player = self.shell.get_player()
108+ entry = RB.RhythmDBEntry.new(self.db, self.entry_type, url)
109+ self.db.entry_set(entry, RB.RhythmDBPropType.TITLE, title)
110+ player = self.shell.get_property('shell-player')
111 player.stop()
112 player.play_entry(entry, self.source)
113- # delete this entry when it finishes playing. Don't know how yet.
114
115 def add_u1_library(self):
116 """Add the U1 library if not listed in RB and re-add if changed."""
117@@ -233,17 +230,20 @@
118 return 100
119 return 0
120
121- def do_impl_add_uri(self, uri, title, genre):
122+ def do_impl_add_uri(self, uri, title, genre, callback=None,
123+ callback_data=None, destroy_data=None):
124 """Handle a u1ms URL"""
125 if not uri.startswith("u1ms://"):
126- return False
127+ return
128 uri_to_use = uri.replace("u1ms://", "http://")
129- print "Calling u1musicstore plugin with %s" % uri_to_use
130 # pylint: disable=E1101
131 shell = self.get_property("shell")
132 shell.props.display_page_tree.select(self)
133 self.browser.load_store_link(uri_to_use)
134- return True
135+ if callback is not None:
136+ callback(callback_data)
137+ if destroy_data is not None:
138+ destroy_data(callback_data)
139
140 def add_music_store_widget(self):
141 """Display the music store widget in Rhythmbox."""
142
143=== modified file 'ubuntuone/ubuntuone.plugin.in'
144--- ubuntuone/ubuntuone.plugin.in 2012-01-14 01:59:34 +0000
145+++ ubuntuone/ubuntuone.plugin.in 2012-03-07 16:22:17 +0000
146@@ -9,3 +9,5 @@
147 Copyright=Copyright © 2009-2012 Canonical
148 Website=http://one.ubuntu.com/
149
150+[RB]
151+InitiallyEnabled=true

Subscribers

People subscribed via source and target branches

to all changes: