Commit Graph
38 Commits
Author SHA1 Message Date
Mohammed Abad 5fa2556b43 feat(frontend): show seen dates inline on episode cards and fix cast page
- Display all seen dates inline (comma-separated) on episode cards in SeasonPage; remove unused Tooltip imports
- Propagate episode_count in normalizeCredit so TV series cast shows X ep.
- Add entriesApi.getCredits(id) API method and useEntryCredits(id) hook
- Load all credits in EntryCastsPage via useEntryCredits (no more 10-cast limit)
- Replace full-list render with IntersectionObserver lazy loader (24 per chunk)
- Fix Sort/Filter Select trigger to show human-readable label instead of raw key
2026-04-29 16:04:19 +01:00
Mohammed Abad 22d111ef71 fix(backend): include EpisodeSeen in season episodes and add entry credits endpoint
- Add getEntryCredits service method returning all cast + crew with People, ordered by cast_type, order, episode_count
- Add getEntryCredits controller method
- Add GET /entries/:id/credits route in entry.routes.js
- Include EpisodeSeen association in getSeasonEpisodes so seen dates are returned to frontend
2026-04-29 16:04:10 +01:00
Mohammed AbadandCopilot e460290b9b feat(frontend): unify person routing, cast page, and centralize ratings
- Add EntryCastsPage at /entry/:id/cast with sort/filter and breadcrumb nav
- Show episode count under character names for TV series in CastList
- Add "All Cast & Crew →" link to CastList section header
- Extract reusable StarRating component with half-star support and 3 sizes
- Replace all rating UIs (EntrySettingsDialog, CollectionEditDialog, RatingDialog)
- Document StarRating component as the single rating standard in Components.md

Co-authored-by: Copilot <copilot@github.com>
2026-04-27 13:45:48 +01:00
Mohammed AbadandCopilot b3002a329d fix(frontend): redirect to local person page if already in DB
- PersonDetailsPage (TMDB mode) redirects to /people/:localId when local_id is present
- "Add to Library" button only shown for people not in local DB
- Shows skeleton during redirect to avoid flash of preview content

Co-authored-by: Copilot <copilot@github.com>
2026-04-27 13:44:34 +01:00
Mohammed Abad 507cdbcff7 fix(backend): check local DB before returning TMDB person preview
- Return local_id in GET /people/tmdb/preview/:tmdbId if person exists in DB
- Prevents duplicate "Add to Library" prompts for already-saved people
2026-04-27 13:43:57 +01:00
Mohammed Abad db6da6782f feat(people): unify person detail page for DB and TMDB sources
- Merge PersonDetailsPage and PersonTmdbRedirectPage into one component
- /people/:id fetches from local DB with favorite toggle
- /people/tmdb/:tmdbId fetches from TMDB with "Add to Library" button
- Add TMDB external link in person metadata
- Fix CastList links for TMDB preview cast (use /people/tmdb/:tmdbId)
- Replace 11MB getAll() with server-side paginated infinite scroll
- Add useLocalPeopleInfinite hook and PaginatedPeopleResponse type
2026-04-27 13:29:30 +01:00
Mohammed AbadandCopilot 6d676d803c feat(people): add pagination support to getAllPeople endpoint
Support optional page, limit, and search query params.
Returns { data, total, page, totalPages } when paginated,
plain array for backward compatibility.

Co-authored-by: Copilot <copilot@github.com>
2026-04-27 13:29:16 +01:00
Mohammed Abad 8aca121b10 fix: people details page not working for people that are not in db 2026-04-27 12:33:02 +01:00
Mohammed Abad 0329808562 Small fixes 2026-04-27 12:07:39 +01:00
Mohammed AbadandCopilot a42d4ee7d7 feat(frontend): fix hooks crash, persist library filters, improve UI
- Fix "rendered more hooks" crash in CollectionDetailsPage by moving all hooks before conditionals
- Persist library search/filters only on back navigation using useNavigationType
- Add resetAll() to useLibraryFiltersStore
- Move sort toolbar to hero bottom-right in CollectionDetailsPage
- Fall back to entry backdrops when collection has none
- Show full cast in TmdbPreviewPage matching EntryDetailsPage layout
- Remove tagline/icons from TmdbPreviewPage to match in-library style
- Lazy load people in local DB mode with infinite scroll
- Move All/Favorite filter to right side in PeoplePage, always visible
- Track dropdownOpen state in EntryCard to fix menu close flash

