# M3U → STRM generator (VOD Movies & Series) for Jellyfin
**Purpose:** Convert your VOD M3Us (with `group-title` / `#EXTGRP`) into **.strm** libraries so Jellyfin treats them like native Movies/TV.

## Host paths (TrueNAS)
- Movies M3U (if not using remote URL): `/mnt/Applications/Apps/m3u-vod-strm/data/movies.m3u`
- Series M3U (if not using remote URL): `/mnt/Applications/Apps/m3u-vod-strm/data/series.m3u`
- Output libraries (mount in Jellyfin as Libraries):
  - Movies → `/mnt/Applications/Apps/m3u-vod-strm/out/Movies`
  - TV → `/mnt/Applications/Apps/m3u-vod-strm/out/TV`

## Structure
- Movies: `/Movies/<PrimaryGenre>/<Title (Year)>/<Title (Year)>.strm` (+ optional `poster.jpg`)
- Series: `/TV/<PrimaryGenre>/<Show Name>/Season 01/<Show Name S01E01>.strm` (poster at show root)

Primary genre = first item in `group-title` or `#EXTGRP:` (semicolon-separated allowed).

## Env vars
- `MOVIES_M3U_URL`, `SERIES_M3U_URL`: Remote sources (optional). Otherwise the local files are used.
- `REFRESH_MINUTES` (default 180).
- `OUTPUT_BASE` (default `/out`).
- `DOWNLOAD_POSTERS` (`true` default).
- `CLEAN_ON_REFRESH` (`true` default) — rebuilds output trees each run.
- `MOVIES_INCLUDE`, `MOVIES_EXCLUDE`, `SERIES_INCLUDE`, `SERIES_EXCLUDE`: Comma-separated **primary** genres to include/exclude.

## Add to Jellyfin
1. Start this compose as a Custom App.
2. In Jellyfin → **Libraries**:
   - Add a **Movies** library pointing to `/mnt/Applications/Apps/m3u-vod-strm/out/Movies`
   - Add a **TV Shows** library pointing to `/mnt/Applications/Apps/m3u-vod-strm/out/TV`
3. Scan the libraries. Jellyfin will show the items normally with posters if available.

## Notes
- Understands provider format with `#EXTINF` + optional `#EXTGRP:` between the `#EXTINF` and the URL.
- If an episode title lacks `SxxEyy`, it is placed in **Season 01** and the filename includes the full title.

