Lyrics added

This commit is contained in:
Halhadus 2024-12-21 14:42:31 +03:00
parent ad1609c98c
commit 69d7c844a3

View file

@ -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'