예제 #1
0
        public static string GetYears(this MovieSeries movieSeries)
        {
            int startYear = movieSeries.GetStartYear();
            int endYear   = movieSeries.GetEndYear();

            return(startYear == endYear?startYear.ToString() : $"{startYear}-{endYear}");
        }
예제 #2
0
        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);
        }
예제 #3
0
        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);
        }
예제 #4
0
        public static string GetActiveColor(this MovieSeries movieSeries)
        {
            var firstEntry = movieSeries.GetFirstEntry();

            return(firstEntry != null
                ? firstEntry.Movie?.GetActiveColor() ?? firstEntry.Series !.GetActiveColor()
                : String.Empty);
        }
예제 #5
0
        public static int GetEndYear(this MovieSeries movieSeries)
        {
            var lastEntry = movieSeries.GetLastEntry();

            return(lastEntry != null
                ? lastEntry.Movie?.Year ?? lastEntry.Series?.EndYear ?? lastEntry.MovieSeries !.GetEndYear()
                : 0);
        }
예제 #6
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);
        }
예제 #7
0
 public static bool IsStrictDescendantOf(this MovieSeries?movieSeries, MovieSeries potentialAncestor)
 => movieSeries != potentialAncestor && movieSeries.IsDescendantOf(potentialAncestor);
예제 #8
0
 public static bool IsDescendantOf(this MovieSeries?movieSeries, MovieSeries potentialAncestor)
 => movieSeries != null &&
 (movieSeries.Id == potentialAncestor.Id ||
  (movieSeries.Entry?.ParentSeries.IsDescendantOf(potentialAncestor) ?? false));
예제 #9
0
 public static MovieSeries GetRootSeries(this MovieSeries movieSeries)
 => movieSeries.Entry == null ? movieSeries : movieSeries.Entry.ParentSeries.GetRootSeries();
예제 #10
0
 public static Title?GetListTitle(this MovieSeries movieSeries)
 => movieSeries.ShowTitles ? movieSeries.Title ! : movieSeries.GetFirstEntry()?.GetTitle();
예제 #11
0
 public static Title?GetTitle(this MovieSeries movieSeries)
 => movieSeries.Titles.Count > 0 ? movieSeries.Title ! : movieSeries.GetFirstEntry()?.GetTitle();
예제 #12
0
 public static (MovieSeries, MovieSeries) GetDistinctAncestors(this MovieSeries series1, MovieSeries series2)
 => series1.GetAllAncestors()