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:
parent
f387cce9ca
commit
4bee23ce23
@ -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:
|
||||||
|
@ -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)
|
||||||
|
Loading…
Reference in New Issue
Block a user