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