Updated the Obsidian docs-vault
This commit is contained in:
1 parent
72fd77ee01
commit
260282a0e2
36 files changed
+3497
-144
No files matched your search
@@ -0,0 +1,53 @@
|
||||
---
|
||||
title: Import System
|
||||
tags:
|
||||
- backend
|
||||
- import
|
||||
- bulk
|
||||
---
|
||||
|
||||
# Import System
|
||||
|
||||
## Overview
|
||||
|
||||
Bulk import functionality for migrating data into Showy. Self-throttling to respect TMDB rate limits.
|
||||
|
||||
> [!info] File: `backend/services/importerService.js`
|
||||
|
||||
## Endpoints
|
||||
|
||||
See [[API Reference#Import]].
|
||||
|
||||
| Method | Path | Description |
|
||||
|---|---|---|
|
||||
| `POST` | `/api/v1/import/movies` | Bulk import movies |
|
||||
| `POST` | `/api/v1/import/tmdb` | Import by TMDB IDs |
|
||||
| `POST` | `/api/v1/import/episodes-watch-history` | Import episode watch history |
|
||||
|
||||
## Rate Limiting
|
||||
|
||||
The importer self-throttles to stay under TMDB API limits:
|
||||
|
||||
- **Max 35 requests per 10 seconds**
|
||||
- **500ms delay** between each individual request
|
||||
- Each import triggers the full [[Services#EntryManager]] pipeline (TMDB fetch → save → media download)
|
||||
|
||||
## Flows
|
||||
|
||||
### Movie Import
|
||||
|
||||
1. Receives array of movie data
|
||||
2. For each: calls `EntryManager.fetchAndSaveNewEntry(tmdbId, false)`
|
||||
3. Throttled execution with progress tracking
|
||||
|
||||
### TMDB ID Import
|
||||
|
||||
1. Receives array of TMDB IDs + type flags
|
||||
2. For each: calls `EntryManager.fetchAndSaveNewEntry(tmdbId, isTvSeries)`
|
||||
3. Same throttled execution
|
||||
|
||||
### Episode Watch History Import
|
||||
|
||||
1. Receives array of episode watch records
|
||||
2. Creates `EpisodeSeen` records in bulk
|
||||
3. Updates `date_first_seen`/`date_last_seen` on episodes and entries
|
||||
Reference in new issue
Block a user