mirror of
https://github.com/migatu/conjurer.git
synced 2026-07-14 21:38:38 +00:00
aa
This commit is contained in:
@@ -4,7 +4,7 @@ from platform import uname
|
||||
import threading
|
||||
import time
|
||||
from sys import platform
|
||||
|
||||
import logging
|
||||
from flask import Flask, jsonify, request
|
||||
|
||||
if platform in ("linux", "linux2"):
|
||||
@@ -33,7 +33,8 @@ if platform in ("linux", "linux2"):
|
||||
|
||||
|
||||
music_file_list = []
|
||||
def rescan(logger):
|
||||
def rescan():
|
||||
logger = logging.getLogger("conjurer_musician")
|
||||
logger.info("Rescan triggered")
|
||||
for mp3_item in Path.glob(Path(MUSIC_FOLDER), "**/*.mp3"):
|
||||
temp_music_file = mp3_item.as_posix()
|
||||
@@ -41,7 +42,8 @@ def rescan(logger):
|
||||
temp_music_file = temp_music_file.replace("/", "\\")
|
||||
music_file_list.append(temp_music_file)
|
||||
|
||||
def thread_rescan(name,logger):
|
||||
def thread_rescan(name):
|
||||
logger = logging.getLogger("conjurer_musician")
|
||||
logger.info(f"Starting filesystemupdater {name}")
|
||||
while True:
|
||||
time.sleep(60*60*24)
|
||||
@@ -69,8 +71,8 @@ def update_music_list():
|
||||
|
||||
if __name__ == "__main__":
|
||||
print(app.logger.name)
|
||||
rescan(app.logger.getChild("BGtask"))
|
||||
thread = threading.Thread(target=thread_rescan, args=["Updater",app.logger.getChild("BGtask")])
|
||||
rescan()
|
||||
thread = threading.Thread(target=thread_rescan, args=(1,))
|
||||
thread.start()
|
||||
app.run(debug=True, host="0.0.0.0")
|
||||
#from waitress import serve
|
||||
|
||||
Reference in New Issue
Block a user