From a2488b315cf11e4b2007659c024a67b87c76a975 Mon Sep 17 00:00:00 2001 From: MoojMidge <56883549+MoojMidge@users.noreply.github.com> Date: Mon, 8 Aug 2022 01:05:32 +1000 Subject: [PATCH] Check for physical disc or disc image being played --- resources/lib/monitor.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/resources/lib/monitor.py b/resources/lib/monitor.py index ce164f68..e4daba2b 100644 --- a/resources/lib/monitor.py +++ b/resources/lib/monitor.py @@ -24,7 +24,7 @@ def log(self, msg, level=1): """Log wrapper""" ulog(msg, name=self.__class__.__name__, level=level) - def run(self): + def run(self): # pylint: disable=too-many-branches """Main service loop""" self.log('Service started', 0) @@ -64,6 +64,15 @@ def run(self): self.playback_manager.demo.hide() continue + if (current_file.startswith(( + 'bluray://', 'dvd://', 'udf://', 'iso9660://', 'cdda://')) + or current_file.endswith(( + '.bdmv', '.iso', '.ifo'))): + self.log('Up Next tracking stopped, Blu-ray/DVD/CD playing', 2) + self.player.disable_tracking() + self.playback_manager.demo.hide() + continue + if last_file and last_file == from_unicode(current_file): # Already processed this playback before continue