Пример #1
0
        private Preferences GetPreferences()
        {
            var prefs = PluginUtils.GetPreferences(AssemblyInfo, () => new Preferences());

            prefs.Movies.Directory  = UpgradeSyntax(prefs.Movies.Directory);
            prefs.Movies.FileName   = UpgradeSyntax(prefs.Movies.FileName);
            prefs.TVShows.Directory = UpgradeSyntax(prefs.TVShows.Directory);
            prefs.TVShows.FileName  = UpgradeSyntax(prefs.TVShows.FileName);
            return(prefs);
        }
Пример #2
0
        /// <summary>
        /// Attempts to load the user's preferences file from disk if it exists,
        /// otherwise returns the default set of preferences.
        /// </summary>
        /// <returns></returns>
        private TmdbPreferences LoadPreferences()
        {
            var prefs = PluginUtils.GetPreferences(AssemblyInfo, () => new TmdbPreferences());

            // Use our default API key if the user has not specified their own
            if (string.IsNullOrWhiteSpace(prefs.ApiKey))
            {
                prefs.ApiKey = new TmdbPreferences().ApiKey;
            }

            _searchISO_639_1 = prefs.DefaultLanguage;
            _apiKey          = prefs.ApiKey;

            return(prefs);
        }
Пример #3
0
        public void GetMetadata(CancellationToken cancellationToken, Job job)
        {
            var raw     = job.Disc.Metadata.Raw;
            var derived = job.Disc.Metadata.Derived;

            var token = new ProgressToken(Host, this, cancellationToken);
            var prefs = PluginUtils.GetPreferences(AssemblyInfo, () => new IsanPreferences());

            if (raw.V_ISAN != null && prefs.TryPopulate(raw.V_ISAN))
            {
                return;
            }

            Lookup(token, raw, derived);

            if (raw.V_ISAN != null)
            {
                prefs.Store(raw.V_ISAN);
                PluginUtils.SavePreferences(AssemblyInfo, prefs);
            }
        }
Пример #4
0
 private Preferences GetPreferences()
 {
     return(PluginUtils.GetPreferences(AssemblyInfo, () => new Preferences()));
 }