Change flow
This commit is contained in:
parent
fb247fb33f
commit
d9fbcc615a
@ -131,16 +131,17 @@ namespace AudibleUtilities
|
||||
{
|
||||
if (item.IsEpisodes && importEpisodes)
|
||||
{
|
||||
//Get child episodes asynchronously and await all at the end
|
||||
getChildEpisodesTasks.Add(getChildEpisodesAsync(concurrencySemaphore, item));
|
||||
|
||||
//Helps to distinguish product parrents which have no content
|
||||
//from children which do have content.
|
||||
item.Asin = $"SERIES_{item.Asin}";
|
||||
//Add the parent to the library because it contains the series
|
||||
//description, series rating, and series cover art which differ
|
||||
//from the individual episodes' values.
|
||||
item.Series = new Series[]{ new Series { Asin = item.Asin, Sequence = RelationshipToProduct.Parent, Title = item.TitleWithSubtitle } };
|
||||
//Helps to distinguish product parrents which have no content
|
||||
//from children which do have content.
|
||||
item.Asin = $"PARENT_{item.Asin}";
|
||||
item.Series = new Series[] { new Series { Asin = item.Asin, Sequence = RelationshipToProduct.Parent, Title = item.TitleWithSubtitle } };
|
||||
|
||||
//Get child episodes asynchronously and await all at the end
|
||||
getChildEpisodesTasks.Add(getChildEpisodesAsync(concurrencySemaphore, item));
|
||||
|
||||
items.Add(item);
|
||||
}
|
||||
else if (!item.IsEpisodes)
|
||||
@ -190,6 +191,7 @@ namespace AudibleUtilities
|
||||
//so the parent is its own child.
|
||||
var parentJson = parent.ToJson(parent).ToString();
|
||||
var child = Item.FromJson(parentJson);
|
||||
child.Asin = child.Asin.Replace("SERIES_", "");
|
||||
children.Add(child);
|
||||
}
|
||||
|
||||
|
||||
@ -86,9 +86,9 @@ namespace LibationWinForms.GridView
|
||||
|
||||
var episodes = dbBooks.Where(b => b.IsEpisodeChild()).ToList();
|
||||
|
||||
foreach (var series in episodes.Select(lb => lb.Book.SeriesLink.First()).DistinctBy(s => s.Series))
|
||||
foreach (var series in episodes.SelectMany(lb => lb.Book.SeriesLink).DistinctBy(s => s.Series))
|
||||
{
|
||||
var seriesEntry = new SeriesEntry(series, episodes.Where(lb => lb.Book.SeriesLink.First().Series == series.Book.SeriesLink.First().Series));
|
||||
var seriesEntry = new SeriesEntry(series, episodes.Where(lb => lb.Book.SeriesLink.Any(s => s.Series == series.Series)));
|
||||
|
||||
geList.Add(seriesEntry);
|
||||
geList.AddRange(seriesEntry.Children);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user