mirror of
https://github.com/PhoenixTwoFive/karaoqueue.git
synced 2025-07-01 15:51:41 +02:00
Compare commits
6 Commits
06594855d6
...
v2024.03
Author | SHA1 | Date | |
---|---|---|---|
cc4c538e91 | |||
a03c1c41bb
|
|||
ed09a93b3d
|
|||
0234d64bf2
|
|||
eb86575332
|
|||
1cf6a6a733 |
@ -32,11 +32,9 @@ def favicon():
|
|||||||
@nocache
|
@nocache
|
||||||
def enqueue():
|
def enqueue():
|
||||||
if not request.json:
|
if not request.json:
|
||||||
print(request.data)
|
|
||||||
abort(400)
|
abort(400)
|
||||||
client_id = request.json['client_id']
|
client_id = request.json['client_id']
|
||||||
if not helpers.is_valid_uuid(client_id):
|
if not helpers.is_valid_uuid(client_id):
|
||||||
print(request.data)
|
|
||||||
abort(400)
|
abort(400)
|
||||||
name = request.json['name'].strip()
|
name = request.json['name'].strip()
|
||||||
song_id = request.json['id']
|
song_id = request.json['id']
|
||||||
@ -46,11 +44,9 @@ def enqueue():
|
|||||||
else:
|
else:
|
||||||
if helpers.get_accept_entries(app):
|
if helpers.get_accept_entries(app):
|
||||||
if not request.json:
|
if not request.json:
|
||||||
print(request.data)
|
|
||||||
abort(400)
|
abort(400)
|
||||||
client_id = request.json['client_id']
|
client_id = request.json['client_id']
|
||||||
if not helpers.is_valid_uuid(client_id):
|
if not helpers.is_valid_uuid(client_id):
|
||||||
print(request.data)
|
|
||||||
abort(400)
|
abort(400)
|
||||||
name = request.json['name']
|
name = request.json['name']
|
||||||
song_id = request.json['id']
|
song_id = request.json['id']
|
||||||
@ -203,7 +199,6 @@ def get_stats():
|
|||||||
# Return data from long_term_stats as csv
|
# Return data from long_term_stats as csv
|
||||||
def get_stats_csv():
|
def get_stats_csv():
|
||||||
db_result = database.get_long_term_stats()
|
db_result = database.get_long_term_stats()
|
||||||
print(db_result)
|
|
||||||
csv = "Id,Playbacks\n"
|
csv = "Id,Playbacks\n"
|
||||||
for row in db_result:
|
for row in db_result:
|
||||||
csv += str(row[0]) + "," + str(row[1]) + "\n"
|
csv += str(row[0]) + "," + str(row[1]) + "\n"
|
||||||
@ -258,14 +253,11 @@ def delete_entry_admin(entry_id):
|
|||||||
@nocache
|
@nocache
|
||||||
def delete_entry_user(entry_id):
|
def delete_entry_user(entry_id):
|
||||||
if not request.json:
|
if not request.json:
|
||||||
print(request.data)
|
|
||||||
abort(400)
|
abort(400)
|
||||||
client_id = request.json['client_id']
|
client_id = request.json['client_id']
|
||||||
if not helpers.is_valid_uuid(client_id):
|
if not helpers.is_valid_uuid(client_id):
|
||||||
print(request.data)
|
|
||||||
abort(400)
|
abort(400)
|
||||||
if database.get_raw_entry(entry_id)[3] != client_id: # type: ignore
|
if database.get_raw_entry(entry_id)[3] != client_id: # type: ignore
|
||||||
print(request.data)
|
|
||||||
abort(403)
|
abort(403)
|
||||||
if database.delete_entry(entry_id):
|
if database.delete_entry(entry_id):
|
||||||
return Response('{"status": "OK"}', mimetype='text/json')
|
return Response('{"status": "OK"}', mimetype='text/json')
|
||||||
@ -278,7 +270,6 @@ def delete_entry_user(entry_id):
|
|||||||
@basic_auth.required
|
@basic_auth.required
|
||||||
def delete_entries():
|
def delete_entries():
|
||||||
if not request.json:
|
if not request.json:
|
||||||
print(request.data)
|
|
||||||
abort(400)
|
abort(400)
|
||||||
return
|
return
|
||||||
updates = database.delete_entries(request.json)
|
updates = database.delete_entries(request.json)
|
||||||
|
@ -298,8 +298,7 @@ def transfer_playbacks():
|
|||||||
ON DUPLICATE KEY
|
ON DUPLICATE KEY
|
||||||
UPDATE Playbacks = lts.Playbacks + VALUES(Playbacks);
|
UPDATE Playbacks = lts.Playbacks + VALUES(Playbacks);
|
||||||
""")
|
""")
|
||||||
result = conn.execute(stmt)
|
conn.execute(stmt)
|
||||||
print(result)
|
|
||||||
conn.commit()
|
conn.commit()
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
@ -63,9 +63,14 @@ body {
|
|||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.table {
|
||||||
|
color: var(--text-color);
|
||||||
|
}
|
||||||
|
|
||||||
table td {
|
table td {
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
|
color: var(--text-color);
|
||||||
}
|
}
|
||||||
|
|
||||||
table.entries tbody tr[data-index="0"] {
|
table.entries tbody tr[data-index="0"] {
|
||||||
@ -234,5 +239,8 @@ pre {
|
|||||||
/* Toasts */
|
/* Toasts */
|
||||||
--toast-background-color: #232323;
|
--toast-background-color: #232323;
|
||||||
--toast-text-color: #f5f5f5;
|
--toast-text-color: #f5f5f5;
|
||||||
|
|
||||||
|
/* Tables */
|
||||||
|
--table-border-color: #232323;
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -86,7 +86,7 @@
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
<a href="https://github.com/PhoenixTwoFive/karaoqueue" class="ml-1 mr-1"><i
|
<a href="https://github.com/PhoenixTwoFive/karaoqueue" class="ml-1 mr-1"><i
|
||||||
class="fab fa-github mr-1"></i><span>Github</span></a>
|
class="fab fa-github mr-1"></i><span>Github</span></a>
|
||||||
<span class="text-muted"> {{karaoqueue_version}} - 2019-23 - <span id="myName">Phillip
|
<span class="text-muted"> {{karaoqueue_version}} - 2019-24 - <span id="myName">Phillip
|
||||||
Kühne</span></span>
|
Kühne</span></span>
|
||||||
</div>
|
</div>
|
||||||
</footer>
|
</footer>
|
||||||
|
Reference in New Issue
Block a user