From 58b25600517d5fe0d500eaa5a6b9f958e7f0442f Mon Sep 17 00:00:00 2001 From: "Adam R. Grey" Date: Thu, 7 Oct 2021 08:51:52 -0400 Subject: [PATCH] yt handler theoretically works --- Program.cs | 8 +++++--- showHandlers/YoutubeHandler.cs | 6 +++--- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/Program.cs b/Program.cs index 2c615ce..964b2f9 100644 --- a/Program.cs +++ b/Program.cs @@ -24,7 +24,7 @@ namespace director private static HttpClient httpClient; private static readonly ConcurrentQueue workQueue = new ConcurrentQueue(); private static readonly AutoResetEvent _signal = new AutoResetEvent(false); - private const int concurrentWorkers = 2; + private const int concurrentWorkers = 5; static void Main(string[] args) { if (!File.Exists("appsettings.json")) @@ -97,11 +97,13 @@ namespace director } Console.WriteLine("calendars checked"); #if (DEBUG) - for (int i = 0; i < 0; i++) + //if(true) { + Console.WriteLine("debug test"); + var psuedo = new Schedulable.Schedulable(); psuedo.Showtime = DateTime.Now + TimeSpan.FromSeconds(30); - var partiallyCopiable = scratch.agenda?.FirstOrDefault(s => s.ScedulableType == Schedulable.ScedulableType.YTRelease); + var partiallyCopiable = scratch.agenda?.FirstOrDefault(s => s.ScedulableType == Schedulable.ScedulableType.TwitchStream); psuedo.Occurrence = partiallyCopiable.Occurrence; psuedo.Occurrence.OccurrenceStart = psuedo.Showtime; psuedo.Occurrence.OccurrenceEnd = psuedo.Showtime; diff --git a/showHandlers/YoutubeHandler.cs b/showHandlers/YoutubeHandler.cs index 60cf723..58a15a8 100644 --- a/showHandlers/YoutubeHandler.cs +++ b/showHandlers/YoutubeHandler.cs @@ -23,7 +23,7 @@ namespace ShowHandlers public override void Handle(iCalHoopJumping.CalendarOccurrence evt) { Console.WriteLine($"begin youtube handler. current time {DateTime.Now.ToLongTimeString()}"); - Console.WriteLine(JsonConvert.SerializeObject(evt)); + //Console.WriteLine(JsonConvert.SerializeObject(evt)); Task.Run(() => PreShow(evt)); Console.WriteLine("kicked off the pre-show"); if (evt.OccurrenceStart > DateTime.Now) @@ -52,7 +52,7 @@ namespace ShowHandlers agentsPresent.Clear(); Telefranz.Instance.addHandler(agentReports); -// Telefranz.Instance.ProduceMessage(new silver_messages.global.sound_off()); + Telefranz.Instance.ProduceMessage(new silver_messages.global.sound_off()); while (AgentsNeeded.Where(ap => !agentsPresent.Contains(ap))?.Count() > 0) { checkSignal.WaitOne(TimeSpan.FromSeconds(15)); @@ -78,7 +78,7 @@ namespace ShowHandlers issueChecks(); while (metadataUnset(metadataSoFar)) { - //checkSignal.WaitOne(TimeSpan.FromHours(6)); + //checkSignal.WaitOne(TimeSpan.FromHours(6)); //so bother me every 6 hours before yt release time if metadata isn't ready checkSignal.WaitOne(TimeSpan.FromSeconds(15)); if (DateTime.Now > evt.OccurrenceStart - leadNeeded) {