- 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
49 lines
2.0 KiB
Markdown
49 lines
2.0 KiB
Markdown
---
|
|
title: Artwork
|
|
tags:
|
|
- feature
|
|
- media
|
|
- tmdb
|
|
---
|
|
|
|
# Artwork
|
|
|
|
## Overview
|
|
|
|
The **Artwork** section at the bottom of [[Pages#EntryDetailsPage|EntryDetailsPage]] lists every TMDB poster, backdrop and logo for the title, merged with the entry's [[Media System|media table]].
|
|
|
|
## UI
|
|
|
|
- Tabs: **Posters / Backdrops / Logos** with counts
|
|
- **Two rows** shown per tab (columns follow the breakpoint); **Show more** adds two rows
|
|
- Language filter (no-text images first, then English, then the original language); **In library** toggle
|
|
- Badges: **In library** / **Selected**; language tag; TMDB vote average on hover
|
|
- Click an image to open it full size
|
|
- Library entries: **Add** downloads the original into the media table; titles not in the library are read-only
|
|
|
|
## Matching
|
|
|
|
Media rows record the TMDB `file_path` they were downloaded from in `media.tmdb_path` (`tmdbPath`). A TMDB image is **in library** when a media row of the same type has that path. Media without a path (custom uploads, images downloaded before the column existed) appear as local-only items first.
|
|
|
|
> [!warning] Older downloads
|
|
> Images downloaded before `tmdb_path` existed can't be matched, so the same TMDB image can be added again. See [[Known Issues]].
|
|
|
|
## Adding
|
|
|
|
`POST /entries/:id/artwork { type, file_path }`:
|
|
|
|
1. Validates the type (`poster` / `backdrop` / `logo`) and path
|
|
2. Returns the existing row if that image is already in the library
|
|
3. Downloads `https://image.tmdb.org/t/p/original{file_path}` into `images/entries/{type}s/`
|
|
4. Creates the media row — **selected** only if no image of that type is selected yet
|
|
5. Generates the preview file
|
|
|
|
## Implementation
|
|
|
|
| Layer | File |
|
|
|---|---|
|
|
| Service | `backend/services/artworkService.js` |
|
|
| Endpoints | `GET /entries/:id/artwork`, `POST /entries/:id/artwork`, `GET /entries/tmdb/artwork/:type/:tmdbId` |
|
|
| Hooks | `useArtwork`, `useAddArtwork` in `react_frontend/src/hooks/useEntries.ts` |
|
|
| Component | `react_frontend/src/components/entries/ArtworkSection.tsx` |
|