mirror of
https://github.com/migatu/conjurer.git
synced 2026-07-16 06:42:10 +00:00
Bugfixing
add Test 1 Test 2 Test3 Test phase 2 FIx 1 Fix 2 Fix 10 Fix 11 Fix 13 Fix 14 Fix 15 Test 1 Test 2 Test 3 Fix 15 Test 7 Fix 18 Test 20 Done Minor 1
This commit is contained in:
@@ -1,8 +1,9 @@
|
|||||||
|
import json
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from platform import uname
|
from platform import uname
|
||||||
from sys import platform
|
from sys import platform
|
||||||
|
|
||||||
from flask import Flask, jsonify, request
|
from flask import Flask, jsonify, request
|
||||||
import uuid
|
|
||||||
|
|
||||||
MUSIC_FOLDER = ""
|
MUSIC_FOLDER = ""
|
||||||
if platform in ("linux", "linux2"):
|
if platform in ("linux", "linux2"):
|
||||||
@@ -38,17 +39,30 @@ for mp3_item in Path.glob(Path(MUSIC_FOLDER), "**/*.mp3"):
|
|||||||
|
|
||||||
app = Flask(__name__)
|
app = Flask(__name__)
|
||||||
|
|
||||||
@app.route('/mp3', methods=['GET'])
|
|
||||||
|
@app.route("/mp3", methods=["GET"])
|
||||||
def get_music_list():
|
def get_music_list():
|
||||||
return jsonify({'music_file_list':music_file_list})
|
return jsonify({"music_file_list": music_file_list})
|
||||||
|
|
||||||
if __name__=='__main__':
|
|
||||||
app.run(debug=True)
|
|
||||||
|
|
||||||
#TODO: Reskan co 24h
|
# TODO: Przyjecie informacji o zmianie i dodanie pliku saute
|
||||||
|
@app.route("/update_mp3", methods=["POST"])
|
||||||
|
def update_music_list():
|
||||||
|
record = json.loads(request.data)
|
||||||
|
app.logger.info(record["item"])
|
||||||
|
music_file_list.append(record["item"])
|
||||||
|
return_data = (
|
||||||
|
jsonify(isError=False, message="Success", statusCode=200, data=record),
|
||||||
|
200,
|
||||||
|
)
|
||||||
|
return return_data
|
||||||
|
|
||||||
#TODO: Informacja o zmianie i update
|
|
||||||
|
|
||||||
#TODO: Odpowiedz na zapytanie
|
if __name__ == "__main__":
|
||||||
|
app.run(debug=True, host="0.0.0.0")
|
||||||
|
|
||||||
#TODO: Przyjecie informacji o zmianie i dodanie pliku saute
|
# TODO: Reskan co 24h
|
||||||
|
|
||||||
|
# TODO: Informacja o zmianie i update
|
||||||
|
|
||||||
|
# TODO: Move download Youtube i Spotify tutaj (bedzie potrzebny wtedy rest w obie strony)
|
||||||
|
|||||||
Reference in New Issue
Block a user