From d3bdcf9bc4ea9c138fd488c757c6b0ce499c0348 Mon Sep 17 00:00:00 2001 From: Jason Dove <1695733+jasongdove@users.noreply.github.com> Date: Fri, 13 Oct 2023 13:33:10 -0500 Subject: [PATCH] allow plex personal media show libraries (#1483) --- CHANGELOG.md | 1 + ErsatzTV.Infrastructure/Plex/PlexServerApiClient.cs | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ea201ba1b..0fd29806b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - This will help with media server libraries where the URL passed to ffmpeg doesn't indicate which file is streaming - Add QSV Capabilities to Troubleshooting page - Add `language_tag` and `seconds` fields to search index +- Allow synchronizing Plex `TV Show` libraries that use `Personal Media Shows` agent ### Fixed - Fix playout bug that caused some schedule items with fixed start times to be pushed to the next day diff --git a/ErsatzTV.Infrastructure/Plex/PlexServerApiClient.cs b/ErsatzTV.Infrastructure/Plex/PlexServerApiClient.cs index 1859b09a1..ac877189f 100644 --- a/ErsatzTV.Infrastructure/Plex/PlexServerApiClient.cs +++ b/ErsatzTV.Infrastructure/Plex/PlexServerApiClient.cs @@ -52,8 +52,8 @@ public class PlexServerApiClient : IPlexServerApiClient await service.GetLibraries(token.AuthToken).Map(r => r.MediaContainer.Directory); return directory // .Filter(l => l.Hidden == 0) - .Filter(l => (l.Agent ?? string.Empty).ToLowerInvariant() is not "com.plexapp.agents.none") .Filter(l => l.Type.ToLowerInvariant() is "movie" or "show") + .Filter(l => l.Type.ToLowerInvariant() is not "movie" || (l.Agent ?? string.Empty).ToLowerInvariant() is not "com.plexapp.agents.none") .Map(Project) .Somes() .ToList(); @@ -1018,7 +1018,8 @@ public class PlexServerApiClient : IPlexServerApiClient return $"tmdb://{strip2}"; } - if (guid.StartsWith("local://", StringComparison.OrdinalIgnoreCase)) + if (guid.StartsWith("local://", StringComparison.OrdinalIgnoreCase) || + guid.StartsWith("com.plexapp.agents.none://", StringComparison.OrdinalIgnoreCase)) { // _logger.LogDebug("Ignoring local Plex guid: {Guid}", guid); }