mirror of
https://github.com/spl0k/supysonic.git
synced 2024-12-22 08:56:17 +00:00
Fix covers not being scanned as such when modified
This commit is contained in:
parent
f387cce9ca
commit
4bee23ce23
@ -1,7 +1,7 @@
|
||||
# This file is part of Supysonic.
|
||||
# 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.
|
||||
|
||||
@ -345,7 +345,7 @@ class Scanner(Thread):
|
||||
cover_name = os.path.basename(path)
|
||||
if not folder.cover_art:
|
||||
folder.cover_art = cover_name
|
||||
else:
|
||||
elif folder.cover_art != cover_name:
|
||||
album_name = None
|
||||
track = folder.tracks.select().first()
|
||||
if track is not None:
|
||||
|
@ -1,7 +1,7 @@
|
||||
# This file is part of Supysonic.
|
||||
# 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.
|
||||
|
||||
@ -68,8 +68,10 @@ class SupysonicWatcherEventHandler(PatternMatchingEventHandler):
|
||||
|
||||
def on_modified(self, event):
|
||||
logger.debug("File modified: '%s'", event.src_path)
|
||||
if not covers.is_valid_cover(event.src_path):
|
||||
self.queue.put(event.src_path, OP_SCAN)
|
||||
op = 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):
|
||||
logger.debug("File moved: '%s' -> '%s'", event.src_path, event.dest_path)
|
||||
|
Loading…
Reference in New Issue
Block a user