Hello community, here is the log from the commit of package mpDris2 for openSUSE:Factory checked in at 2019-04-15 11:53:38 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/mpDris2 (Old) and /work/SRC/openSUSE:Factory/.mpDris2.new.17052 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "mpDris2" Mon Apr 15 11:53:38 2019 rev:5 rq:694161 version:0.8 Changes: -------- --- /work/SRC/openSUSE:Factory/mpDris2/mpDris2.changes 2018-12-31 09:48:03.222134624 +0100 +++ /work/SRC/openSUSE:Factory/.mpDris2.new.17052/mpDris2.changes 2019-04-15 11:53:43.338607320 +0200 @@ -1,0 +2,15 @@ +Sun Apr 14 09:57:03 UTC 2019 - Sébastien 'sogal' Poher <so...@opensuse.org> + +- Updated to release 0.8: + * Added cli options for mpd host and port, music dir + * Better detection of embedded covers + * Compatibility with python-mpd2 1.0.0 + * Fixed volume reporting with newer mpd versions + * Fix notification system initialization + * Notify urgengy can be configured + * "Playing" and "Paused" notifications now show song information (gh-#71). + * Path to config file can be changed via command line + * Add a hidden option to change the D-Bus service name, for advanced + multi-instance configurations. + +------------------------------------------------------------------- Old: ---- mpDris2-0.7.tar.gz New: ---- mpDris2-0.8.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ mpDris2.spec ++++++ --- /var/tmp/diff_new_pack.dTyQxP/_old 2019-04-15 11:53:43.818607663 +0200 +++ /var/tmp/diff_new_pack.dTyQxP/_new 2019-04-15 11:53:43.818607663 +0200 @@ -1,7 +1,7 @@ # # spec file for package mpDris2 # -# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -17,7 +17,7 @@ Name: mpDris2 -Version: 0.7 +Version: 0.8 Release: 0 Summary: MPRIS V2.1 support for mpd License: GPL-3.0-only ++++++ mpDris2-0.7.tar.gz -> mpDris2-0.8.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mpDris2-0.7/NEWS new/mpDris2-0.8/NEWS --- old/mpDris2-0.7/NEWS 2018-11-07 22:15:32.000000000 +0100 +++ new/mpDris2-0.8/NEWS 2019-02-22 16:33:53.000000000 +0100 @@ -1,4 +1,16 @@ -mpDris2 v0.8 (unreleased) +mpDris2 v0.8 (February 22, 2019) + + - Added cli options for mpd host and port, music dir + + - Better detection of embedded covers + + - Compatibility with python-mpd2 1.0.0 + + - Fixed volume reporting with newer mpd versions + + - Fix notification system initialization + + - Notify urgengy can be configured - "Playing" and "Paused" notifications now show song information (#71). diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mpDris2-0.7/configure.ac new/mpDris2-0.8/configure.ac --- old/mpDris2-0.7/configure.ac 2018-11-07 22:15:32.000000000 +0100 +++ new/mpDris2-0.8/configure.ac 2019-02-22 16:33:53.000000000 +0100 @@ -1,5 +1,5 @@ AC_INIT([mpDris2], - [0.7], + [0.8], [https://github.com/eonpatapon/mpDris2/issues], [mpdris2], [https://github.com/eonpatapon/mpDris2]) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mpDris2-0.7/src/mpDris2.conf new/mpDris2-0.8/src/mpDris2.conf --- old/mpDris2-0.7/src/mpDris2.conf 2018-11-07 22:15:32.000000000 +0100 +++ new/mpDris2-0.8/src/mpDris2.conf 2019-02-22 16:33:53.000000000 +0100 @@ -14,3 +14,5 @@ [Bling] #mmkeys = True #notify = True +# Urgency of the notification: 0 for low, 1 for medium and 2 for high. +#notify_urgency = 0 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mpDris2-0.7/src/mpDris2.in.py new/mpDris2-0.8/src/mpDris2.in.py --- old/mpDris2-0.7/src/mpDris2.in.py 2018-11-07 22:15:32.000000000 +0100 +++ new/mpDris2-0.8/src/mpDris2.in.py 2019-02-22 16:33:53.000000000 +0100 @@ -95,6 +95,7 @@ # Bling 'mmkeys': True, 'notify': (using_gi_notify or using_old_notify), + 'notify_urgency': 0, } defaults = { @@ -899,39 +900,45 @@ self.reconnect() return False + class NotifyWrapper(object): + def __init__(self, params): self._notification = None - if params["notify"]: - if using_gi_notify: - logger.debug("Initializing GObject.Notify") - if Notify.init(identity): - self._notification = Notify.Notification() - self._notification.set_hint("desktop-entry", GLib.Variant("s", "mpdris2")) - self._notification.set_hint("transient", GLib.Variant("b", True)) - try: - self._notification.update("mpdris2 %s started" % __version__) - self._notification.show() - except GLib.GError as err: - logger.error("Failed to init libnotify: %s", err) - self._notification = None - else: - logger.error("Failed to init libnotify; disabling notifications") - self._notification = None - elif using_old_notify: - logger.debug("Initializing old pynotify") - if pynotify.init(identity): - self._notification = pynotify.Notification("", "", "") - self._notification.set_hint("desktop-entry", "mpdris2") - self._notification.set_hint("transient", True) - else: - logger.error("Failed to init libnotify; disabling notifications") - self._notification = None + if not params["notify"]: + return + + bus = dbus.SessionBus() + try: + bus.get_name_owner("org.freedesktop.Notifications") + except dbus.exceptions.DBusException: + logger.error("No service handling org.freedesktop.Notifications; disabling notifications") + return + + if using_gi_notify: + logger.debug("Initializing GObject.Notify") + if Notify.init(identity): + self._notification = Notify.Notification() + self._notification.set_hint("desktop-entry", GLib.Variant("s", "mpdris2")) + self._notification.set_hint("transient", GLib.Variant("b", True)) + else: + logger.error("Failed to init libnotify; disabling notifications") + self._notification = None + elif using_old_notify: + logger.debug("Initializing old pynotify") + if pynotify.init(identity): + self._notification = pynotify.Notification("", "", "") + self._notification.set_hint("desktop-entry", "mpdris2") + self._notification.set_hint("transient", True) + else: + logger.error("Failed to init libnotify; disabling notifications") + self._notification = None def notify(self, title, body, uri=''): if self._notification: try: + self._notification.set_urgency(params['notify_urgency']) self._notification.update(title, body, uri) self._notification.show() except GLib.GError as err: @@ -1380,6 +1387,9 @@ if config.has_option('Bling', p): params[p] = config.getboolean('Bling', p) + if config.has_option('Bling', 'notify_urgency'): + params['notify_urgency'] = int(config.get('Bling', 'notify_urgency')) + if not music_dir: if config.has_option('Library', 'music_dir'): music_dir = config.get('Library', 'music_dir') diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mpDris2-0.7/src/mpDris2.service.in new/mpDris2-0.8/src/mpDris2.service.in --- old/mpDris2-0.7/src/mpDris2.service.in 2018-11-07 22:15:32.000000000 +0100 +++ new/mpDris2-0.8/src/mpDris2.service.in 2019-02-22 16:33:53.000000000 +0100 @@ -2,6 +2,7 @@ Description=mpDris2 - Music Player Daemon D-Bus bridge [Service] +Restart=on-failure ExecStart=@bindir@/mpDris2 BusName=org.mpris.MediaPlayer2.mpd