Co-authored-by: Copilot <copilot@github.com>
2026-04-27 11:49:00 +01:00
Mohammed Abad ea143fb32a fix(backend): fetch credits in TMDB preview and fix collection fallback
- Add credits fetch to GET /entries/tmdb/preview/:type/:tmdbId endpoint
- Map cast/crew to Credit-like shapes in preview response
- Fall back to entry backdrops when collection has no backdrop
2026-04-27 11:48:47 +01:00
Mohammed AbadandCopilot 02cdcf733d feat(frontend): navigate non-library entries to TMDB preview page
- Add TmdbPreviewPage showing TMDB details without adding to library
- Display backdrop, poster, title, tagline, genres, rating, storyline
- Show season/episode count for TV series
- Add "Add to Library" button that creates entry then redirects to details page
- Show "Already in Library — View" if entry exists in DB
- Add /entry/tmdb/:type/:tmdbId route in router.tsx
- Add TmdbPreview type, entriesApi.previewTmdb(), and useTmdbPreview() hook
- Update EntryCard to navigate to preview page instead of auto-adding

Co-authored-by: Copilot <copilot@github.com>
2026-04-27 04:03:21 +01:00
Mohammed Abad 25b645a16f feat(backend): add TMDB preview endpoint for non-library entries
- Add GET /entries/tmdb/preview/:type/:tmdbId endpoint in entryController.js
- Fetch TMDB data via tmdbService.fetchEntryData() without persisting to DB
- Return normalized preview object with title, poster, genres, rating, season/episode counts
2026-04-27 04:03:02 +01:00
Mohammed Abad 6aa57cbe71 feat(frontend): add MarkSeasonWatchedDialog with scatter mode
- Create MarkSeasonWatchedDialog replacing two-step EpisodeSeenEditDialog+ConfirmDialog flow
- Add scatter mode to distribute episodes across a date range with preview
- Always show "Mark Season Watched" button on SeasonPage
2026-04-23 16:51:29 +01:00
Mohammed Abad ce01dc34fa feat(backend): fix credit duplicates, support multi-role TV credits, fix collection upload
- Fix credit dedup key to people_id + cast_type (scoped to entry_id)
- Detect aggregate_credits format via Array.isArray(c.roles) instead of is_tvseries flag
- Join multiple roles/jobs with "; " instead of taking only the first
- Add episode_count field to Credit model from total_episode_count
- Increase character and job columns to VARCHAR(500)
- Deselect existing collection posters/backdrops before inserting new upload
- Updated docs-vault
- Updated some agents files
2026-04-23 16:51:18 +01:00
Mohammed Abad 260282a0e2 Updated the Obsidian docs-vault 2026-04-22 14:48:43 +01:00
Mohammed Abad 1058274a6a Initiated the obsidian vault 2026-04-22 02:09:10 +01:00
Mohammed Abad 3c4958df50 Frontend: UI improvements, dashboard fixes, and settings cleanup
- EntrySeenDialog: native date input, merged date+accuracy row
- EpisodeSeenEditDialog: merged date+accuracy row
- LibraryGrowthChart: use createdAt only, include all entries
- SeasonPage/EpisodePage: max-w-4xl, improved breadcrumbs ("Title / Season x / Episode x"), fixed season number display
- SettingsPage: added Cleanup section for orphan files/media records
- Added maintenance API client
- Updated docs-vault and project documentation
2026-04-22 02:08:54 +01:00
Mohammed Abad cd695ef4cf Updated Agent Instructions 2026-04-22 02:08:40 +01:00
Mohammed Abad a0d8ee0317 Backend: statistics accuracy filter and maintenance docs
- statisticsController: filter CouchDayChart data to accuracy='EXACT'
- Documented maintenance endpoints and statistics changes in docs-vault
2026-04-22 02:08:01 +01:00
Mohammed Abad 63fdc00ac2 feat: entry details overhaul, navigation, rating half-stars, library growth "all", accuracy field
- SeasonPage: add back navigation link to entry details page
- EpisodePage: add breadcrumb navigation back to entry and season pages
- EntryCard: non-library entries now open a details dialog on click with overview, rating, and add-to-library button
- EntryDetailsPage: move favorite and mark-watched buttons into grouped dropdown menu with separators
- EntryDetailsPage: add favorite badge (heart icon) on top-left of poster
- EntryDetailsPage: add "mark as watched" clickable text next to runtime for unwatched movies
- EntryDetailsPage: genre pills are now clickable links that navigate to library page with genre filter
- EntryDetailsPage: hide status pill for movies; show status as text next to release date for TV series
- EntryDetailsPage: add delete entry option in dropdown menu with confirmation dialog and redirect to library
- EntryDetailsPage: add TMDB and IMDb external links under poster using entry.entryIds
- EntryDetailsPage: group all dropdown actions by relevance (Watch/Rate, Organize, Manage, Danger) with separators
- RatingDialog: support half-star ratings (0.5 increments) with left/right click zones per star
- RatingDialog: fix clear rating button by syncing state on dialog open and using dedicated handleClear function
- LibraryGrowthChart: add "All" option to year selector (default) showing cumulative growth across all years
- Frontend: add SeenAccuracy type to types/index.ts, update API layers and hooks to support accuracy
- EntrySeenDialog: add Date Accuracy selector (Exact/Estimated/Unknown) with EXACT default
- EpisodeSeenEditDialog: add Date Accuracy selector, updated overrideSubmit signature
- SeasonPage: pass accuracy through bulk mark-all-watched flow
2026-04-20 01:24:55 +01:00
Mohammed Abad ebdef6ba6c **DB Models Changes**
- Backend: add accuracy field (ENUM: EXACT, ESTIMATED, UNKNOWN) to EntrySeen and EpisodeSeen models
- Backend: add migration in dataInitializer to add accuracy column, set existing to EXACT, set 2021-01-01 entry seens and 2020-01-01 episode seens to UNKNOWN
2026-04-20 01:24:19 +01:00
Mohammed Abad 9a8ee181e5 Complete frontend refactoring: UI enhancements, pagination, filtering, search architecture, and data management improvements
# Phase 1: Feature Implementation
- Add "Create new..." option in `AddEntryToCollectionDialog` for inline collection creation with auto-select
- Implement lazy loading pagination with IntersectionObserver for Watchlist, Collections, and Media pages
- Add reusable useDebounce hook (300-400ms) and apply to all search inputs across pages
- Reset scroll position to top when switching between sidebar navigation pages via useLocation()
- Reorganize MediaPage with horizontal control layout, add Media Type filter (All/Audio/Video), and Custom Media filter (Show All/Official Only/Custom Only)
- Add three-dot menu (MoreHorizontal icon) to collection cards with Edit/Delete options and "Get all parts" feature
- Replace numeric rating input with interactive star rating component in EditCollectionDialog (0-10 stars with half-star support)
- Display entry type badges ("Movie" / "TV Series") on home page trending/popular sections and search results
- Create PeopleSearchResult component with profile images; integrate useTmdbSearchPeople hook linking to `/people/tmdb/:tmdbId`
- Add TMDB Rating and User Rating filters to Library page with range sliders (0-10, step 1) and state persistence in useLibraryStore
- Add All/Movies/TV Series type filter to Watchlist page with filtered count display
- Improve People Details page mobile UI: optimize header, info section sizing, and filmography card layouts for touch

