Add series info for parent will null order.
This commit is contained in:
parent
845af854bd
commit
1b2ec67726
@ -137,6 +137,7 @@ namespace AudibleUtilities
|
||||
//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, Title = item.TitleWithSubtitle } };
|
||||
items.Add(item);
|
||||
}
|
||||
else if (!item.IsEpisodes)
|
||||
|
||||
@ -109,6 +109,7 @@ namespace LibationWinForms.GridView
|
||||
=> gridEntries.Series().FirstOrDefault(i => matchSeries.Any(s => s.Series.Name == i.Series));
|
||||
public static IEnumerable<SeriesEntry> EmptySeries(this IEnumerable<GridEntry> gridEntries)
|
||||
=> gridEntries.Series().Where(i => i.Children.Count == 0);
|
||||
public static bool IsEpisodeWithSeries(this LibraryBook lb) => lb.Book.ContentType == ContentType.Episode && lb.Book.SeriesLink is not null && lb.Book.SeriesLink.Any();
|
||||
public static bool IsEpisodeChild(this LibraryBook lb) => lb.Book.ContentType == ContentType.Episode && lb.Book.SeriesLink is not null && lb.Book.SeriesLink.Any() && lb.Book.SeriesLink.First().Order is not null;
|
||||
public static bool IsEpisodeParent(this LibraryBook lb) => lb.Book.ContentType == ContentType.Episode && lb.Book.SeriesLink is not null && lb.Book.SeriesLink.Any() && lb.Book.SeriesLink.First().Order is null;
|
||||
}
|
||||
}
|
||||
|
||||
@ -84,7 +84,7 @@ namespace LibationWinForms.GridView
|
||||
{
|
||||
var geList = dbBooks.Where(b => b.Book.ContentType is not ContentType.Episode).Select(b => new LibraryBookEntry(b)).Cast<GridEntry>().ToList();
|
||||
|
||||
var episodes = dbBooks.Where(b => b.IsEpisodeWithSeries()).ToList();
|
||||
var episodes = dbBooks.Where(b => b.IsEpisodeChild()).ToList();
|
||||
|
||||
foreach (var series in episodes.Select(lb => lb.Book.SeriesLink.First()).DistinctBy(s => s.Series))
|
||||
{
|
||||
@ -117,7 +117,7 @@ namespace LibationWinForms.GridView
|
||||
// add new to top
|
||||
if (existingItem is null)
|
||||
{
|
||||
if (libraryBook.IsEpisodeWithSeries())
|
||||
if (libraryBook.IsEpisodeChild())
|
||||
{
|
||||
LibraryBookEntry lbe;
|
||||
//Find the series that libraryBook belongs to, if it exists
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user