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