feat: two-stage Lidarr discovery + Emby→arr sync tools

Lidarr Discovery (playback_aware_lidarr_discovery.sh):
- Complete rewrite to two-stage pipeline: Stage 1 scores weekly Emby
  plays → top seeds; Stage 2 runs Last.fm getSimilar on seeds → scores
  candidates → adds top 0-5 to Lidarr
- Per-user influence cap (35%) prevents single listener dominating discovery
- Requires 2+ seeds to accept a candidate (single-seed skipped)
- Last.fm similarity limit 10 for tighter, higher-quality candidates
- 30-day reject cooldown history; MAX_ADDS=5 cap enforced
- Root folder fetched from Lidarr API at runtime (no config path)
- Added to WEEKLY_MAINTENANCE_SCRIPTS (uncommented)

Emby→arr sync tools (Tools/):
- emby_to_lidarr_sync.sh: finds Emby music artists not in Lidarr, adds them
  - Dirty tag filter: comma-list, feat./ft., &, vs, " - " patterns skipped
  - Root folder fetched from Lidarr API at runtime
- emby_to_sonarr_sync.sh: finds Emby series not in Sonarr, adds them
  - TVDB ID matching with title fallback
- emby_to_radarr_sync.sh: finds Emby movies not in Radarr, adds them
  - TMDB ID matching with title fallback
- All three: searchForMissing*: false (monitoring only, no searches triggered)
- All three documented in Tools/Manual-Tools.md
This commit is contained in:
Gmer4Lfe
2026-05-19 23:34:32 -04:00
parent b4d2a90568
commit 7ccb7e0e67
6 changed files with 1641 additions and 67 deletions
+101
View File
@@ -8,6 +8,9 @@ making any changes.
## ━━━ CONTENTS ━━━
- [emby_to_lidarr_sync.sh](#emby_to_lidarr_syncsh)
- [emby_to_sonarr_sync.sh](#emby_to_sonarr_syncsh)
- [emby_to_radarr_sync.sh](#emby_to_radarr_syncsh)
- [failover_state_reset.sh](#failover_state_resetsh)
- [watchdog_skip_list_manager.sh](#watchdog_skip_list_managersh)
- [bulk_permissions_repair.sh](#bulk_permissions_repairsh)
@@ -21,6 +24,104 @@ making any changes.
---
## emby_to_lidarr_sync.sh
One-shot bootstrap tool. Scans Emby play history, finds artists you've actually
listened to that are not yet tracked in Lidarr, and adds them. No scoring — if
it was played, Lidarr should monitor it. Not scheduled; run manually when you
want to close the gap between what's in your library and what Lidarr watches.
### When to Use
- After initial Lidarr setup — bring it in line with existing listening history
- After a Lidarr database wipe or migration
- Any time you suspect artists you listen to are slipping through unmonitored
### Usage
```bash
# See what would be added (no changes)
bash Tools/emby_to_lidarr_sync.sh --dry-run
# Limit to recent plays only
bash Tools/emby_to_lidarr_sync.sh --dry-run --days 30
# Run for real
bash Tools/emby_to_lidarr_sync.sh
```
### Notes
- Reads completions from the Emby activity log (`has finished playing` events)
- Filters out VA, Various Artists, and other metadata placeholders
- Uses `searchForMissingAlbums: false` — adds monitoring without triggering a
full album search; run Lidarr's own missing-album search afterwards if desired
- Activity log has a finite history; use `--days N` if the log has been pruned
---
## emby_to_sonarr_sync.sh
One-shot bootstrap tool. Finds TV series present in Emby that are not tracked in
Sonarr and adds them. Uses TVDB ID matching when available (more reliable than
title matching), falling back to case-insensitive title comparison.
### When to Use
- After initial Sonarr setup — bring it in line with your existing library
- After a Sonarr database wipe or migration
- Any time series you own are slipping through unmonitored
### Usage
```bash
# See what would be added (no changes)
bash Tools/emby_to_sonarr_sync.sh --dry-run
# Run for real
bash Tools/emby_to_sonarr_sync.sh
```
### Notes
- Uses `searchForMissingEpisodes: false` — adds monitoring without triggering
episode searches; Sonarr's library scan will pick up existing files
- Adds to the first accessible root folder in Sonarr (`/tv` by default)
- TVDB ID match preferred over title; title fallback handles edge cases
---
## emby_to_radarr_sync.sh
One-shot bootstrap tool. Finds movies present in Emby that are not tracked in
Radarr and adds them. Uses TMDB ID matching when available, falling back to
case-insensitive title comparison.
### When to Use
- After initial Radarr setup — bring it in line with your existing library
- After a Radarr database wipe or migration
- Any time movies you own are slipping through unmonitored
### Usage
```bash
# See what would be added (no changes)
bash Tools/emby_to_radarr_sync.sh --dry-run
# Run for real
bash Tools/emby_to_radarr_sync.sh
```
### Notes
- Uses `searchForMovie: false` — adds monitoring without triggering movie
searches; Radarr's library scan will pick up existing files
- Adds to the first accessible root folder in Radarr (`/movies` by default)
- TMDB ID match preferred over title; title fallback handles edge cases
---
## failover_state_reset.sh
Resets the fallback state file to NORMAL and clears all tier flags. State file only —