Skip to content

Commit

Permalink
Commit 1.8.3.1
Browse files Browse the repository at this point in the history
  • Loading branch information
garyan2 committed Oct 9, 2024
1 parent 79afa45 commit f1f7c5d
Show file tree
Hide file tree
Showing 10 changed files with 31 additions and 38 deletions.
2 changes: 1 addition & 1 deletion src/GaRyan2.SchedulesDirect/SchedulesDirect.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/GaRyan2.Tmdb/Tmdb.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down
4 changes: 2 additions & 2 deletions src/GaRyan2.Utilities/Helper/TaskScheduler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 1 addition & 0 deletions src/GaRyan2.WmcUtilities/WmcEpg.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
1 change: 1 addition & 0 deletions src/GaRyan2.WmcUtilities/WmcUtilities.cs
Original file line number Diff line number Diff line change
Expand Up @@ -364,6 +364,7 @@ public static bool ReindexDatabase()
bool ret = false;
try
{
_ = ReindexPvrSchedule();
Logger.WriteMessage($"Entering ReindexDatabase()");
var proc = Process.Start(new ProcessStartInfo
{
Expand Down
4 changes: 2 additions & 2 deletions src/SolutionInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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")]
10 changes: 9 additions & 1 deletion src/epg123/sdJson2mxf/lineupServices.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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, string[]>(mxfService, new[] { logoPath, stationLogo.Url }));
Expand Down Expand Up @@ -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;
}

Expand Down
11 changes: 9 additions & 2 deletions src/epg123Client/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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)
{
Expand Down Expand Up @@ -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;
}

Expand Down
6 changes: 5 additions & 1 deletion src/logViewer/frmViewer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
28 changes: 0 additions & 28 deletions src/tokenServer/Tcp/FileServer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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))
{
Expand Down

0 comments on commit f1f7c5d

Please sign in to comment.