예제 #1
0
        /// <summary>
        /// Get absolute index number for an episode in a series.
        /// </summary>
        /// <returns>Absolute index.</returns>
        public static int GetAbsoluteIndexNumber(Series series, Episode.AniDB episode)
        {
            int offset = 0;

            switch (episode.Type)
            {
            case "Normal":
                break;

            case "Special":
                offset += series.Sizes.Total.Episodes;
                break;     // goto case "Normal";

            case "ThemeSong":
                offset += series.Sizes.Total?.Specials ?? 0;
                goto case "ThemeSong";

            case "Unknown":
                offset += series.Sizes.Total?.Credits ?? 0;
                goto case "ThemeSong";

            case "Parody":
                offset += series.Sizes.Total?.Others ?? 0;
                goto case "Unknown";

            case "Trailer":
                offset += series.Sizes.Total?.Parodies ?? 0;
                goto case "Parody";
            }
            return(offset + episode.EpisodeNumber);
        }
예제 #2
0
        public static ExtraType?GetExtraType(Episode.AniDB episode)
        {
            switch (episode.Type)
            {
            case "Normal":
                return(null);

            case "ThemeSong":
                return(ExtraType.ThemeVideo);

            case "Trailer":
                return(ExtraType.Trailer);

            case "Special": {
                var title = Helper.GetTitleByLanguages(episode.Titles, "en") ?? "";
                // Interview
                if (title.Contains("interview", System.StringComparison.OrdinalIgnoreCase))
                {
                    return(ExtraType.Interview);
                }
                // Cinema intro/outro
                if (title.StartsWith("cinema ", System.StringComparison.OrdinalIgnoreCase) &&
                    (title.Contains("intro", System.StringComparison.OrdinalIgnoreCase) || title.Contains("outro", System.StringComparison.OrdinalIgnoreCase)))
                {
                    return(ExtraType.Clip);
                }
                return(null);
            }

            default:
                return(null);
            }
        }
예제 #3
0
        private static ExtraType?GetExtraType(Episode.AniDB episode)
        {
            switch (episode.Type)
            {
            case EpisodeType.Normal:
            case EpisodeType.Other:
                return(null);

            case EpisodeType.ThemeSong:
            case EpisodeType.OpeningSong:
            case EpisodeType.EndingSong:
                return(ExtraType.ThemeVideo);

            case EpisodeType.Trailer:
                return(ExtraType.Trailer);

            case EpisodeType.Special: {
                var title = Text.GetTitleByLanguages(episode.Titles, "en") ?? "";
                // Interview
                if (title.Contains("interview", System.StringComparison.OrdinalIgnoreCase))
                {
                    return(ExtraType.Interview);
                }
                // Cinema intro/outro
                if (title.StartsWith("cinema ", System.StringComparison.OrdinalIgnoreCase) &&
                    (title.Contains("intro", System.StringComparison.OrdinalIgnoreCase) || title.Contains("outro", System.StringComparison.OrdinalIgnoreCase)))
                {
                    return(ExtraType.Clip);
                }
                return(null);
            }

            default:
                return(ExtraType.Unknown);
            }
        }