[totem/wip/hadess/mpris-can-go-next: 4/5] dbusservice: Implement CanGoNext/CanGoPrevious



commit eeac136ffa5468cd187ae04f5153e30889e303ab
Author: Bastien Nocera <hadess hadess net>
Date:   Thu Feb 14 03:40:18 2019 +0100

    dbusservice: Implement CanGoNext/CanGoPrevious
    
    So that the sensitivity of the track change buttons match reality.

 src/plugins/dbusservice/dbusservice.py | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/src/plugins/dbusservice/dbusservice.py b/src/plugins/dbusservice/dbusservice.py
index 49b331c80..1233c84bd 100644
--- a/src/plugins/dbusservice/dbusservice.py
+++ b/src/plugins/dbusservice/dbusservice.py
@@ -141,6 +141,8 @@ class Root (dbus.service.Object): # pylint: disable=R0904
             'CanPause': (self.totem.props.current_mrl is not None),
             'CanSeek': (self.totem.props.current_mrl is not None and
                         self.totem.props.seekable),
+            'CanGoNext': self.totem.can_seek_next (),
+            'CanGoPrevious': self.totem.can_seek_previous (),
         }, [])
 
     def __do_notify_seekable (self, _, prop): # pylint: disable=W0613
@@ -194,8 +196,8 @@ class Root (dbus.service.Object): # pylint: disable=R0904
                 'Metadata': self.__calculate_metadata (),
                 'Volume': self.totem.get_volume (), # TODO: Notifications
                 'Position': dbus.Int64(self.totem.props.current_time * 1000),
-                'CanGoNext': True, # TODO
-                'CanGoPrevious': True, # TODO
+                'CanGoNext': self.totem.can_seek_next (),
+                'CanGoPrevious': self.totem.can_seek_previous (),
                 'CanPlay': (self.totem.props.current_mrl is not None),
                 'CanPause': (self.totem.props.current_mrl is not None),
                 'CanSeek': (self.totem.props.current_mrl is not None and


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]