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

Fix on scanner queuing

This commit is contained in:
Alban Féron 2022-12-30 15:21:30 +01:00
parent 4fa744efcd
commit 8b93e0bc6e
No known key found for this signature in database
GPG Key ID: 8CE0313646D16165
2 changed files with 5 additions and 5 deletions

View File

@ -72,7 +72,9 @@ class Daemon:
def start_scan(self, folders=[], force=False):
if not folders:
folders = Folder.select().where(Folder.root)[:]
folders = [
t[0] for t in Folder.select(Folder.name).where(Folder.root).tuples()
]
if self.__scanner is not None and self.__scanner.is_alive():
for f in folders:

View File

@ -1,11 +1,10 @@
# This file is part of Supysonic.
# Supysonic is a Python implementation of the Subsonic server API.
#
# Copyright (C) 2020 Alban 'spl0k' Féron
# Copyright (C) 2020-2022 Alban 'spl0k' Féron
#
# Distributed under terms of the GNU AGPLv3 license.
from pony.orm import db_session
from time import sleep
from threading import Thread
@ -32,8 +31,7 @@ class ScanWithDaemonTestCase(ApiTestBase):
def setUp(self):
super().setUp(apiVersion="1.16.0")
with db_session:
Folder(name="Root", root=True, path="tests/assets")
Folder.create(name="Root", root=True, path="tests/assets")
self._daemon = Daemon(self.config)
self._thread = Thread(target=self._daemon.run)