cxcxc
This commit is contained in:
parent
66f87cabfb
commit
01cd147f33
5 changed files with 13 additions and 21 deletions
|
@ -1,12 +1,12 @@
|
|||
const playing = localStorage.getItem("playing")
|
||||
|
||||
let uid = document.getElementById('uid')
|
||||
let u_username = document.getElementById('u_username')
|
||||
|
||||
if (uid)
|
||||
if (u_username)
|
||||
{
|
||||
uid = uid.innerHTML
|
||||
u_username = u_username.innerHTML
|
||||
|
||||
let audio = new Audio(`/songs/${uid}`);
|
||||
let audio = new Audio(`/@${u_username}/song`);
|
||||
audio.loop=true;
|
||||
|
||||
function toggle() {
|
||||
|
@ -37,14 +37,14 @@ if (uid)
|
|||
}
|
||||
else
|
||||
{
|
||||
let uid = document.getElementById('vid')
|
||||
if (uid)
|
||||
let v_username = document.getElementById('v_username')
|
||||
if (v_username)
|
||||
{
|
||||
uid = uid.innerHTML
|
||||
v_username = v_username.innerHTML
|
||||
|
||||
const paused = localStorage.getItem("paused")
|
||||
|
||||
let audio = new Audio(`/songs/${uid}`);
|
||||
let audio = new Audio(`/@${v_username}/song`);
|
||||
audio.loop=true;
|
||||
|
||||
function toggle() {
|
||||
|
|
|
@ -397,14 +397,6 @@ def get_profilecss(v, username):
|
|||
resp.headers.add("Content-Type", "text/css")
|
||||
return resp
|
||||
|
||||
@app.get("/songs/<id>")
|
||||
def songs(id):
|
||||
try: id = int(id)
|
||||
except: return "", 400
|
||||
user = g.db.query(User).filter_by(id=id).one_or_none()
|
||||
if user and user.song: return redirect(f"/static/song/{user.song}.mp3")
|
||||
else: abort(404)
|
||||
|
||||
@app.get("/@<username>/song")
|
||||
def usersong(username):
|
||||
user = get_user(username)
|
||||
|
|
|
@ -686,9 +686,9 @@
|
|||
|
||||
{% if u.song%}
|
||||
{% if v and v.id == u.id %}
|
||||
<div id="vid" class="d-none">{{v.id}}</div>
|
||||
<div id="v_username" class="d-none">{{v.username}}</div>
|
||||
{% else %}
|
||||
<div id="uid" class="d-none">{{u.id}}</div>
|
||||
<div id="u_username" class="d-none">{{u.username}}</div>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
|
||||
|
@ -698,7 +698,7 @@
|
|||
<div id="username" class="d-none">{{u.username}}</div>
|
||||
{% endif %}
|
||||
|
||||
<script src="/static/assets/js/userpage.js?a=208"></script>
|
||||
<script src="/static/assets/js/userpage.js?a=209"></script>
|
||||
|
||||
{% endblock %}
|
||||
|
||||
|
|
|
@ -114,5 +114,5 @@
|
|||
<div id="username" class="d-none">{{u.username}}</div>
|
||||
{% endif %}
|
||||
|
||||
<script src="/static/assets/js/userpage.js?a=208"></script>
|
||||
<script src="/static/assets/js/userpage.js?a=209"></script>
|
||||
{% endblock %}
|
|
@ -48,5 +48,5 @@
|
|||
<div id="username" class="d-none">{{u.username}}</div>
|
||||
{% endif %}
|
||||
|
||||
<script src="/static/assets/js/userpage.js?a=208"></script>
|
||||
<script src="/static/assets/js/userpage.js?a=209"></script>
|
||||
{% endblock %}
|
Loading…
Add table
Add a link
Reference in a new issue