Checklist
-
Temps avant les Oscars (2 mars 2025) -
+
Temps avant les Oscars (2 mars 2025) -
+
@@ -137,6 +138,10 @@
}
const movies = await res.json();
+
+ // Sort movies alphabetically by title
+ movies.sort((a, b) => a.title.localeCompare(b.title, 'fr', { sensitivity: 'base' }));
+
const watchedRes = await fetch('/api/movies/watchedMovies', {
method: 'GET',
headers: { 'Authorization': `Bearer ${token}` }
@@ -223,6 +228,10 @@
});
});
+ const moviesLeft = totalMoviesCount - watchedMoviesCount;
+ const moviesPerDay = daysLeft > 0 ? (moviesLeft / daysLeft).toFixed(2) : moviesLeft;
+ document.getElementById('movies-per-day').textContent = `À voir par jour: ${moviesPerDay} films`;
+
document.getElementById('log-off').addEventListener('click', () => {
localStorage.removeItem('auth_token');
window.location.href = '/';
diff --git a/public/movies.html b/public/movies.html
index 8336ac7..f7d6c32 100644
--- a/public/movies.html
+++ b/public/movies.html
@@ -68,8 +68,8 @@