Lyrics added
This commit is contained in:
parent
ad1609c98c
commit
69d7c844a3
1 changed files with 3 additions and 0 deletions
|
@ -43,6 +43,9 @@ def musicstatus():
|
|||
history.append(currentbeforereset)
|
||||
html += f'<h2>Currently Playing: {history[-1][0]}</h2>\n'
|
||||
html += f'<h2>Last Update Time: {datetime.datetime.fromtimestamp(int(history[-1][1]), datetime.timezone.utc).strftime("%Y-%m-%d %H:%M:%S")} (UTC +0)</h2>\n'
|
||||
if os.path.exists("lyrics/" + history[-1][0] + ".txt"):
|
||||
with open("lyrics/" + history[-1][0] + ".txt", "r") as f:
|
||||
html += f'<h2>Lyrics:</h2>\n<p>{f.read()}</p>\n'
|
||||
html += '<table style="width: 100%; border-collapse: collapse;">\n<tr>\n<th style="border: 1px solid #ffffff; padding: 10px;">Music Name</th>\n<th style="border: 1px solid #ffffff; padding: 10px;">Time</th>\n</tr>\n'
|
||||
for music in history[::-1]:
|
||||
html += '<tr>\n<td style="border: 1px solid #ffffff; padding: 10px;">' + music[0] + '</td>\n<td style="border: 1px solid #ffffff; padding: 10px;">' + datetime.datetime.fromtimestamp(int(music[1]), datetime.timezone.utc).strftime("%Y-%m-%d %H:%M:%S") + '</td>\n</tr>\n'
|
||||
|
|
Loading…
Reference in a new issue