1
0
Fork 0
mirror of https://github.com/Jackett/Jackett synced 2025-02-24 15:21:06 +00:00

Warn user that they are using an old version of Jackett

This commit is contained in:
flightlevel 2018-10-20 21:09:29 +11:00
parent 829347cba2
commit 642f990862

View file

@ -258,6 +258,30 @@ namespace Jackett.Server.Services
logger.Error(e, "Error while checking the username");
}
//Warn user that they are using an old version of Jackett
try
{
string appFolder = configService.ApplicationFolder();
string dllPath = Path.Combine(appFolder, "Jackett.Common.dll");
if (File.Exists(dllPath))
{
DateTime creation = File.GetCreationTime(dllPath);
if (creation < DateTime.Now.AddMonths(-3))
{
string version = configService.GetVersion();
string notice = $"Your version of Jackett v{version} is very old. Multiple indexers are likely to fail when using an old version. Update to the latest version of Jackett.";
_notices.Add(notice);
logger.Error(notice);
}
}
}
catch (Exception e)
{
logger.Error(e, "Error while checking build date of Jackett.Common");
}
CultureInfo.DefaultThreadCurrentCulture = new CultureInfo("en-US");
// Load indexers
indexerService.InitIndexers(configService.GetCardigannDefinitionsFolders());