1
0
mirror of https://github.com/spl0k/supysonic.git synced 2024-12-22 17:06:17 +00:00

Fix covers not being scanned as such when modified

This commit is contained in:
Alban Féron 2022-01-30 16:30:05 +01:00
parent f387cce9ca
commit 4bee23ce23
No known key found for this signature in database
GPG Key ID: 8CE0313646D16165
2 changed files with 7 additions and 5 deletions

View File

@ -1,7 +1,7 @@
# This file is part of Supysonic. # This file is part of Supysonic.
# Supysonic is a Python implementation of the Subsonic server API. # Supysonic is a Python implementation of the Subsonic server API.
# #
# Copyright (C) 2013-2020 Alban 'spl0k' Féron # Copyright (C) 2013-2022 Alban 'spl0k' Féron
# #
# Distributed under terms of the GNU AGPLv3 license. # Distributed under terms of the GNU AGPLv3 license.
@ -345,7 +345,7 @@ class Scanner(Thread):
cover_name = os.path.basename(path) cover_name = os.path.basename(path)
if not folder.cover_art: if not folder.cover_art:
folder.cover_art = cover_name folder.cover_art = cover_name
else: elif folder.cover_art != cover_name:
album_name = None album_name = None
track = folder.tracks.select().first() track = folder.tracks.select().first()
if track is not None: if track is not None:

View File

@ -1,7 +1,7 @@
# This file is part of Supysonic. # This file is part of Supysonic.
# Supysonic is a Python implementation of the Subsonic server API. # Supysonic is a Python implementation of the Subsonic server API.
# #
# Copyright (C) 2014-2019 Alban 'spl0k' Féron # Copyright (C) 2014-2022 Alban 'spl0k' Féron
# #
# Distributed under terms of the GNU AGPLv3 license. # Distributed under terms of the GNU AGPLv3 license.
@ -68,8 +68,10 @@ class SupysonicWatcherEventHandler(PatternMatchingEventHandler):
def on_modified(self, event): def on_modified(self, event):
logger.debug("File modified: '%s'", event.src_path) logger.debug("File modified: '%s'", event.src_path)
if not covers.is_valid_cover(event.src_path): op = OP_SCAN
self.queue.put(event.src_path, OP_SCAN) if covers.is_valid_cover(event.src_path):
op |= FLAG_COVER
self.queue.put(event.src_path, op)
def on_moved(self, event): def on_moved(self, event):
logger.debug("File moved: '%s' -> '%s'", event.src_path, event.dest_path) logger.debug("File moved: '%s' -> '%s'", event.src_path, event.dest_path)