# Phase 2: Architecture Refactoring & Bug Fixes
- Fix scroll-to-top on sidebar navigation by constraining AppLayout root to `h-screen overflow-hidden` so `<main>` becomes proper scroll container
- Extract search from HomePage into dedicated SearchPage component with `/search` route, debounced input, and URL query sync via SearchParams
- Add Search nav item with icon to sidebar for easy search access
- HomePage search input now navigates to `/search?q=...` instead of handling inline, separating concerns and enabling search bookmarking
- Entry type pill badges now conditionally render via `showTypeBadge` prop on EntryCard—only SearchPage passes this to prevent display on home/discover pages
- Fix people ID bug: people search results now link to `/people/tmdb/:tmdbId` (TMDB redirect route) instead of `/people/:id`, correctly mapping TMDB IDs to local database IDs through PersonTmdbRedirectPage
- Enhance People Details filmography sorting: "Not in Library" section now detects self roles (self/themselves/himself/herself) and sorts non-self by release date (new→old) with all self roles pushed to end of list

# Summary
- Created new files: SearchPage.tsx, useDebounce.ts
2026-04-12 01:33:00 +01:00
Mohammed Abad d28b4caa7e docs(react_frontend): add comprehensive documentation & AGENTS.md
- docs/README.md: overview and table of contents
- docs/tech_stack.md: full dependency inventory and design decisions
- docs/project_structure.md: directory tree with conventions
- docs/architecture.md: data flow, layer responsibilities, key patterns
- docs/routing.md: route table, code splitting, discover categories
- docs/state_management.md: Zustand stores and React Query conventions
- docs/api_layer.md: all API modules with endpoint mappings
- docs/components.md: layout, entries, collections, charts, dialogs, UI primitives
- docs/pages.md: all 16 pages with features and routes
- docs/styling.md: theming, CSS tokens, responsive breakpoints, animations
- AGENTS.md: architecture summary, code conventions, data flow, key files
2026-04-10 02:44:06 +01:00
Mohammed Abad 6bff2055b4 fix: season episode dialog, mark season watched, episode 404 handling
Seasons Page:
- Episode watch button now opens EpisodeSeenEditDialog instead of
  directly marking as watched, allowing date/seen-with input
