Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,6 @@

# Default output folder for desktop runs
/output

# macOS Finder
.DS_Store
2 changes: 2 additions & 0 deletions .vale/styles/config/vocabularies/WarmupRs/accept.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,7 @@ Docker
codegen
toolchain
passthrough
[Ff]anart
zsh
opkg
Entware
3 changes: 3 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 5 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ tokio = { version = "1.41", features = ["rt-multi-thread", "macros", "signal", "
reqwest = { version = "0.12", default-features = false, features = ["rustls-tls", "json", "gzip", "http2"] }
rusqlite = { version = "0.32", features = ["bundled"] }
serde = { version = "1", features = ["derive"] }
serde_json = "1"
serde_json = { version = "1", features = ["preserve_order"] }
flate2 = "1"
clap = { version = "4", features = ["derive", "env"] }
anyhow = "1"
thiserror = "1"
Expand All @@ -24,6 +25,9 @@ fs2 = "0.4"
futures = "0.3"
tokio-util = { version = "0.7", features = ["rt"] }

[target.'cfg(target_os = "macos")'.dependencies]
libc = "0.2"

[dev-dependencies]
tempfile = "3"

Expand Down
4 changes: 4 additions & 0 deletions Justfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ default:
test *args:
cargo test {{args}}

# Runs the tests that call TMDB. Needs TMDB_API_KEY.
test-live:
cargo test --test live_tmdb -- --ignored

# Formats the Rust code with rustfmt.
fmt:
cargo fmt --all
Expand Down
21 changes: 16 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ add-on by writing directly to SQLite. It doesn't use JSON-RPC, the Python
add-on, or Kodi itself.

1. **`ItemDetails.db`**: TMDBHelper's metadata cache, about 30 tables such as
`movie`, `tvshow`, `person`, `castmember`, `art`, and `ratings`.
`movie`, `tvshow`, `season`, `episode`, `person`, `castmember`, and `art`.
2. **`Textures13.db` and the thumbnails folder**: Kodi's image cache, so the
interface never has to fetch artwork on demand.

Expand All @@ -31,6 +31,11 @@ export WARMUP_TMDB_API_KEY=<your key>
./target/release/warmup-rs --mode=images # image crawl, in a second terminal
```

The key is the v3 **API Key** from **Settings > API** on
[themoviedb.org](https://www.themoviedb.org), and it's the only credential you
need. To keep it out of your shell history, see
[Save the key](https://appz4fun.github.io/tmdbhelper/quick-start.html#save-the-key).

On Windows, macOS, and desktop Linux, everything goes under `./output` in the
current folder:

Expand Down Expand Up @@ -61,8 +66,9 @@ CoreELEC, LibreELEC, or OpenELEC. On an appliance, TMDBHelper must have created

| Mode | What it does |
|------|--------------|
| `metadata` | The default. Crawls TMDB and writes `ItemDetails.db`, starting from TMDB's trending and popular lists and following credits, similar titles, recommendations, filmographies, and collections up to two hops away. |
| `images` | Reads every art path from `ItemDetails.db`, downloads each image from the TMDB image servers, saves it in the images folder, and registers every URL size in `Textures13.db`, so Kodi gets a cache hit at any `imageres` or `fanartres` setting. |
| `metadata` | The default. Crawls TMDB and writes `ItemDetails.db`, starting from TMDB's trending and popular lists and following credits, similar titles, recommendations, filmographies, and collections up to two hops away. It also fetches every season and episode of each show. With `--all-ids`, it queues everything in TMDB's daily ID lists. |
| `images` | Reads every art path from `ItemDetails.db`, downloads each image at `original` size, saves it in the images folder, and registers every URL TMDBHelper can request in `Textures13.db`, so Kodi gets a cache hit at any `artwork_quality` setting. |
| `fanart` | Fetches fanart.tv art for the movies and shows in `ItemDetails.db`. TMDBHelper needs this when its fanart.tv lookup is on, or it ignores those rows. |
| `smoke` | Opens an in-memory SQLite database, builds an HTTP client, and exits. Use it to check that the binary runs on a device. |

Both real modes are restart-safe, and you can run them at the same time. See
Expand All @@ -78,7 +84,12 @@ text.
|------|----------|---------|
| `--mode` | `WARMUP_MODE` | `metadata` |
| `--tmdb-api-key` | `WARMUP_TMDB_API_KEY` | Required in metadata mode |
| `--concurrency` | `WARMUP_CONCURRENCY` | `40` |
| `--fanart-api-key` | `WARMUP_FANART_API_KEY` | Required in fanart mode |
| `--fanart-client-key` | `WARMUP_FANART_CLIENT_KEY` | None |
| `--concurrency` | `WARMUP_CONCURRENCY` | `20` |
| `--language` | `WARMUP_LANGUAGE` | `en-US` |
| `--all-ids` | `WARMUP_ALL_IDS` | Off |
| `--min-free-gb` | `WARMUP_MIN_FREE_GB` | `10` |
| `--batch-size` | `WARMUP_BATCH_SIZE` | `200` |
| `--output-dir` | `WARMUP_OUTPUT_DIR` | `./output`, desktop systems only |
| `--state-db` | `WARMUP_STATE_DB` | Depends on the platform |
Expand All @@ -92,7 +103,7 @@ The [Justfile](Justfile) wraps the usual commands. Run `just` to list them.

| Recipe | What it does |
|--------|--------------|
| `just test`, `just fmt`, `just lint` | Runs the tests, `cargo fmt`, and `cargo fmt --check` plus Clippy. |
| `just test`, `just test-live`, `just fmt`, `just lint` | Runs the offline tests, the tests that call TMDB, `cargo fmt`, and `cargo fmt --check` plus Clippy. |
| `just run`, `just help` | Runs the release build with its defaults, or prints its help. |
| `just build`, `just build-release`, `just build-debug` | Builds for this computer. |
| `just build-release-x86`, `just build-release-arm` | Builds static musl binaries for `x86_64` and `aarch64` Linux with [cross](https://github.com/cross-rs/cross). |
Expand Down
Loading