Esempio n. 1
0
 private static bool isValid(TvShowInfoProvider someProvider)
 {
     if (string.IsNullOrEmpty(someProvider.getName()))
     {
         return(false);
     }
     return(true);
 }
Esempio n. 2
0
        /// <summary>
        /// Checks the app subfolder for tv show provider configuration files and populates the list with valid configurations
        /// </summary>
        public static void loadAllValidTvShowInfoProviders()
        {
            StringBuilder status = new StringBuilder();

            status.AppendLine("Providers found:");
            foreach (string configFileName in getConfigurationFileNames(TVSHOWINFOPROVIDER_CONFIGURATION_FOLDER))
            {
                log.Debug("Provider: " + configFileName);
                try {
                    TvShowInfoProvider newTvShowInfoProvider = new TvShowInfoProvider(configFileName);
                    if (!isValid(newTvShowInfoProvider))
                    {
                        log.Error("Invalid provider file: " + configFileName);
                        delete(newTvShowInfoProvider);
                        continue;
                    }
                    status.AppendLine(newTvShowInfoProvider.getName());
                } catch (Exception ex) {
                    log.Error("Invalid provider file: " + configFileName + " Error: " + ex.Message);
                }
            }
            log.Info(status.ToString());
        }
 /// <summary>
 /// Checks the app subfolder for tv show provider configuration files and populates the list with valid configurations
 /// </summary>
 public static void loadAllValidTvShowInfoProviders()
 {
     StringBuilder status = new StringBuilder();
     status.AppendLine("Providers found:");
     foreach (string configFileName in getConfigurationFileNames(TVSHOWINFOPROVIDER_CONFIGURATION_FOLDER)) {
         log.Debug("Provider: " + configFileName);
         try {
             TvShowInfoProvider newTvShowInfoProvider = new TvShowInfoProvider(configFileName);
             if (!isValid(newTvShowInfoProvider)) {
                 log.Error("Invalid provider file: " + configFileName);
                 delete(newTvShowInfoProvider);
                 continue;
             }
             status.AppendLine(newTvShowInfoProvider.getName());
         } catch (Exception ex) {
             log.Error("Invalid provider file: " + configFileName + " Error: " + ex.Message);
         }
     }
     log.Info(status.ToString());
 }
 private static bool isValid(TvShowInfoProvider someProvider)
 {
     if (string.IsNullOrEmpty(someProvider.getName())) {
         return false;
     }
     return true;
 }