Skip to content

Commit

Permalink
Merge branch 'release/3.3.1'
Browse files Browse the repository at this point in the history
* release/3.3.1:
  fix(version): upgrade to v3.3.1
  fix(dbus): don't use utf-8 encoding for internal strings

Closes #84
  • Loading branch information
gmdfalk committed Jan 3, 2016
2 parents c698fd2 + 3e2a0ec commit 40a04c7
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 15 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@ If you can't find or fix the issue you are having by yourself, you are welcome t


## Changelog
- v3.3.1 (2016-01-03): Fix interlude player crashes ([issue #84](https://github.com/mikar/blockify/issues/84)).
- v3.3.0 (2016-01-03): Enable profiling, improve GUI performance, fix playback button & title status functionality and add tray icon toolip.
- v3.2.1 (2016-01-03): Remove unnecessary imports and other cleanups.
- v3.2.0 (2015-12-31): Reintroduce playback status (see [issue #68](https://github.com/mikar/blockify/issues/68))
Expand Down
4 changes: 2 additions & 2 deletions blockify/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -303,8 +303,8 @@ def current_song_is_ad(self):
return self.current_song_title and not self.current_song_artist

def update_current_song_info(self):
self.current_song_artist = self.dbus.get_song_artist().decode("utf-8")
self.current_song_title = self.dbus.get_song_title().decode("utf-8")
self.current_song_artist = self.dbus.get_song_artist()
self.current_song_title = self.dbus.get_song_title()
self.current_song = self.current_song_artist + self.song_delimiter + self.current_song_title

def block_current(self):
Expand Down
12 changes: 5 additions & 7 deletions blockify/dbusclient.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,14 +124,12 @@ def set_position(self, track, position):
except Exception as e:
log.warn("Cannot Set Position: {}".format(e))


def open_uri(self, uri):
try:
self.player.OpenUri(uri)
except Exception as e:
log.warn("Cannot Open URI: {}".format(e))


def seek(self, seconds):
"""Skips n seconds forward."""
try:
Expand All @@ -144,7 +142,7 @@ def get_art_url(self):
url = ""
try:
metadata = self.get_property("Metadata")
url = metadata["mpris:artUrl"].encode("utf-8")
url = metadata["mpris:artUrl"]
except Exception as e:
log.error("Cannot fetch album cover: {}".format(e))
return url
Expand Down Expand Up @@ -175,7 +173,7 @@ def get_song_title(self):
title = ""
try:
metadata = self.get_property("Metadata")
title = metadata["xesam:title"].encode("utf-8")
title = metadata["xesam:title"]
except Exception as e:
log.warn("Cannot get song title: {}".format(e))

Expand All @@ -186,7 +184,7 @@ def get_song_album(self):
album = ""
try:
metadata = self.get_property("Metadata")
album = metadata["xesam:album"].encode("utf-8")
album = metadata["xesam:album"]
except Exception as e:
log.warn("Cannot get song album: {}".format(e))

Expand All @@ -197,7 +195,7 @@ def get_song_artist(self):
artist = ""
try:
metadata = self.get_property("Metadata")
artist = metadata["xesam:artist"][0].encode("utf-8")
artist = metadata["xesam:artist"][0]
except Exception as e:
log.warn("Cannot get song artist: {}".format(e))

Expand Down Expand Up @@ -228,7 +226,7 @@ def print_info(self):

def main():
"""Entry point for the CLI DBus interface."""
args = docopt(__doc__, version="0.2")
args = docopt(__doc__, version="0.3")
util.init_logger(args["--log"], args["-v"], args["--quiet"])
dbus = DBusClient()

Expand Down
9 changes: 4 additions & 5 deletions blockify/gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -266,9 +266,8 @@ def create_traymenu(self, event_button, event_time):
exit_menuitem.show()
menu.append(exit_menuitem)
exit_menuitem.connect("activate", self.on_exit_btn)

menu.popup(None, None, Gtk.status_icon_position_menu,
event_button, event_time, self.status_icon)
menu.popup(None, None, Gtk.StatusIcon.position_menu,
self.status_icon, event_button, event_time)

def create_labels(self):
self.albumlabel = Gtk.Label()
Expand Down Expand Up @@ -672,7 +671,7 @@ def fix_button_state(self, button, label):
def format_current_song_info(self):
artist = self.b.current_song_artist
title = self.b.current_song_title
album = self.b.dbus.get_song_album().decode("utf-8")
album = self.b.dbus.get_song_album()

if self.b.found:
artist = "Ad detected"
Expand All @@ -687,7 +686,7 @@ def format_current_song_info(self):

def get_cover_art(self):
cover_file = ""
cover_hash = os.path.basename(self.b.dbus.get_art_url().decode("utf-8"))
cover_hash = os.path.basename(self.b.dbus.get_art_url())

if cover_hash:
# The url spotify gets its cover images from. Filename is a hash, the last part of metadata["artUrl"]
Expand Down
2 changes: 1 addition & 1 deletion blockify/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
except ImportError:
log.error("ImportError: Please install docopt to use the CLI.")

VERSION = "3.3.0"
VERSION = "3.3.1"
CONFIG = None
CONFIG_DIR = os.path.expanduser("~/.config/blockify")
CONFIG_FILE = os.path.join(CONFIG_DIR, "blockify.ini")
Expand Down

0 comments on commit 40a04c7

Please sign in to comment.