mirror of
https://github.com/spl0k/supysonic.git
synced 2024-12-22 17:06:17 +00:00
Fix on scanner queuing
This commit is contained in:
parent
4fa744efcd
commit
8b93e0bc6e
@ -72,7 +72,9 @@ class Daemon:
|
|||||||
|
|
||||||
def start_scan(self, folders=[], force=False):
|
def start_scan(self, folders=[], force=False):
|
||||||
if not folders:
|
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():
|
if self.__scanner is not None and self.__scanner.is_alive():
|
||||||
for f in folders:
|
for f in folders:
|
||||||
|
@ -1,11 +1,10 @@
|
|||||||
# 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) 2020 Alban 'spl0k' Féron
|
# Copyright (C) 2020-2022 Alban 'spl0k' Féron
|
||||||
#
|
#
|
||||||
# Distributed under terms of the GNU AGPLv3 license.
|
# Distributed under terms of the GNU AGPLv3 license.
|
||||||
|
|
||||||
from pony.orm import db_session
|
|
||||||
from time import sleep
|
from time import sleep
|
||||||
from threading import Thread
|
from threading import Thread
|
||||||
|
|
||||||
@ -32,8 +31,7 @@ class ScanWithDaemonTestCase(ApiTestBase):
|
|||||||
def setUp(self):
|
def setUp(self):
|
||||||
super().setUp(apiVersion="1.16.0")
|
super().setUp(apiVersion="1.16.0")
|
||||||
|
|
||||||
with db_session:
|
Folder.create(name="Root", root=True, path="tests/assets")
|
||||||
Folder(name="Root", root=True, path="tests/assets")
|
|
||||||
|
|
||||||
self._daemon = Daemon(self.config)
|
self._daemon = Daemon(self.config)
|
||||||
self._thread = Thread(target=self._daemon.run)
|
self._thread = Thread(target=self._daemon.run)
|
||||||
|
Loading…
Reference in New Issue
Block a user