From e67eac92fd8fc1c3960c2e1e97bbe2dc1838b31c Mon Sep 17 00:00:00 2001 From: Robert McRackan Date: Tue, 9 Nov 2021 21:27:44 -0500 Subject: [PATCH] Bug fix for issue #152 : individual episodes were ignored when targeted directly (as opposed to targeting the parent series) --- AppScaffolding/AppScaffolding.csproj | 2 +- AudibleUtilities/ApiExtended.cs | 11 +++++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/AppScaffolding/AppScaffolding.csproj b/AppScaffolding/AppScaffolding.csproj index 86ef1ac1..a30ef065 100644 --- a/AppScaffolding/AppScaffolding.csproj +++ b/AppScaffolding/AppScaffolding.csproj @@ -3,7 +3,7 @@ net5.0 - 6.4.2.2 + 6.4.3.1 diff --git a/AudibleUtilities/ApiExtended.cs b/AudibleUtilities/ApiExtended.cs index 6862407e..84e29508 100644 --- a/AudibleUtilities/ApiExtended.cs +++ b/AudibleUtilities/ApiExtended.cs @@ -166,8 +166,7 @@ namespace AudibleUtilities Serilog.Log.Logger.Information($"{parents.Count} series of shows/podcasts found"); - // remove episode parents. even if the following stuff fails, these will still be removed from the collection. - // also must happen before processing children because children abuses this flag + // remove episode parents. even if the following stuff fails, these will still be removed from the collection items.RemoveAll(i => i.IsEpisodes); if (importEpisodes) @@ -192,6 +191,14 @@ namespace AudibleUtilities { var children = await getEpisodeChildrenAsync(parent); + // actual individual episode, not the parent of a series. + // for now I'm keeping it inside this method since it fits the work flow, incl. importEpisodes logic + if (!children.Any()) + { + results.Add(parent); + continue; + } + foreach (var child in children) { // use parent's 'DateAdded'. DateAdded is just a convenience prop for: PurchaseDate.UtcDateTime