Skip to content
Permalink
Browse files

monitor: Reset status when filepath is None

  • Loading branch information
iamkroot committed Nov 29, 2019
1 parent 65652d6 commit 92b7d120d5222351a600e753208699abfb3f2486
Showing with 5 additions and 1 deletion.
  1. +3 −0 trakt_scrobbler/player_monitors/monitor.py
  2. +2 −1 trakt_scrobbler/utils.py
@@ -90,5 +90,8 @@ def run(self):
logger.info(f'Unable to connect to {self.name}. Ensure that '
'the web interface is running.')
self.status = {}
else:
if not self.status.get("filepath"):
self.status = {}
self.handle_status_update()
time.sleep(self.poll_interval)
@@ -50,7 +50,8 @@ def safe_request(verb, params):

def file_uri_to_path(file_uri):
if not file_uri.startswith('file://'):
return None
logger.warning(f"Invalid file uri '{file_uri}'")
return None
path = urlparse(unquote(file_uri)).path
if sys.platform == 'win32' and path.startswith('/'):
path = path[1:]

0 comments on commit 92b7d12

Please sign in to comment.
You can’t perform that action at this time.