- Added "Mark Season as Watched" button that sequentially marks all
  unwatched episodes in the season

Episode Page:
- Fixed UI not updating after deleting the last episode seen record;
  the backend returns 404 when no records exist for an episode, which
  caused the query to error instead of resolving to an empty array.
  The API layer now catches 404 and returns [] gracefully.
2026-04-03 17:49:16 +01:00
Mohammed Abad 984e2c8b50 feat(dashboard): enhance charts with improved data handling and user interaction 2026-04-03 02:48:03 +01:00
Mohammed Abad fac8ba1d19 fixed Library Slider 2026-04-02 03:39:49 +01:00
Mohammed Abad ab20a5e64f 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
2026-04-02 03:29:54 +01:00
Mohammed Abad d60d142d17 feat(react): add toasts, loading states, skeletons, animations, and mobile responsiveness
- Toast notifications (sonner): success/error toasts on all mutations
- Loading spinners: EntryCard add/remove, ConfirmDialog, EntrySeenDialog, favorite/refresh buttons
- Page skeletons: 13 page-specific Suspense fallbacks replacing generic skeleton
- CSS animations: card-enter (staggered), page-enter, slide-up-fade keyframes
- Mobile layout: hamburger menu with sheet sidebar, responsive entry details
- Mobile controls: separate compact filter/sort popovers for Library and Watchlist
- Desktop sort: popover menu replacing Select dropdown on Library and Watchlist
- Filter ranges: year 1950-2100, rating 0-10
2026-04-02 03:00:49 +01:00
Mohammed Abad ae67663623 feat(dashboard): add recharts data visualizations
- Install recharts
- Add WatchActivityChart (AreaChart, movies + episodes/month, year filter)
- Add WatchTimeChart (stacked BarChart, hours/month, synced year filter)
- Add RatingsChart (BarChart, user ratings distribution 1–10, color ramp)
- Add TopGenresChart (horizontal BarChart, top 10 genres, type filter)
- Add CouchDayChart (BarChart, watch count by weekday, peak day highlight)
- Add GET /statistics/watch-weekday backend endpoint (DAYOFWEEK aggregation)
- Extend statisticsApi with getYearlyWatchCount, getYearlyWatchTime, getWatchdayDistribution
- Add useYearlyWatchCount, useYearlyWatchTime, useWatchdayDistribution hooks
- Wire all charts into DashboardPage with responsive two-column grid layout
2026-04-01 16:04:43 +01:00
Mohammed Abad 3648c41cfd fix(frontend): clean up imports and remove unused createEpisodeSeen hook 2026-04-01 01:06:01 +01:00
Mohammed Abad 191f4d6aae fix(frontend): calendar thumbnail, episode delete confirm, mark-as-watched dialog
- CalendarPage: restore poster/still thumbnail (h-8 w-5) in episode items;
  add getTmdbPosterUrl import; extend EpisodeWithEntry type with poster_path
