diff --git a/supysonic/daemon/server.py b/supysonic/daemon/server.py index dc63ee2..d8d6fb6 100644 --- a/supysonic/daemon/server.py +++ b/supysonic/daemon/server.py @@ -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: diff --git a/tests/api/test_scan.py b/tests/api/test_scan.py index 7b5454f..9114474 100644 --- a/tests/api/test_scan.py +++ b/tests/api/test_scan.py @@ -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)