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
75 lines
1.9 KiB
TypeScript
75 lines
1.9 KiB
TypeScript
import { api } from '@/lib/api';
|
|
import type { TmdbEntry, TmdbPaginatedResponse, TmdbPerson } from '@/types';
|
|
|
|
export const tmdbApi = {
|
|
getPopularMovies: (page = 1) =>
|
|
api
|
|
.get<TmdbPaginatedResponse<TmdbEntry>>('/entries/tmdb/popular/movie', {
|
|
params: { page },
|
|
})
|
|
.then((r) => r.data),
|
|
|
|
getPopularTv: (page = 1) =>
|
|
api
|
|
.get<TmdbPaginatedResponse<TmdbEntry>>('/entries/tmdb/popular/tv', {
|
|
params: { page },
|
|
})
|
|
.then((r) => r.data),
|
|
|
|
getTrendingMovies: (page = 1) =>
|
|
api
|
|
.get<TmdbPaginatedResponse<TmdbEntry>>('/entries/tmdb/trending/movie', {
|
|
params: { page },
|
|
})
|
|
.then((r) => r.data),
|
|
|
|
getTrendingTv: (page = 1) =>
|
|
api
|
|
.get<TmdbPaginatedResponse<TmdbEntry>>('/entries/tmdb/trending/tv', {
|
|
params: { page },
|
|
})
|
|
.then((r) => r.data),
|
|
|
|
getTopRatedMovies: (page = 1) =>
|
|
api
|
|
.get<TmdbPaginatedResponse<TmdbEntry>>('/entries/tmdb/top-rated/movie', {
|
|
params: { page },
|
|
})
|
|
.then((r) => r.data),
|
|
|
|
getTopRatedTv: (page = 1) =>
|
|
api
|
|
.get<TmdbPaginatedResponse<TmdbEntry>>('/entries/tmdb/top-rated/tv', {
|
|
params: { page },
|
|
})
|
|
.then((r) => r.data),
|
|
|
|
getUpcomingMovies: (page = 1) =>
|
|
api
|
|
.get<TmdbPaginatedResponse<TmdbEntry>>('/entries/tmdb/upcoming/movie', {
|
|
params: { page },
|
|
})
|
|
.then((r) => r.data),
|
|
|
|
search: (query: string, page = 1) =>
|
|
api
|
|
.get<TmdbPaginatedResponse<TmdbEntry>>('/entries/tmdb/search', {
|
|
params: { query, page },
|
|
})
|
|
.then((r) => r.data),
|
|
|
|
getPopularPeople: (page = 1) =>
|
|
api
|
|
.get<TmdbPaginatedResponse<TmdbPerson>>('/people/tmdb/popular', {
|
|
params: { page },
|
|
})
|
|
.then((r) => r.data),
|
|
|
|
searchPeople: (query: string, page = 1) =>
|
|
api
|
|
.get<TmdbPaginatedResponse<TmdbPerson>>('/people/tmdb/search', {
|
|
params: { query, page },
|
|
})
|
|
.then((r) => r.data),
|
|
};
|