Auto commit: 2026-02-17T22:42:46.185Z
This commit is contained in:
parent
39ef6459d5
commit
6be3a97820
28
index.php
28
index.php
@ -3118,6 +3118,20 @@ $twitter_link = "https://twitter.com/";
|
|||||||
if (coverPlaceholder) coverPlaceholder.style.display = 'none';
|
if (coverPlaceholder) coverPlaceholder.style.display = 'none';
|
||||||
trackCover.style.opacity = '1';
|
trackCover.style.opacity = '1';
|
||||||
|
|
||||||
|
// Save to recent tracks if changed
|
||||||
|
const currentTrackFull = `${artist} - ${title}`;
|
||||||
|
if (recentTracks.length === 0 || recentTracks[0].title !== currentTrackFull) {
|
||||||
|
const newTrack = {
|
||||||
|
title: currentTrackFull,
|
||||||
|
cover: coverUrl,
|
||||||
|
likes: 0
|
||||||
|
};
|
||||||
|
recentTracks.unshift(newTrack);
|
||||||
|
if (recentTracks.length > 6) recentTracks.pop();
|
||||||
|
localStorage.setItem('recentTracks', JSON.stringify(recentTracks));
|
||||||
|
renderRecentTracks();
|
||||||
|
}
|
||||||
|
|
||||||
fetch('api/record_history.php', {
|
fetch('api/record_history.php', {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
headers: { 'Content-Type': 'application/json' },
|
headers: { 'Content-Type': 'application/json' },
|
||||||
@ -3219,17 +3233,19 @@ $twitter_link = "https://twitter.com/";
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Initial fetch
|
|
||||||
updateMetadata();
|
|
||||||
fetchTopSongs();
|
|
||||||
fetchGallery();
|
|
||||||
fetchLeaderboard();
|
|
||||||
|
|
||||||
// Update cycles
|
// Update cycles
|
||||||
setInterval(updateMetadata, 30000);
|
setInterval(updateMetadata, 30000);
|
||||||
setInterval(fetchTopSongs, 60000);
|
setInterval(fetchTopSongs, 60000);
|
||||||
setInterval(fetchGallery, 3000); // Frecuencia aumentada para fotos efímeras (5s)
|
setInterval(fetchGallery, 3000); // Frecuencia aumentada para fotos efímeras (5s)
|
||||||
setInterval(fetchLeaderboard, 60000);
|
setInterval(fetchLeaderboard, 60000);
|
||||||
|
setInterval(fetchUpcomingTracks, 30000);
|
||||||
|
|
||||||
|
// Initial fetch
|
||||||
|
updateMetadata();
|
||||||
|
fetchTopSongs();
|
||||||
|
fetchGallery();
|
||||||
|
fetchLeaderboard();
|
||||||
|
fetchUpcomingTracks();
|
||||||
|
|
||||||
// Theme Toggle Functionality
|
// Theme Toggle Functionality
|
||||||
function toggleTheme() {
|
function toggleTheme() {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user