Exemplo n.º 1
0
        public static string GetYears(this MovieSeries movieSeries)
        {
            int startYear = movieSeries.GetStartYear();
            int endYear   = movieSeries.GetEndYear();

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

            return(firstEntry != null
                ? firstEntry.Movie?.GetActiveColor() ?? firstEntry.Series !.GetActiveColor()
                : String.Empty);
        }
Exemplo n.º 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);
        }
Exemplo n.º 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);
        }
Exemplo n.º 7
0
 public static bool IsStrictDescendantOf(this MovieSeries?movieSeries, MovieSeries potentialAncestor)
 => movieSeries != potentialAncestor && movieSeries.IsDescendantOf(potentialAncestor);
Exemplo n.º 8
0
 public static bool IsDescendantOf(this MovieSeries?movieSeries, MovieSeries potentialAncestor)
 => movieSeries != null &&
 (movieSeries.Id == potentialAncestor.Id ||
  (movieSeries.Entry?.ParentSeries.IsDescendantOf(potentialAncestor) ?? false));
Exemplo n.º 9
0
 public static MovieSeries GetRootSeries(this MovieSeries movieSeries)
 => movieSeries.Entry == null ? movieSeries : movieSeries.Entry.ParentSeries.GetRootSeries();
Exemplo n.º 10
0
 public static Title?GetListTitle(this MovieSeries movieSeries)
 => movieSeries.ShowTitles ? movieSeries.Title ! : movieSeries.GetFirstEntry()?.GetTitle();
Exemplo n.º 11
0
 public static Title?GetTitle(this MovieSeries movieSeries)
 => movieSeries.Titles.Count > 0 ? movieSeries.Title ! : movieSeries.GetFirstEntry()?.GetTitle();
Exemplo n.º 12
0
 public static (MovieSeries, MovieSeries) GetDistinctAncestors(this MovieSeries series1, MovieSeries series2)
 => series1.GetAllAncestors()