コード例 #1
0
        private void RecreateSaved()
        {
            LOGGER.Debug($"Recreating cache of saved categories");
            Saved = new YoutubeCategoryContainer();
            foreach (var category in Container.RegisteredCategories)
            {
                LOGGER.Debug($"Recreating cache for path '{category.Title}'");
                var newCategory = new YoutubeCategory(category.Id, category.Title);

                Saved.RegisterCategory(newCategory);
            }
        }
コード例 #2
0
 public Template(int id, string name, YoutubeLanguage defaultlanguage, YoutubeCategory category, IList <PublishTime> publishTimes)
 {
     Id                = id;
     Name              = name;
     Privacy           = PrivacyStatus.Private;
     Title             = string.Empty;
     Description       = string.Empty;
     Tags              = string.Empty;
     NotifySubscribers = true;
     License           = License.Youtube;
     DefaultLanguage   = defaultlanguage;
     Category          = category;
     PublishTimes      = publishTimes.Select(pt => (IPublishTime)pt).ToList();
     PlannedVideos     = new List <IPlannedVideo>();
 }
コード例 #3
0
        private void EnsureStandardTemplateExists()
        {
            if (!Container.RegisteredTemplates.Any(t => t.Id == 0))
            {
                LOGGER.Warn($"There is no standard template, creating one");

                var language = new YoutubeLanguage()
                {
                    Hl   = "de",
                    Id   = "de",
                    Name = "Deutsch"
                };

                var category = new YoutubeCategory(20, "Gaming");

                var standardTemplate = new Template(0, "Standard", language, category, new List <IPublishTime>(), new List <IPlannedVideo>());
                Container.RegisterTemplate(standardTemplate);

                LOGGER.Info($"Standard template was created successfully");
            }
        }