From 6be3a9782090ca0c658c1ca091d601ef58e274d2 Mon Sep 17 00:00:00 2001 From: Flatlogic Bot Date: Tue, 17 Feb 2026 22:42:46 +0000 Subject: [PATCH] Auto commit: 2026-02-17T22:42:46.185Z --- index.php | 28 ++++++++++++++++++++++------ 1 file changed, 22 insertions(+), 6 deletions(-) diff --git a/index.php b/index.php index 809e3ce..b1a7dea 100644 --- a/index.php +++ b/index.php @@ -3118,6 +3118,20 @@ $twitter_link = "https://twitter.com/"; if (coverPlaceholder) coverPlaceholder.style.display = 'none'; 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', { method: 'POST', headers: { 'Content-Type': 'application/json' }, @@ -3219,17 +3233,19 @@ $twitter_link = "https://twitter.com/"; } } - // Initial fetch - updateMetadata(); - fetchTopSongs(); - fetchGallery(); - fetchLeaderboard(); - // Update cycles setInterval(updateMetadata, 30000); setInterval(fetchTopSongs, 60000); setInterval(fetchGallery, 3000); // Frecuencia aumentada para fotos efĂ­meras (5s) setInterval(fetchLeaderboard, 60000); + setInterval(fetchUpcomingTracks, 30000); + + // Initial fetch + updateMetadata(); + fetchTopSongs(); + fetchGallery(); + fetchLeaderboard(); + fetchUpcomingTracks(); // Theme Toggle Functionality function toggleTheme() {