Files
Showy/docs-vault/Library.md
T

63 lines
1.8 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
- [[Pages#WatchlistPage|WatchlistPage]] — Grid of watchlist entries
- [[Pages#EntryDetailsPage|EntryDetailsPage]] — Entry detail view
## Related
- [[Watch Tracking]] — Marking entries as watched
- [[Collections]] — Grouping entries
- [[Statistics]] — Library analytics