コード例 #1
0
 public PluginConfiguration()
 {
     Host                         = "127.0.0.1";
     Port                         = "8111";
     Username                     = "******";
     Password                     = "";
     ApiKey                       = "";
     UpdateWatchedStatus          = false;
     UseTvDbSeasonOrdering        = false;
     UseShokoThumbnails           = true;
     HideArtStyleTags             = false;
     HideSourceTags               = false;
     HideMiscTags                 = false;
     HidePlotTags                 = true;
     HideAniDbTags                = true;
     SynopsisCleanLinks           = true;
     SynopsisCleanMiscLines       = true;
     SynopsisRemoveSummary        = true;
     SynopsisCleanMultiEmptyLines = true;
     TitleUseAlternate            = true;
     TitleMainType                = DisplayLanguageType.Default;
     TitleAlternateType           = DisplayLanguageType.Origin;
 }
コード例 #2
0
        public static string GetTitle(IEnumerable <Title> seriesTitles, IEnumerable <Title> episodeTitles, string seriesTitle, string episodeTitle, DisplayLanguageType languageType, DisplayTitleType outputType, string displayLanguage, params string[] originLanguages)
        {
            // Don't process anything if the series titles are not provided.
            if (seriesTitles == null)
            {
                return(null);
            }
            // Guess origin language if not provided.
            if (originLanguages.Length == 0)
            {
                originLanguages = GuessOriginLanguage(seriesTitles);
            }
            switch (languageType)
            {
            // 'Ignore' will always return null, and all other values will also return null.
            default:
            case DisplayLanguageType.Ignore:
                return(null);

            // Let Shoko decide the title.
            case DisplayLanguageType.Default:
                return(__GetTitle(null, null, seriesTitle, episodeTitle, outputType));

            // Display in metadata-preferred language, or fallback to default.
            case DisplayLanguageType.MetadataPreferred:
                var title = __GetTitle(seriesTitles, episodeTitles, seriesTitle, episodeTitle, outputType, displayLanguage);
                if (string.IsNullOrEmpty(title))
                {
                    goto case DisplayLanguageType.Default;
                }
                return(title);

            // Display in origin language without fallback.
            case DisplayLanguageType.Origin:
                return(__GetTitle(seriesTitles, episodeTitles, seriesTitle, episodeTitle, outputType, originLanguages));
            }
        }