public static string GetYears(this MovieSeries movieSeries) { int startYear = movieSeries.GetStartYear(); int endYear = movieSeries.GetEndYear(); return(startYear == endYear?startYear.ToString() : $"{startYear}-{endYear}"); }
public static MovieSeriesEntry?GetLastEntry(this MovieSeries movieSeries) { var lastEntry = movieSeries.Entries.OrderByDescending(entry => entry.SequenceNumber).FirstOrDefault(); return(lastEntry != null ? lastEntry.MovieSeries == null ? lastEntry : lastEntry.MovieSeries.GetLastEntry() : null); }
public static MovieSeriesEntry?GetFirstEntry(this MovieSeries movieSeries) { var firstEntry = movieSeries.Entries.OrderBy(entry => entry.SequenceNumber).FirstOrDefault(); return(firstEntry != null ? firstEntry.MovieSeries == null ? firstEntry : firstEntry.MovieSeries.GetFirstEntry() : null); }
public static string GetActiveColor(this MovieSeries movieSeries) { var firstEntry = movieSeries.GetFirstEntry(); return(firstEntry != null ? firstEntry.Movie?.GetActiveColor() ?? firstEntry.Series !.GetActiveColor() : String.Empty); }
public static int GetEndYear(this MovieSeries movieSeries) { var lastEntry = movieSeries.GetLastEntry(); return(lastEntry != null ? lastEntry.Movie?.Year ?? lastEntry.Series?.EndYear ?? lastEntry.MovieSeries !.GetEndYear() : 0); }
public static int GetStartYear(this MovieSeries movieSeries) { var firstEntry = movieSeries.GetFirstEntry(); return(firstEntry != null ? firstEntry.Movie?.Year ?? firstEntry.Series?.StartYear ?? firstEntry.MovieSeries !.GetStartYear() : 0); }
public static bool IsStrictDescendantOf(this MovieSeries?movieSeries, MovieSeries potentialAncestor) => movieSeries != potentialAncestor && movieSeries.IsDescendantOf(potentialAncestor);
public static bool IsDescendantOf(this MovieSeries?movieSeries, MovieSeries potentialAncestor) => movieSeries != null && (movieSeries.Id == potentialAncestor.Id || (movieSeries.Entry?.ParentSeries.IsDescendantOf(potentialAncestor) ?? false));
public static MovieSeries GetRootSeries(this MovieSeries movieSeries) => movieSeries.Entry == null ? movieSeries : movieSeries.Entry.ParentSeries.GetRootSeries();
public static Title?GetListTitle(this MovieSeries movieSeries) => movieSeries.ShowTitles ? movieSeries.Title ! : movieSeries.GetFirstEntry()?.GetTitle();
public static Title?GetTitle(this MovieSeries movieSeries) => movieSeries.Titles.Count > 0 ? movieSeries.Title ! : movieSeries.GetFirstEntry()?.GetTitle();
public static (MovieSeries, MovieSeries) GetDistinctAncestors(this MovieSeries series1, MovieSeries series2) => series1.GetAllAncestors()