Files
Showy/docs-vault/Library.md
X4Lo 229ecef902 Update docs vault and README for recent features
- New notes: History, Artwork
- Rewrite TMDB Integration: single detail request, entry mapper, rate
  limiter, refresh sync, stale-entry refresh, recommendations
- Update pages, routing, API reference, models, database migrations,
  services, components, hooks, API clients, settings, media system,
  library, Electron (Tauri in progress) and known issues
- Rewrite README for the current React/Express stack and setup
2026-11-05 19:55:04 +00:00

64 lines
2.0 KiB
Markdown

---
title: Library
tags:
- feature
- library
- entries
---
# Library
## Overview
The library is the core of Showy — a personal collection of movies and TV series. Entries can be in the **library** (watched/watching) or the **watchlist** (planning to watch).
## Entry Lifecycle
```mermaid
graph LR
TMDB[TMDB Search] --> |Add| Watchlist
Watchlist --> |Mark Watched| Library
TMDB --> |Add to Library| Library
Library --> |Toggle| Watchlist
Library --> |Delete| Gone[Deleted]
```
## Entry States
| Flag | Meaning |
|---|---|
| `watchlist = false` | In library (default) |
| `watchlist = true` | In watchlist |
| `favorit = true` | Favorited |
| `hidden = true` | Hidden from library view |
| `showInCalendar = true` | Episodes appear in [[Calendar]] |
| `autoSync = true` | Auto-refreshed by `SyncSeriesData()` |
## Adding Entries
1. User searches TMDB via [[Search]]
2. Selects a result → `POST /api/v1/entries` with `{ tmdb_id, is_tvserie }`
3. [[Services#EntryManager]] runs the full pipeline:
- TMDB fetch → save entry + IDs + ratings + genres + networks
- TV series: fetch all seasons → all episodes
- Fetch credits → save cast/crew + [[People]] records
- Download media → generate previews
- Fetch collection if applicable
## Library Store
All entries are held in [[Stores|useLibraryStore]] as a `Map<number, Entry>` for O(1) lookups. The store is populated on app startup and kept in sync via optimistic updates on mutations.
## Pages
- [[Pages#LibraryPage|LibraryPage]] — Grid of all library entries (All / Movies / TV tabs + Favorites and Hidden toggles)
- [[Pages#WatchlistPage|WatchlistPage]] — Grid of watchlist entries
- [[Pages#EntryDetailsPage|EntryDetailsPage]] — Entry detail view (also used for titles not in the library)
- [[History]] — Everything watched, by year
## Related
- [[Watch Tracking]] — Marking entries as watched
- [[Collections]] — Grouping entries
- [[Statistics]] — Library analytics