Skip to content

Commit

Permalink
compat with older dependency versions
Browse files Browse the repository at this point in the history
just want to drop dependency on OCP in this PR
  • Loading branch information
JarbasAl committed May 11, 2024
1 parent 92131d3 commit de7dc41
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion ovos_plugin_vlc/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
from typing import List

import vlc
from ovos_bus_client.message import Message
from ovos_plugin_manager.templates.audio import AudioBackend
from ovos_utils.log import LOG

Expand Down Expand Up @@ -46,7 +47,12 @@ def update_playback_time(self, data, other):
# the gui seems to lag a lot when sending messages too often,
# gui expected to keep an internal fake progress bar and sync periodically
self._last_sync = time.time()
self.ocp_sync_playback(self._playback_time)
try:
self.ocp_sync_playback(self._playback_time)
except: # too old OPM version
self.bus.emit(Message("ovos.common_play.playback_time",
{"position": self._playback_time,
"length": self.get_track_length()}))

def track_start(self, data, other):
LOG.debug('VLC playback start')
Expand Down

0 comments on commit de7dc41

Please sign in to comment.