From eca62e8beca91da06bb09116a0cafa5eb6b9973a Mon Sep 17 00:00:00 2001 From: Jason Dove <1695733+jasongdove@users.noreply.github.com> Date: Wed, 15 Jan 2025 21:42:22 -0600 Subject: [PATCH] fix error synchronizing collections from plex server that has zero collections (#1964) --- CHANGELOG.md | 2 ++ ErsatzTV.Infrastructure/Plex/PlexServerApiClient.cs | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5e3e1d63..10535120 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,8 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ## [Unreleased] +### Fixed +- Fix error message about synchronizing Plex collections from a Plex server that has zero collections ## [25.1.0] - 2025-01-10 ### Added diff --git a/ErsatzTV.Infrastructure/Plex/PlexServerApiClient.cs b/ErsatzTV.Infrastructure/Plex/PlexServerApiClient.cs index d032b865..cdaf80e6 100644 --- a/ErsatzTV.Infrastructure/Plex/PlexServerApiClient.cs +++ b/ErsatzTV.Infrastructure/Plex/PlexServerApiClient.cs @@ -348,6 +348,10 @@ public class PlexServerApiClient : IPlexServerApiClient IPlexServerApi xmlService = XmlServiceFor(connection.Uri); int size = await countItems(xmlService).Map(r => r.TotalSize); + if (size == 0) + { + yield break; + } const int PAGE_SIZE = 10;