mirror of
https://github.com/migatu/conjurer.git
synced 2026-07-18 15:52:10 +00:00
Minor fix 2
This commit is contained in:
@@ -1,9 +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
|
||||||
import json
|
|
||||||
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"):
|
||||||
@@ -39,27 +39,30 @@ for mp3_item in Path.glob(Path(MUSIC_FOLDER), "**/*.mp3"):
|
|||||||
|
|
||||||
app = Flask(__name__)
|
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("/mp3", methods=["GET"])
|
||||||
@app.route('/update_mp3', methods=['POST'])
|
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():
|
def update_music_list():
|
||||||
record = json.loads(request.data)
|
record = json.loads(request.data)
|
||||||
# logger print(record["item"])
|
app.logger.info(record["item"])
|
||||||
music_file_list.append(record["item"])
|
music_file_list.append(record["item"])
|
||||||
return_data = jsonify(isError= False,
|
return_data = (
|
||||||
message= "Success",
|
jsonify(isError=False, message="Success", statusCode=200, data=record),
|
||||||
statusCode= 200,
|
200,
|
||||||
data= record), 200
|
)
|
||||||
return return_data
|
return return_data
|
||||||
|
|
||||||
if __name__=='__main__':
|
|
||||||
|
if __name__ == "__main__":
|
||||||
app.run(debug=True, host="0.0.0.0")
|
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