[rhythmbox] magnatune: only spawn one uri, regardless of selection
- From: Jonathan Matthew <jmatthew src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [rhythmbox] magnatune: only spawn one uri, regardless of selection
- Date: Sun, 21 Aug 2016 22:12:06 +0000 (UTC)
commit e823101abaf981747d10fb0eab2be58efd8e901d
Author: Jonathan Matthew <jonathan d14n org>
Date: Mon Aug 22 08:11:05 2016 +1000
magnatune: only spawn one uri, regardless of selection
https://bugzilla.gnome.org/show_bug.cgi?id=770212
plugins/magnatune/MagnatuneSource.py | 30 +++++++++++++++---------------
1 files changed, 15 insertions(+), 15 deletions(-)
---
diff --git a/plugins/magnatune/MagnatuneSource.py b/plugins/magnatune/MagnatuneSource.py
index 6df6c6c..bf04fb6 100644
--- a/plugins/magnatune/MagnatuneSource.py
+++ b/plugins/magnatune/MagnatuneSource.py
@@ -157,26 +157,26 @@ class MagnatuneSource(RB.BrowserSource):
def display_artist_info(self):
screen = self.props.shell.props.window.get_screen()
tracks = self.get_entry_view().get_selected_entries()
- urls = set([])
+ if len(tracks) == 0:
+ return
+
+ tr = tracks[0]
+ sku = self.__sku_dict[tr.get_string(RB.RhythmDBPropType.LOCATION)]
+ url = self.__home_dict[sku]
+ Gtk.show_uri(screen, url, Gdk.CURRENT_TIME)
- for tr in tracks:
- sku = self.__sku_dict[tr.get_string(RB.RhythmDBPropType.LOCATION)]
- url = self.__home_dict[sku]
- if url not in urls:
- Gtk.show_uri(screen, url, Gdk.CURRENT_TIME)
- urls.add(url)
def download_redirect(self):
screen = self.props.shell.props.window.get_screen()
tracks = self.get_entry_view().get_selected_entries()
- urls = set([])
-
- for tr in tracks:
- sku = self.__sku_dict[tr.get_string(RB.RhythmDBPropType.LOCATION)]
- url = magnatune_buy_album_uri + urllib.parse.urlencode({ 'sku': sku, 'ref':
magnatune_partner_id })
- if url not in urls:
- Gtk.show_uri(screen, url, Gdk.CURRENT_TIME)
- urls.add(url)
+ if len(tracks) == 0:
+ return
+
+ tr = tracks[0]
+ sku = self.__sku_dict[tr.get_string(RB.RhythmDBPropType.LOCATION)]
+ url = magnatune_buy_album_uri + urllib.parse.urlencode({ 'sku': sku, 'ref':
magnatune_partner_id })
+ Gtk.show_uri(screen, url, Gdk.CURRENT_TIME)
+
def download_album(self):
if self.__settings['account-type'] != 'download':
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]