mirror of
https://github.com/migatu/conjurer.git
synced 2026-07-14 21:38:38 +00:00
aa
This commit is contained in:
@@ -34,8 +34,7 @@ if platform in ("linux", "linux2"):
|
||||
|
||||
music_file_list = []
|
||||
def rescan():
|
||||
logger = logging.getLogger("conjurer_musician")
|
||||
logger.info("Rescan triggered")
|
||||
logging.info("Rescan triggered")
|
||||
for mp3_item in Path.glob(Path(MUSIC_FOLDER), "**/*.mp3"):
|
||||
temp_music_file = mp3_item.as_posix()
|
||||
if platform == "win32":
|
||||
@@ -43,11 +42,10 @@ def rescan():
|
||||
music_file_list.append(temp_music_file)
|
||||
|
||||
def thread_rescan():
|
||||
logger = logging.getLogger("conjurer_musician")
|
||||
logger.info("Starting filesystemupdater")
|
||||
logging.info("Starting filesystemupdater")
|
||||
while True:
|
||||
time.sleep(60*60*24)
|
||||
logger.info("Rescan triggered")
|
||||
logging.info("Rescan triggered")
|
||||
rescan()
|
||||
|
||||
app = Flask(__name__)
|
||||
@@ -72,6 +70,8 @@ def flask_debug():
|
||||
app.run(debug=True, use_reloader=False, host='0.0.0.0', port=5000)
|
||||
|
||||
if __name__ == "__main__":
|
||||
logger = logging.getLogger('conjurer_musician')
|
||||
logger.setLevel(logging.DEBUG)
|
||||
rescan()
|
||||
threading.Thread(target=flask_debug).start()
|
||||
threading.Thread(target=thread_rescan).start()
|
||||
|
||||
Reference in New Issue
Block a user