mirror of
https://github.com/migatu/conjurer.git
synced 2026-07-14 21:38:38 +00:00
Service
FIx
This commit is contained in:
@@ -0,0 +1,54 @@
|
|||||||
|
from pathlib import Path
|
||||||
|
from platform import uname
|
||||||
|
from sys import platform
|
||||||
|
from flask import Flask, jsonify, request
|
||||||
|
import uuid
|
||||||
|
|
||||||
|
MUSIC_FOLDER = ""
|
||||||
|
if platform in ("linux", "linux2"):
|
||||||
|
SEPARATOR_FILE_PATH = "/"
|
||||||
|
if "microsoft-standard" in uname().release:
|
||||||
|
LOGFILE = "/home/mtuszowski/conjurer/discord_mus_service.log"
|
||||||
|
MUSIC_FOLDER = "/mnt/g/Muzyka/"
|
||||||
|
NETRC_FILE = "/home/mtuszowski/.netrc"
|
||||||
|
LOGSTORE = "/home/mtuszowski/conjurer/logs/"
|
||||||
|
ENCODING = "utf-8"
|
||||||
|
GRAPHICS_PATH = "/home/mtuszowski/conjurer/Conjurer_graphics/"
|
||||||
|
|
||||||
|
else:
|
||||||
|
LOGFILE = "/home/pi/Conjurer/discord_mus_service.log"
|
||||||
|
MEMORY_FIVE_SIARA = "/home/pi/Conjurer/pamiec.json"
|
||||||
|
SYSTEM_GPT_SETTINGS = "/home/pi/Conjurer/system_gpt_settings.json"
|
||||||
|
MEMORY_FIVE_MUZYKA = "/home/pi/Conjurer/pamiec_muzyki.json"
|
||||||
|
MUSIC_FOLDER = "/home/pi/RetroPie/mp3/"
|
||||||
|
SETTINGS_FILE = "/home/pi/Conjurer/settings.json"
|
||||||
|
NETRC_FILE = "/home/pi/.netrc"
|
||||||
|
LOGSTORE = "/home/pi/RetroPie/logs/"
|
||||||
|
ACCIDENT_LOG = "/home/pi/Conjurer/accident_log.json"
|
||||||
|
ENCODING = "utf-8"
|
||||||
|
GRAPHICS_PATH = "/home/pi/RetroPie/Conjurer_graphics/"
|
||||||
|
DIR_PATH_SADOX = "/home/pi/RetroPie/Fansadox/"
|
||||||
|
|
||||||
|
music_file_list = []
|
||||||
|
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)
|
||||||
|
|
||||||
|
app = Flask(__name__)
|
||||||
|
|
||||||
|
@app.route('/mp3', methods=['GET'])
|
||||||
|
def get_music_list():
|
||||||
|
return jsonify({'music_file_list':music_file_list})
|
||||||
|
|
||||||
|
if __name__=='__main__':
|
||||||
|
app.run(debug=True)
|
||||||
|
|
||||||
|
#TODO: Reskan co 24h
|
||||||
|
|
||||||
|
#TODO: Informacja o zmianie i update
|
||||||
|
|
||||||
|
#TODO: Odpowiedz na zapytanie
|
||||||
|
|
||||||
|
#TODO: Przyjecie informacji o zmianie i dodanie pliku saute
|
||||||
|
|||||||
@@ -1,35 +0,0 @@
|
|||||||
from pathlib import Path, PurePath
|
|
||||||
from platform import uname
|
|
||||||
from sys import platform
|
|
||||||
MUSIC_FOLDER = ""
|
|
||||||
if platform in ("linux", "linux2"):
|
|
||||||
SEPARATOR_FILE_PATH = "/"
|
|
||||||
if "microsoft-standard" in uname().release:
|
|
||||||
LOGFILE = "/home/mtuszowski/conjurer/discord_mus_service.log"
|
|
||||||
MUSIC_FOLDER = "/mnt/g/Muzyka/"
|
|
||||||
NETRC_FILE = "/home/mtuszowski/.netrc"
|
|
||||||
LOGSTORE = "/home/mtuszowski/conjurer/logs/"
|
|
||||||
ENCODING = "utf-8"
|
|
||||||
GRAPHICS_PATH = "/home/mtuszowski/conjurer/Conjurer_graphics/"
|
|
||||||
|
|
||||||
else:
|
|
||||||
LOGFILE = "/home/pi/Conjurer/discord_mus_service.log"
|
|
||||||
MEMORY_FIVE_SIARA = "/home/pi/Conjurer/pamiec.json"
|
|
||||||
SYSTEM_GPT_SETTINGS = "/home/pi/Conjurer/system_gpt_settings.json"
|
|
||||||
MEMORY_FIVE_MUZYKA = "/home/pi/Conjurer/pamiec_muzyki.json"
|
|
||||||
MUSIC_FOLDER = "/home/pi/RetroPie/mp3/"
|
|
||||||
SETTINGS_FILE = "/home/pi/Conjurer/settings.json"
|
|
||||||
NETRC_FILE = "/home/pi/.netrc"
|
|
||||||
LOGSTORE = "/home/pi/RetroPie/logs/"
|
|
||||||
ACCIDENT_LOG = "/home/pi/Conjurer/accident_log.json"
|
|
||||||
ENCODING = "utf-8"
|
|
||||||
GRAPHICS_PATH = "/home/pi/RetroPie/Conjurer_graphics/"
|
|
||||||
DIR_PATH_SADOX = "/home/pi/RetroPie/Fansadox/"
|
|
||||||
|
|
||||||
music_file_list = []
|
|
||||||
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)
|
|
||||||
|
|
||||||
Reference in New Issue
Block a user