diff --git a/src/GaRyan2.SchedulesDirect/SchedulesDirect.cs b/src/GaRyan2.SchedulesDirect/SchedulesDirect.cs index 5eaa794..07ae362 100644 --- a/src/GaRyan2.SchedulesDirect/SchedulesDirect.cs +++ b/src/GaRyan2.SchedulesDirect/SchedulesDirect.cs @@ -140,7 +140,7 @@ public static UserStatus GetUserStatus() var expires = ret.Account.Expires - DateTime.UtcNow; if (expires >= TimeSpan.FromDays(7.0)) return ret; Logger.WriteWarning($"Your Schedules Direct account expires in {expires.Days:D2} days {expires.Hours:D2} hours {expires.Minutes:D2} minutes."); - Logger.WriteInformation("*** Renew your Schedules Direct membership at https://schedulesdirect.org. ***"); + Logger.WriteWarning("ACTION: Renew your Schedules Direct membership at https://schedulesdirect.org."); } else Logger.WriteError("Did not receive a response from Schedules Direct for a status request."); return ret; diff --git a/src/GaRyan2.Tmdb/Tmdb.cs b/src/GaRyan2.Tmdb/Tmdb.cs index 0c40172..4647f9e 100644 --- a/src/GaRyan2.Tmdb/Tmdb.cs +++ b/src/GaRyan2.Tmdb/Tmdb.cs @@ -28,7 +28,7 @@ public static void Initialize(string userAgent, string size) public static string FindPosterArtwork(string title, int year, string lang = "en") { var movie = api.SearchMovieCatalog(title, year, lang); - if (movie == null || api.Config == null) return null; + if (string.IsNullOrEmpty(movie?.PosterPath) || api.Config == null) return null; if (PosterWidth == 0) { diff --git a/src/GaRyan2.Utilities/Helper/TaskScheduler.cs b/src/GaRyan2.Utilities/Helper/TaskScheduler.cs index 81aa70b..addf5ea 100644 --- a/src/GaRyan2.Utilities/Helper/TaskScheduler.cs +++ b/src/GaRyan2.Utilities/Helper/TaskScheduler.cs @@ -103,8 +103,8 @@ public bool CreateTask(bool wakeToRun, string startTime, TaskActions[] tActions) taskDefinition.Settings.DisallowStartIfOnBatteries = false; taskDefinition.Settings.ExecutionTimeLimit = "PT23H"; taskDefinition.Settings.Priority = 6; - taskDefinition.Settings.RestartCount = 5; - taskDefinition.Settings.RestartInterval = "PT30M"; + //taskDefinition.Settings.RestartCount = 5; + //taskDefinition.Settings.RestartInterval = "PT30M"; taskDefinition.Settings.StartWhenAvailable = true; taskDefinition.Settings.StopIfGoingOnBatteries = false; taskDefinition.Settings.WakeToRun = wakeToRun; diff --git a/src/GaRyan2.WmcUtilities/WmcEpg.cs b/src/GaRyan2.WmcUtilities/WmcEpg.cs index ec94bc3..b25d247 100644 --- a/src/GaRyan2.WmcUtilities/WmcEpg.cs +++ b/src/GaRyan2.WmcUtilities/WmcEpg.cs @@ -33,6 +33,7 @@ public static void AutoMapChannels(bool mapChannels = false) if (mergedChannels.Count == 0) { Logger.WriteError("There are no merged channels in the database to perform any mappings."); + Logger.WriteError("ACTION: Perform WMC TV Setup prior to importing guide listings."); return; } diff --git a/src/GaRyan2.WmcUtilities/WmcUtilities.cs b/src/GaRyan2.WmcUtilities/WmcUtilities.cs index 1958410..9ea0644 100644 --- a/src/GaRyan2.WmcUtilities/WmcUtilities.cs +++ b/src/GaRyan2.WmcUtilities/WmcUtilities.cs @@ -364,6 +364,7 @@ public static bool ReindexDatabase() bool ret = false; try { + _ = ReindexPvrSchedule(); Logger.WriteMessage($"Entering ReindexDatabase()"); var proc = Process.Start(new ProcessStartInfo { diff --git a/src/SolutionInfo.cs b/src/SolutionInfo.cs index baa2354..5aee437 100644 --- a/src/SolutionInfo.cs +++ b/src/SolutionInfo.cs @@ -18,5 +18,5 @@ // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.8.3.0")] -[assembly: AssemblyFileVersion("1.8.3.0")] +[assembly: AssemblyVersion("1.8.3.1")] +[assembly: AssemblyFileVersion("1.8.3.1")] diff --git a/src/epg123/sdJson2mxf/lineupServices.cs b/src/epg123/sdJson2mxf/lineupServices.cs index d534db4..2c2e9f7 100644 --- a/src/epg123/sdJson2mxf/lineupServices.cs +++ b/src/epg123/sdJson2mxf/lineupServices.cs @@ -4,6 +4,7 @@ using System; using System.Collections.Generic; using System.Drawing; +using System.Globalization; using System.IO; using System.Linq; using System.Text.RegularExpressions; @@ -141,6 +142,13 @@ private static bool BuildLineupServices() logoPath = $"{Helper.Epg123LogosFolder}{logoFilename}"; urlLogoPath = $"http://{HostAddress}:{Helper.TcpUdpPort}/logos/{logoFilename}"; + // include refresh of logos in case logo changes but md5 is not changed + var daysInMonth = DateTime.DaysInMonth(DateTime.UtcNow.Year, DateTime.UtcNow.Month); + var bingo = int.Parse(stationLogo.Md5.Substring(stationLogo.Md5.Length - 2), NumberStyles.HexNumber) & 0x1F; + bingo = Math.Max(Math.Min(daysInMonth, bingo), 1); + TimeSpan lastRefresh = DateTime.UtcNow - (new FileInfo(logoPath)?.LastWriteTimeUtc ?? DateTime.MinValue); + if ((bingo == DateTime.UtcNow.Day && lastRefresh.Days > 0) || lastRefresh.Days >= 31) Helper.DeleteFile(logoPath); + if (config.IncludeSdLogos && !File.Exists(logoPath)) { StationLogosToDownload.Add(new KeyValuePair(mxfService, new[] { logoPath, stationLogo.Url })); @@ -269,7 +277,7 @@ private static bool BuildLineupServices() } Logger.WriteError($"There are 0 stations queued for download from {clientLineups.Lineups.Count} subscribed lineups. Exiting."); - Logger.WriteError("Check that lineups are 'INCLUDED' and stations are selected in the EPG123 GUI."); + Logger.WriteError("ACTION: Check that lineups are 'INCLUDED' and stations are selected in the EPG123 Configuration GUI."); return false; } diff --git a/src/epg123Client/Program.cs b/src/epg123Client/Program.cs index d987807..2b1f48e 100644 --- a/src/epg123Client/Program.cs +++ b/src/epg123Client/Program.cs @@ -10,6 +10,8 @@ using System.Linq; using System.Reflection; using System.Runtime.InteropServices; +using System.Security.AccessControl; +using System.Security.Principal; using System.Threading; using System.Windows.Forms; @@ -223,7 +225,11 @@ private static int Main(string[] args) proc?.WaitForExit(); return 0; case "-storage": - using (var mutex = new Mutex(true, "Global\\EPG123Indexing", out bool createdNew)) + var security = new MutexSecurity(); + var role = new MutexAccessRule(new SecurityIdentifier(WellKnownSidType.WorldSid, null), MutexRights.FullControl, AccessControlType.Allow); + security.AddAccessRule(role); + + using (var mutex = new Mutex(true, "Global\\EPG123Indexing", out bool createdNew, security)) { if (!createdNew) { @@ -570,7 +576,8 @@ public static bool ImportMxfFile(string file) if (deviceCount == 0) { - Logger.WriteError("There are no devices/tuners configured in the database store. Perform WMC TV Setup prior to importing guide listings. Aborting Import."); + Logger.WriteError("There are no devices/tuners configured in the database store. Aborting Import."); + Logger.WriteError("ACTION: Perform WMC TV Setup prior to importing guide listings."); return false; } diff --git a/src/logViewer/frmViewer.cs b/src/logViewer/frmViewer.cs index 28699da..94fda2a 100644 --- a/src/logViewer/frmViewer.cs +++ b/src/logViewer/frmViewer.cs @@ -121,7 +121,11 @@ private void DisplayLogFile(string logFile) private void AddLineOfText(string line) { richTextBox1.SelectionStart = richTextBox1.TextLength; - if (line.Contains("[ERROR]")) + if (line.Contains("ACTION:")) + { + richTextBox1.SelectionColor = Color.Orange; + } + else if (line.Contains("[ERROR]")) { richTextBox1.SelectionColor = Color.Red; } diff --git a/src/tokenServer/Tcp/FileServer.cs b/src/tokenServer/Tcp/FileServer.cs index e72de1d..c374dca 100644 --- a/src/tokenServer/Tcp/FileServer.cs +++ b/src/tokenServer/Tcp/FileServer.cs @@ -284,34 +284,6 @@ private void ProcessRequest(HttpListenerContext context) } } break; - case "/output/stirrtv.m3u": // Stirr provides 24 hours of guide listings - if (!File.Exists(Helper.StirrTvExePath)) break; - filepath = Helper.StirrTvM3uPath; - contentType = "text/plain"; - lock (_stirrLock) - { - var fi = new FileInfo(filepath); - if (fi.LastWriteTimeUtc < DateTime.UtcNow - TimeSpan.FromHours(1)) - { - Logger.WriteInformation($"Stirr update triggered by {context.Request.RemoteEndPoint} (UserAgent: {context.Request.UserAgent})."); - Process.Start(Helper.StirrTvExePath).WaitForExit(); - } - } - break; - case "/output/stirrtv.xmltv": // Stirr provides 24 hours of guide listings - if (!File.Exists(Helper.StirrTvExePath)) break; - filepath = Helper.StirrTvXmltvPath; - contentType = "text/xml"; - lock (_stirrLock) - { - var fi = new FileInfo(filepath); - if (fi.LastWriteTimeUtc < DateTime.UtcNow - TimeSpan.FromHours(1)) - { - Logger.WriteInformation($"Stirr update triggered by {context.Request.RemoteEndPoint} (UserAgent: {context.Request.UserAgent})."); - Process.Start(Helper.StirrTvExePath).WaitForExit(); - } - } - break; } if (filepath == null || !File.Exists(filepath)) {