18 Commits

Author SHA1 Message Date
bitr8
404e7c865e
fix: TV placeholders leaking into filtered hubs (#503)
PlaceholderDiscovery re-verified TV items via isPlaceholderItem() which
returns false during library-level scans (no Children metadata in Plex
response). The marker file on disk already proves it's an Agregarr-created
placeholder, so trust that instead of re-checking a broken API path.

Also: find S00E00 by episode index not array position, and use async
placeholder detection in the orphan scan for definitive TV identification.

Ref #414

Co-authored-by: bitr8 <bitr8@users.noreply.github.com>
2026-03-17 10:03:53 +13:00
bitr8
d8655cad41
fix(placeholders): handle Plex returning TV seasons as Children.Directory (#491)
Plex returns seasons as Children.Directory (not Children.Metadata)
when using ?includeChildren=1. All placeholder detection code only
checked Children.Metadata, so isPlaceholderItem() always returned
false for TV shows — skipping title fixes and triggering false
cleanup of valid placeholders.

Added Metadata || Directory fallback across all detection paths,
type casts, and getChildrenMetadata() API helper.

Fixes #414

Co-authored-by: bitr8 <bitr8@users.noreply.github.com>
2026-03-03 00:15:31 +13:00
bitr8
87087cbb6c
fix: re-apply placeholder markers during global discovery (#453)
Movie placeholder labels were only re-applied by Coming Soon collections,
so movies in other collection types (Letterboxd, IMDB, Trakt, etc.) could
permanently leak into filtered hubs if the initial label application failed.

TV placeholder title fixes returned false on timeout but the result was
never checked, giving no visibility into failures.

- Re-apply trailer-placeholder label for all movie placeholders during
  global discovery pass
- Log warnings when episode title or movie label application fails
- Track failure counts in discovery summary logs

Relates to #414

Co-authored-by: bitr8 <bitr8@users.noreply.github.com>
2026-02-13 08:40:35 +13:00
Tom Wheeler
596f5596d1 fix(placeholders): fixes placeholders not being added to multiple collections
when a placeholder was detected as already existing, it was not being added to CollectionItems,
therefore not being added to the new collection
2026-01-30 21:31:00 +13:00
bitr8
56432fd273
fix(placeholders): skip date filtering for non-Coming-Soon collections with includeAllReleasedItems (#387)
The date window filtering in enrichWithTMDBReleaseDates() was removing items
before includeAllReleasedItems could preserve them. Now passing skipDateFilter
param to bypass filtering when includeAllReleasedItems is true for non-Coming-Soon
collections.

- Added skipDateFilter param to enrichWithTMDBReleaseDates()
- Skip movie/TV date window filtering when skipDateFilter is true
- Fail-open on TMDB fetch errors when skipDateFilter is true
- PlaceholderCreation passes skipDateFilter based on config

Fixes #336

Co-authored-by: bitr8 <bitr8@users.noreply.github.com>
2026-01-22 14:46:50 +13:00
Tom Wheeler
cdb87f5eb9 fix(metadata): fix incorrect release date for old releases with single modern digital release date
fix #374
2026-01-19 19:06:09 +13:00
Tom Wheeler
f124211bda fix(placeholders): improve date filtering UX/logic for general lists
add "Include all released items" toggle, fix orphaned cleanup to use fixed 7-day grace period, fix
placeholder quick sync deleting tv items, other minor changes

re #336, re #268, re #253, re #307
2026-01-14 23:24:56 +13:00
Tom Wheeler
39c439bb80 feat(placeholders): add option to skip youtube trailer downloads
speeds up sync dramtically at cost of using generic coming soon video instead of trailer
2026-01-14 23:18:15 +13:00
Tom Wheeler
b381e419e6 fix(placeholders): update to new library specific path 2026-01-11 22:31:24 +13:00
bitr8
7c6ff6b030
fix(security): harden API clients and file operations (#300)
- overseerr.ts: Redact credentials in error logs (whitelist headers,
  sanitize URL query params, try/catch stringify with pre-truncation)
- externalapi.ts: Add catch handler to rolling cache background refresh
- animeIds.ts: Add 30s timeout and 50MB size limit with streaming
- MultiSourceOrchestrator.ts: Validate sources array before cycle_lists
- LocalPosterFolderService.ts: Validate poster downloads (size, status, type)
- placeholderManager.ts: Prevent path traversal with realpath validation

Reviewed by Codex - addresses credential leakage, unhandled rejections,
resource exhaustion, division by zero, and directory traversal vectors.

Co-authored-by: bitr8 <bitr8@users.noreply.github.com>
2026-01-11 22:22:38 +13:00
bitr8
5806bbc549
fix(placeholders): handle Jellyfin trickplay directories during cleanup (#340)
* fix: skip directories when cleaning orphaned placeholder files

Jellyfin creates .trickplay directories with the same base name as video
files. The cleanup scan matched these directories because they contain
{edition-Trailer} in the path, then failed with EISDIR when attempting
fs.unlink() on them.

Added a stat check to skip non-file entries during orphaned file cleanup.

* fix: remove trickplay directories when deleting placeholders

When Jellyfin scans placeholder videos, it creates .trickplay directories
for video thumbnail scrubbing. These become orphaned when the placeholder
is deleted.

Now removePlaceholder() cleans up the associated .trickplay directory
using fs.rm() with recursive option.

---------

Co-authored-by: bitr8 <bitr8@users.noreply.github.com>
2026-01-11 22:18:11 +13:00
Tom Wheeler
e2ebf90db4 fix(placeholders): ensure placeholder days ahead is respected for non-coming soon collections
re #253, re #268
2026-01-05 23:16:36 +13:00
Tom Wheeler
9788b43fe6 chore(placeholders): fix form validation for placeholder root folders 2026-01-05 23:16:33 +13:00
Tom Wheeler
fecdfb8bba feat(placeholders): placeholder folders can now be created per-library
changes from global movie/tv root folders to per-library, including migration

fix #251, fix #252
2026-01-05 01:54:33 +13:00
Tom Wheeler
9395447089 fix(placeholders): ensure movie placeholder parent folders are deleted on cleanup 2026-01-04 15:52:41 +13:00
Tom Wheeler
af701fc045 fix(placeholders): add check for plex poster, apply TMDB poster if not present 2026-01-04 14:05:18 +13:00
Tom Wheeler
c30692ce0c fix(placeholders): fixes Days Ahead not being respected
fix #253, fix #268
2026-01-02 13:48:20 +13:00
Tom Wheeler
4900554cc1 fix(placeholders): extract placeholder functions, refactor sources, overlays fixes
extracts PlaceholderServices.ts functions into separate files, adds youtube cookies support.
refactor backend services into more logical structure. overlays fixes including episode titles,
other minor fixes
2025-12-23 23:31:27 +13:00