mirror of
https://github.com/migatu/conjurer.git
synced 2026-07-17 23:32:10 +00:00
Test 1
This commit is contained in:
@@ -69,6 +69,9 @@ MUZYKA_MOJEGO_LUDU_HISTORIA = 1500
|
|||||||
MUZYKA_MOJEGO_LUDU_SLOWA_KLUCZOWE = 15
|
MUZYKA_MOJEGO_LUDU_SLOWA_KLUCZOWE = 15
|
||||||
MUZYKA_MOJEGO_LUDU_PLAJLISTA = 30
|
MUZYKA_MOJEGO_LUDU_PLAJLISTA = 30
|
||||||
|
|
||||||
|
FILE_SERVICE_ADDRESS = "http://192.161.168.1.15:5000"
|
||||||
|
GET_MP3 = "/mp3"
|
||||||
|
|
||||||
# *=========================================== Platform Specific Predefines
|
# *=========================================== Platform Specific Predefines
|
||||||
|
|
||||||
if platform in ("linux", "linux2"):
|
if platform in ("linux", "linux2"):
|
||||||
@@ -162,11 +165,21 @@ logger.info("Playlist generation")
|
|||||||
|
|
||||||
# *=========================================== Load Data files
|
# *=========================================== Load Data files
|
||||||
music_file_list = []
|
music_file_list = []
|
||||||
for mp3_item in Path.glob(Path(MUSIC_FOLDER), "**/*.mp3"):
|
try:
|
||||||
temp_music_file = mp3_item.as_posix()
|
response = requests.get(f'{FILE_SERVICE_ADDRESS}{GET_MP3}',timeout=360)
|
||||||
if platform == "win32":
|
music_file_list = response.json()
|
||||||
temp_music_file = temp_music_file.replace("/", "\\")
|
except:
|
||||||
music_file_list.append(temp_music_file)
|
for mp3_item in Path.glob(Path(MUSIC_FOLDER), "**/*.mp3"):
|
||||||
|
temp_music_file = mp3_item.as_posix()
|
||||||
|
if platform == "win32":
|
||||||
|
temp_music_file = temp_music_file.replace("/", "\\")
|
||||||
|
music_file_list.append(temp_music_file)
|
||||||
|
logger.error("Service Unavailable")
|
||||||
|
finally:
|
||||||
|
sys,exit()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
with open(SYSTEM_GPT_SETTINGS, "r+", encoding=ENCODING) as temp_settings_file:
|
with open(SYSTEM_GPT_SETTINGS, "r+", encoding=ENCODING) as temp_settings_file:
|
||||||
# First we load existing data into a dict.
|
# First we load existing data into a dict.
|
||||||
GPT_SETTINGS = json.load(temp_settings_file)
|
GPT_SETTINGS = json.load(temp_settings_file)
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ def get_music_list():
|
|||||||
return jsonify({'music_file_list':music_file_list})
|
return jsonify({'music_file_list':music_file_list})
|
||||||
|
|
||||||
if __name__=='__main__':
|
if __name__=='__main__':
|
||||||
app.run(debug=True, host="0.0.0.0")
|
app.run(debug=False, host="192.168.161.1.15")
|
||||||
|
|
||||||
#TODO: Reskan co 24h
|
#TODO: Reskan co 24h
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user