Skip to content

Commit 5cc0833

Browse files
committed
fixes
1 parent a6ece6a commit 5cc0833

File tree

4 files changed

+7
-4
lines changed

4 files changed

+7
-4
lines changed

nowplaying/db.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,9 @@ def filterkeys(mydict: dict[str, Any]) -> dict[str, Any]:
180180
return {key: mydict[key] for key in METADATALIST + METADATABLOBLIST if key in mydict}
181181

182182
logging.debug('Called (async) write_to_metadb')
183+
if metadata is None:
184+
logging.debug('metadata is None')
185+
return
183186
if (not metadata or not METADATALIST or 'title' not in metadata
184187
or 'artist' not in metadata):
185188
logging.debug('metadata is either empty or too incomplete')

nowplaying/imagecache.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -613,7 +613,8 @@ def _get_next_queue_batch(self, recently_processed: dict[str, float]) -> list[di
613613

614614
return batch
615615

616-
def _cleanup_queue_tracking(self, recently_processed: dict[str, float]) -> None:
616+
@staticmethod
617+
def _cleanup_queue_tracking(recently_processed: dict[str, float]) -> None:
617618
"""Remove entries older than 3 minutes from queue processing tracking."""
618619
current_time = time.time()
619620
expired_keys = [

nowplaying/inputs/m3u.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
# https://datatracker.ietf.org/doc/html/rfc8216
2626

2727

28-
class Plugin(InputPlugin):
28+
class Plugin(InputPlugin): # pylint: disable=too-many-instance-attributes
2929
''' handler for NowPlaying '''
3030

3131
def __init__(self, config=None, m3udir=None, qsettings=None):
@@ -38,7 +38,6 @@ def __init__(self, config=None, m3udir=None, qsettings=None):
3838

3939
self.mixmode = "newest"
4040
self.event_handler = None
41-
# Instance variable instead of class variable to prevent test interference
4241
self.metadata: dict[str, str | None] = {'artist': None, 'title': None, 'filename': None}
4342
self.observer = None
4443
self._reset_meta()

nowplaying/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ def safe_stopevent_check(stopevent: asyncio.Event|None) -> bool:
6161
"""
6262
try:
6363
return stopevent.is_set()
64-
except (BrokenPipeError, EOFError):
64+
except (BrokenPipeError, EOFError, AttributeError):
6565
# Expected shutdown errors - pipe closed before subprocess finished
6666
logging.debug("Shutdown pipe error detected, treating as stop signal")
6767
return True

0 commit comments

Comments
 (0)