feat: multi-page improvements, bug fixes, and new features
Library: - Exclude hidden entries from all/movies/tv/favorites tabs (only show in hidden tab) Entry Details: - Move favorite, mark watched, and more actions to top-right as icon-only buttons with tooltips - Fix season card play button — marks next unwatched episode as seen Seasons Page: - Fix episode watch button (was a TODO stub, now calls createEpisodeSeen) Episode Page: - Fix UI not updating after deleting the last watch record — invalidate season episodes query on delete Dashboard: - Fix Top Genres 404 — was calling non-existent GET /statistics, now uses /statistics/watch-time - Fix TopGenresChart genre counting (Genre objects were wrongly cast as strings) - Add LibraryGrowthChart (cumulative titles added over time) - Add MediaTypeChart (Movies vs TV Series donut chart) Home Page: - Add TrendingSlider hero at top of page with auto-advance, dots, and prev/next nav - Fix slider prev/next buttons (stable callbacks via ref, plain buttons, reactive library state) - Add debounce (400ms) to search input - Add Top Rated section (movies & TV) - Add Upcoming section (movies) - Replace inline "More" expand with link to /discover/:category Discover Page (new): - Full-page TMDB browser per category (trending/popular/top-rated/upcoming) - Movie/TV tab toggle - IntersectionObserver infinite scroll Calendar: - Fix large season numbers — use season.season_number instead of season_id (DB primary key) Backend: - Add fetchTopRated() and fetchUpcoming() to tmdbService - Add GET /entries/tmdb/top-rated/:type and /entries/tmdb/upcoming/movie routes
This commit is contained in:
1 parent
d60d142d17
commit
ab20a5e64f
23 files changed
+820
-104
No files matched your search
@@ -146,6 +146,23 @@ class EntryController {
|
||||
if (!data) return res.status(500).json({ message: 'Failed to search TMDB' });
|
||||
res.status(200).json(data);
|
||||
});
|
||||
|
||||
// * GET - TMDB TOP RATED
|
||||
getTmdbTopRated = asyncWrapper(async (req, res) => {
|
||||
const { type } = req.params;
|
||||
const { page } = req.query;
|
||||
const data = await tmdbService.fetchTopRated(type, page || 1);
|
||||
if (!data) return res.status(500).json({ message: 'Failed to fetch top rated data' });
|
||||
res.status(200).json(data);
|
||||
});
|
||||
|
||||
// * GET - TMDB UPCOMING
|
||||
getTmdbUpcoming = asyncWrapper(async (req, res) => {
|
||||
const { page } = req.query;
|
||||
const data = await tmdbService.fetchUpcoming(page || 1);
|
||||
if (!data) return res.status(500).json({ message: 'Failed to fetch upcoming data' });
|
||||
res.status(200).json(data);
|
||||
});
|
||||
}
|
||||
|
||||
module.exports = new EntryController();
|
||||
@@ -14,6 +14,8 @@ const mediaOptimizerService = require('../services/mediaOptimizerService');
|
||||
// ! TMDB PROXY ROUTES (must be before /:id to avoid matching)
|
||||
entryRouter.get('/tmdb/trending/:type', entryController.getTmdbTrending);
|
||||
entryRouter.get('/tmdb/popular/:type', entryController.getTmdbPopular);
|
||||
entryRouter.get('/tmdb/top-rated/:type', entryController.getTmdbTopRated);
|
||||
entryRouter.get('/tmdb/upcoming/movie', entryController.getTmdbUpcoming);
|
||||
entryRouter.get('/tmdb/search', entryController.getTmdbSearch);
|
||||
|
||||
entryRouter.get('/sync-series', entryController.syncSeries);
|
||||
|
||||
@@ -173,6 +173,30 @@ async function fetchPopular(type, page = 1) {
|
||||
}
|
||||
}
|
||||
|
||||
async function fetchTopRated(type, page = 1) {
|
||||
try {
|
||||
let url = `${TMDB_APIURL}${type}/top_rated?api_key=${TMDB_APIKEY}&language=en-US&page=${page}`;
|
||||
logToFile(`Fetching Top Rated ${type} From: ${url}`);
|
||||
const response = await axios.get(url);
|
||||
return response.data;
|
||||
} catch (error) {
|
||||
console.log(`Error fetching top rated ${type}.`, error);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
async function fetchUpcoming(page = 1) {
|
||||
try {
|
||||
let url = `${TMDB_APIURL}movie/upcoming?api_key=${TMDB_APIKEY}&language=en-US&page=${page}`;
|
||||
logToFile(`Fetching Upcoming Movies From: ${url}`);
|
||||
const response = await axios.get(url);
|
||||
return response.data;
|
||||
} catch (error) {
|
||||
console.log('Error fetching upcoming movies.', error);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
async function searchMulti(query, page = 1) {
|
||||
try {
|
||||
let url = `${TMDB_APIURL}search/multi?api_key=${TMDB_APIKEY}&language=en-US&query=${encodeURIComponent(query)}&page=${page}`;
|
||||
@@ -231,6 +255,8 @@ module.exports = {
|
||||
fetchPersonCombinedCredits,
|
||||
fetchTrending,
|
||||
fetchPopular,
|
||||
fetchTopRated,
|
||||
fetchUpcoming,
|
||||
searchMulti,
|
||||
searchPeople,
|
||||
fetchPopularPeople,
|
||||
|
||||
Reference in new issue
Block a user