- EpisodeSeenEditDialog: add mode 'create'|'edit' support; record prop is now
  optional; create mode uses useCreateEpisodeSeen with today as default date
- EpisodePage: Mark as Watched button now opens EpisodeSeenEditDialog (create
  mode) instead of firing mutation directly; delete shows ConfirmDialog before
  deleting; remove unused useCreateEpisodeSeen import
2026-04-01 00:59:09 +01:00
Mohammed Abad 3ca24434d7 feat(frontend): Entry details redesign, people filmography, calendar improvements
- EntryDetailsPage: sticky poster layout, centered max-w-4xl, director by-line
  with link, rating pills (IMDb/TMDB/You), quick actions under poster, RatingDialog
  with star UI, In Collections section using backdrops, EntrySettingsDialog with
  show_in_calendar / auto_sync / rating options
- RatingDialog: new component with 10-star interactive rating
- AddEntryToCollectionDialog: optimistic cache updates so checkbox state reflects
  immediately and In Collections section on entry details page refreshes
- PersonDetailsPage: filmography section showing library vs. non-library entries
  via person.roles, TMDB combined credits for non-library titles
- PersonTmdbRedirectPage: new redirect page for TMDB person IDs to local person ID
- PeoplePage: fix person card links to use /people/tmdb/:tmdbId
- CalendarPage: full-height layout, larger episode thumbnails, episode items
  clickable, improved tooltip, show_in_calendar backend filter
- Fix useUpdateEntry to also invalidate entryKeys.all (favorite button reactivity)
- Fix updateRatings API body wrapping
- Add useUpdateEntryRatings, usePersonCredits, useFetchPersonByTmdbId hooks
- Add getCollectionBackdropUrl to media-utils
- Types: show_in_calendar, auto_sync on Entry; id on EntryRatings; roles on People
- Backend: fix fetchPersonData alias in peopleService; remove duplicate
  getPersonCredits; add show_in_calendar filter to episodeService
2026-04-01 00:25:30 +01:00
Mohammed Abad 11eab03987 Backend:
- Enhance PeopleController with person credits and TMDB filmography endpoints;
- update episodeService to filter entries by showInCalendar;
- add fetchPersonCombinedCredits function in tmdbService
2026-04-01 00:07:41 +01:00
Mohammed Abad ffe7e52527 Implemented the new react version of the frontend 2026-03-31 01:56:38 +01:00
Mohammed Abad 236e6e06fb Backend: Add TMDB proxy routes and service methods for trending, popular, and search functionalities 2026-03-30 23:33:29 +01:00
Mohammed Abad 35835e9187 Created the react frontend project and added some basic component 2026-03-30 20:56:59 +01:00
Mohammed Abad b3ab69cc22 Backend: Added docs & AGENTS.md 2026-03-30 19:37:08 +01:00