mirror of
https://github.com/Readarr/Readarr
synced 2025-12-15 04:46:13 +01:00
New: Various Healthcheck enhancements
Various pulls from Radarr; Completed at the file - not commit - level
This commit is contained in:
parent
c5787b0c87
commit
24e2ff56dd
32 changed files with 201 additions and 97 deletions
|
|
@ -1,6 +1,8 @@
|
|||
using NUnit.Framework;
|
||||
using Moq;
|
||||
using NUnit.Framework;
|
||||
using NzbDrone.Common.EnvironmentInfo;
|
||||
using NzbDrone.Core.HealthCheck.Checks;
|
||||
using NzbDrone.Core.Localization;
|
||||
using NzbDrone.Core.Test.Framework;
|
||||
using NzbDrone.Test.Common;
|
||||
|
||||
|
|
@ -9,6 +11,14 @@ namespace NzbDrone.Core.Test.HealthCheck.Checks
|
|||
[TestFixture]
|
||||
public class AppDataLocationFixture : CoreTest<AppDataLocationCheck>
|
||||
{
|
||||
[SetUp]
|
||||
public void Setup()
|
||||
{
|
||||
Mocker.GetMock<ILocalizationService>()
|
||||
.Setup(s => s.GetLocalizedString(It.IsAny<string>()))
|
||||
.Returns("Some Warning Message");
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void should_return_warning_when_app_data_is_child_of_startup_folder()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,8 +1,10 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Moq;
|
||||
using NUnit.Framework;
|
||||
using NzbDrone.Core.Download;
|
||||
using NzbDrone.Core.HealthCheck.Checks;
|
||||
using NzbDrone.Core.Localization;
|
||||
using NzbDrone.Core.Test.Framework;
|
||||
|
||||
namespace NzbDrone.Core.Test.HealthCheck.Checks
|
||||
|
|
@ -10,12 +12,20 @@ namespace NzbDrone.Core.Test.HealthCheck.Checks
|
|||
[TestFixture]
|
||||
public class DownloadClientCheckFixture : CoreTest<DownloadClientCheck>
|
||||
{
|
||||
[SetUp]
|
||||
public void Setup()
|
||||
{
|
||||
Mocker.GetMock<ILocalizationService>()
|
||||
.Setup(s => s.GetLocalizedString(It.IsAny<string>()))
|
||||
.Returns("Some Warning Message");
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void should_return_warning_when_download_client_has_not_been_configured()
|
||||
{
|
||||
Mocker.GetMock<IProvideDownloadClient>()
|
||||
.Setup(s => s.GetDownloadClients())
|
||||
.Returns(new IDownloadClient[0]);
|
||||
.Returns(Array.Empty<IDownloadClient>());
|
||||
|
||||
Subject.Check().ShouldBeWarning();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -31,6 +31,10 @@ public class DownloadClientRootFolderCheckFixture : CoreTest<DownloadClientRootF
|
|||
[SetUp]
|
||||
public void Setup()
|
||||
{
|
||||
Mocker.GetMock<ILocalizationService>()
|
||||
.Setup(s => s.GetLocalizedString(It.IsAny<string>()))
|
||||
.Returns("Some Warning Message");
|
||||
|
||||
_clientStatus = new DownloadClientInfo
|
||||
{
|
||||
IsLocalhost = true,
|
||||
|
|
@ -44,10 +48,6 @@ public void Setup()
|
|||
_downloadClient.Setup(s => s.GetStatus())
|
||||
.Returns(_clientStatus);
|
||||
|
||||
Mocker.GetMock<ILocalizationService>()
|
||||
.Setup(s => s.GetLocalizedString(It.IsAny<string>()))
|
||||
.Returns("Some Warning Message");
|
||||
|
||||
Mocker.GetMock<IProvideDownloadClient>()
|
||||
.Setup(s => s.GetDownloadClients())
|
||||
.Returns(new IDownloadClient[] { _downloadClient.Object });
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
using FluentAssertions;
|
||||
using FluentAssertions;
|
||||
using NzbDrone.Common.Extensions;
|
||||
using NzbDrone.Core.HealthCheck;
|
||||
|
||||
|
|
@ -32,7 +32,7 @@ public static void ShouldBeWarning(this Core.HealthCheck.HealthCheck result, str
|
|||
|
||||
if (wikiFragment.IsNotNullOrWhiteSpace())
|
||||
{
|
||||
result.WikiUrl.Fragment.Should().Be(wikiFragment);
|
||||
result.WikiUrl.ToString().Should().Contain(wikiFragment);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -47,7 +47,7 @@ public static void ShouldBeError(this Core.HealthCheck.HealthCheck result, strin
|
|||
|
||||
if (wikiFragment.IsNotNullOrWhiteSpace())
|
||||
{
|
||||
result.WikiUrl.Fragment.Should().Be(wikiFragment);
|
||||
result.WikiUrl.ToString().Should().Contain(wikiFragment);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@
|
|||
using NUnit.Framework;
|
||||
using NzbDrone.Core.HealthCheck.Checks;
|
||||
using NzbDrone.Core.ImportLists;
|
||||
using NzbDrone.Core.Localization;
|
||||
using NzbDrone.Core.Test.Framework;
|
||||
|
||||
namespace NzbDrone.Core.Test.HealthCheck.Checks
|
||||
|
|
@ -24,6 +25,10 @@ public void SetUp()
|
|||
Mocker.GetMock<IImportListStatusService>()
|
||||
.Setup(v => v.GetBlockedProviders())
|
||||
.Returns(_blockedImportLists);
|
||||
|
||||
Mocker.GetMock<ILocalizationService>()
|
||||
.Setup(s => s.GetLocalizedString(It.IsAny<string>()))
|
||||
.Returns("Some Warning Message");
|
||||
}
|
||||
|
||||
private Mock<IImportList> GivenImportList(int i, double backoffHours, double failureHours)
|
||||
|
|
|
|||
|
|
@ -1,6 +1,8 @@
|
|||
using Moq;
|
||||
using NUnit.Framework;
|
||||
using NzbDrone.Core.Configuration;
|
||||
using NzbDrone.Core.HealthCheck.Checks;
|
||||
using NzbDrone.Core.Localization;
|
||||
using NzbDrone.Core.Test.Framework;
|
||||
|
||||
namespace NzbDrone.Core.Test.HealthCheck.Checks
|
||||
|
|
@ -8,6 +10,14 @@ namespace NzbDrone.Core.Test.HealthCheck.Checks
|
|||
[TestFixture]
|
||||
public class ImportMechanismCheckFixture : CoreTest<ImportMechanismCheck>
|
||||
{
|
||||
[SetUp]
|
||||
public void Setup()
|
||||
{
|
||||
Mocker.GetMock<ILocalizationService>()
|
||||
.Setup(s => s.GetLocalizedString(It.IsAny<string>()))
|
||||
.Returns("Some Warning Message");
|
||||
}
|
||||
|
||||
private void GivenCompletedDownloadHandling(bool? enabled = null)
|
||||
{
|
||||
if (enabled.HasValue)
|
||||
|
|
@ -19,7 +29,7 @@ private void GivenCompletedDownloadHandling(bool? enabled = null)
|
|||
}
|
||||
|
||||
[Test]
|
||||
public void should_return_warning_when_completeddownloadhandling_false()
|
||||
public void should_return_warning_when_completed_download_handling_not_configured()
|
||||
{
|
||||
GivenCompletedDownloadHandling(false);
|
||||
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@
|
|||
using NUnit.Framework;
|
||||
using NzbDrone.Core.HealthCheck.Checks;
|
||||
using NzbDrone.Core.Indexers;
|
||||
using NzbDrone.Core.Localization;
|
||||
using NzbDrone.Core.Test.Framework;
|
||||
|
||||
namespace NzbDrone.Core.Test.HealthCheck.Checks
|
||||
|
|
@ -24,6 +25,10 @@ public void SetUp()
|
|||
Mocker.GetMock<IIndexerStatusService>()
|
||||
.Setup(v => v.GetBlockedProviders())
|
||||
.Returns(_blockedIndexers);
|
||||
|
||||
Mocker.GetMock<ILocalizationService>()
|
||||
.Setup(v => v.GetLocalizedString(It.IsAny<string>()))
|
||||
.Returns("Error");
|
||||
}
|
||||
|
||||
private Mock<IIndexer> GivenIndexer(int id, double backoffHours, double failureHours)
|
||||
|
|
|
|||
|
|
@ -1,8 +1,9 @@
|
|||
using System.Collections.Generic;
|
||||
using System.Collections.Generic;
|
||||
using Moq;
|
||||
using NUnit.Framework;
|
||||
using NzbDrone.Core.HealthCheck.Checks;
|
||||
using NzbDrone.Core.Indexers;
|
||||
using NzbDrone.Core.Localization;
|
||||
using NzbDrone.Core.Test.Framework;
|
||||
|
||||
namespace NzbDrone.Core.Test.HealthCheck.Checks
|
||||
|
|
@ -22,6 +23,10 @@ public void SetUp()
|
|||
Mocker.GetMock<IIndexerFactory>()
|
||||
.Setup(s => s.RssEnabled(It.IsAny<bool>()))
|
||||
.Returns(new List<IIndexer>());
|
||||
|
||||
Mocker.GetMock<ILocalizationService>()
|
||||
.Setup(s => s.GetLocalizedString(It.IsAny<string>()))
|
||||
.Returns("Some Warning Message");
|
||||
}
|
||||
|
||||
private void GivenIndexer(bool supportsRss, bool supportsSearch)
|
||||
|
|
@ -47,6 +52,10 @@ private void GivenRssFiltered()
|
|||
Mocker.GetMock<IIndexerFactory>()
|
||||
.Setup(s => s.RssEnabled(false))
|
||||
.Returns(new List<IIndexer> { _indexerMock.Object });
|
||||
|
||||
Mocker.GetMock<ILocalizationService>()
|
||||
.Setup(s => s.GetLocalizedString(It.IsAny<string>()))
|
||||
.Returns("recent indexer errors");
|
||||
}
|
||||
|
||||
[Test]
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@
|
|||
using NUnit.Framework;
|
||||
using NzbDrone.Core.HealthCheck.Checks;
|
||||
using NzbDrone.Core.Indexers;
|
||||
using NzbDrone.Core.Localization;
|
||||
using NzbDrone.Core.Test.Framework;
|
||||
|
||||
namespace NzbDrone.Core.Test.HealthCheck.Checks
|
||||
|
|
@ -26,6 +27,10 @@ public void SetUp()
|
|||
Mocker.GetMock<IIndexerFactory>()
|
||||
.Setup(s => s.InteractiveSearchEnabled(It.IsAny<bool>()))
|
||||
.Returns(new List<IIndexer>());
|
||||
|
||||
Mocker.GetMock<ILocalizationService>()
|
||||
.Setup(s => s.GetLocalizedString(It.IsAny<string>()))
|
||||
.Returns("Some Warning Message");
|
||||
}
|
||||
|
||||
private void GivenIndexer(bool supportsRss, bool supportsSearch)
|
||||
|
|
@ -62,6 +67,10 @@ private void GivenSearchFiltered()
|
|||
Mocker.GetMock<IIndexerFactory>()
|
||||
.Setup(s => s.InteractiveSearchEnabled(false))
|
||||
.Returns(new List<IIndexer> { _indexerMock.Object });
|
||||
|
||||
Mocker.GetMock<ILocalizationService>()
|
||||
.Setup(s => s.GetLocalizedString(It.IsAny<string>()))
|
||||
.Returns("recent indexer errors");
|
||||
}
|
||||
|
||||
[Test]
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@
|
|||
using NUnit.Framework;
|
||||
using NzbDrone.Core.HealthCheck.Checks;
|
||||
using NzbDrone.Core.Indexers;
|
||||
using NzbDrone.Core.Localization;
|
||||
using NzbDrone.Core.Test.Framework;
|
||||
|
||||
namespace NzbDrone.Core.Test.HealthCheck.Checks
|
||||
|
|
@ -24,6 +25,10 @@ public void SetUp()
|
|||
Mocker.GetMock<IIndexerStatusService>()
|
||||
.Setup(v => v.GetBlockedProviders())
|
||||
.Returns(_blockedIndexers);
|
||||
|
||||
Mocker.GetMock<ILocalizationService>()
|
||||
.Setup(s => s.GetLocalizedString(It.IsAny<string>()))
|
||||
.Returns("Some Warning Message");
|
||||
}
|
||||
|
||||
private Mock<IIndexer> GivenIndexer(int i, double backoffHours, double failureHours)
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@
|
|||
using NzbDrone.Core.Download;
|
||||
using NzbDrone.Core.Download.Clients;
|
||||
using NzbDrone.Core.HealthCheck.Checks;
|
||||
using NzbDrone.Core.Indexers;
|
||||
using NzbDrone.Core.Localization;
|
||||
using NzbDrone.Core.MediaFiles;
|
||||
using NzbDrone.Core.MediaFiles.Events;
|
||||
using NzbDrone.Core.Parser.Model;
|
||||
|
|
@ -41,12 +41,7 @@ public void Setup()
|
|||
{
|
||||
_downloadItem = new DownloadClientItem
|
||||
{
|
||||
DownloadClientInfo = new DownloadClientItemClientInfo
|
||||
{
|
||||
Protocol = DownloadProtocol.Usenet,
|
||||
Id = 1,
|
||||
Name = "Test"
|
||||
},
|
||||
DownloadClientInfo = new DownloadClientItemClientInfo { Name = "Test" },
|
||||
DownloadId = "TestId",
|
||||
OutputPath = new OsPath(_downloadItemPath)
|
||||
};
|
||||
|
|
@ -94,6 +89,10 @@ public void Setup()
|
|||
Ensure.That(path, () => path).IsValidPath();
|
||||
return false;
|
||||
});
|
||||
|
||||
Mocker.GetMock<ILocalizationService>()
|
||||
.Setup(s => s.GetLocalizedString(It.IsAny<string>()))
|
||||
.Returns("Some Warning Message");
|
||||
}
|
||||
|
||||
private void GivenFolderExists(string folder)
|
||||
|
|
@ -178,30 +177,30 @@ public void should_return_docker_path_mapping_error_if_on_docker_and_root_missin
|
|||
}
|
||||
|
||||
[Test]
|
||||
public void should_return_ok_on_track_imported_event()
|
||||
public void should_return_ok_on_book_imported_event()
|
||||
{
|
||||
GivenFolderExists(_downloadRootPath);
|
||||
var importEvent = new TrackImportedEvent(new LocalBook(), new BookFile(), new List<BookFile>(), true, new DownloadClientItem { DownloadClientInfo = new DownloadClientItemClientInfo() });
|
||||
var importEvent = new TrackImportedEvent(new LocalBook(), new BookFile(), new List<BookFile>(), true, _downloadItem);
|
||||
|
||||
Subject.Check(importEvent).ShouldBeOk();
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void should_return_permissions_error_on_track_import_failed_event_if_file_exists()
|
||||
public void should_return_permissions_error_on_book_import_failed_event_if_file_exists()
|
||||
{
|
||||
var localTrack = new LocalBook
|
||||
var localBook = new LocalBook
|
||||
{
|
||||
Path = Path.Combine(_downloadItemPath, "file.mp3")
|
||||
};
|
||||
GivenFileExists(localTrack.Path);
|
||||
GivenFileExists(localBook.Path);
|
||||
|
||||
var importEvent = new TrackImportFailedEvent(new Exception(), localTrack, true, new DownloadClientItem { DownloadClientInfo = new DownloadClientItemClientInfo() });
|
||||
var importEvent = new TrackImportFailedEvent(new Exception(), localBook, true, _downloadItem);
|
||||
|
||||
Subject.Check(importEvent).ShouldBeError(wikiFragment: "permissions-error");
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void should_return_permissions_error_on_track_import_failed_event_if_folder_exists()
|
||||
public void should_return_permissions_error_on_book_import_failed_event_if_folder_exists()
|
||||
{
|
||||
GivenFolderExists(_downloadItemPath);
|
||||
|
||||
|
|
@ -211,7 +210,7 @@ public void should_return_permissions_error_on_track_import_failed_event_if_fold
|
|||
}
|
||||
|
||||
[Test]
|
||||
public void should_return_permissions_error_on_track_import_failed_event_for_local_client_if_folder_does_not_exist()
|
||||
public void should_return_permissions_error_on_book_import_failed_event_for_local_client_if_folder_does_not_exist()
|
||||
{
|
||||
var importEvent = new TrackImportFailedEvent(null, null, true, _downloadItem);
|
||||
|
||||
|
|
@ -219,7 +218,7 @@ public void should_return_permissions_error_on_track_import_failed_event_for_loc
|
|||
}
|
||||
|
||||
[Test]
|
||||
public void should_return_mapping_error_on_track_import_failed_event_for_remote_client_if_folder_does_not_exist()
|
||||
public void should_return_mapping_error_on_book_import_failed_event_for_remote_client_if_folder_does_not_exist()
|
||||
{
|
||||
_clientStatus.IsLocalhost = false;
|
||||
var importEvent = new TrackImportFailedEvent(null, null, true, _downloadItem);
|
||||
|
|
@ -228,7 +227,7 @@ public void should_return_mapping_error_on_track_import_failed_event_for_remote_
|
|||
}
|
||||
|
||||
[Test]
|
||||
public void should_return_mapping_error_on_track_import_failed_event_for_remote_client_if_path_invalid()
|
||||
public void should_return_mapping_error_on_book_import_failed_event_for_remote_client_if_path_invalid()
|
||||
{
|
||||
_clientStatus.IsLocalhost = false;
|
||||
_downloadItem.OutputPath = new OsPath("an invalid path");
|
||||
|
|
@ -238,7 +237,7 @@ public void should_return_mapping_error_on_track_import_failed_event_for_remote_
|
|||
}
|
||||
|
||||
[Test]
|
||||
public void should_return_download_client_error_on_track_import_failed_event_for_remote_client_if_path_invalid()
|
||||
public void should_return_download_client_error_on_book_import_failed_event_for_remote_client_if_path_invalid()
|
||||
{
|
||||
_clientStatus.IsLocalhost = true;
|
||||
_downloadItem.OutputPath = new OsPath("an invalid path");
|
||||
|
|
@ -248,7 +247,7 @@ public void should_return_download_client_error_on_track_import_failed_event_for
|
|||
}
|
||||
|
||||
[Test]
|
||||
public void should_return_docker_mapping_error_on_track_import_failed_event_inside_docker_if_folder_does_not_exist()
|
||||
public void should_return_docker_mapping_error_on_book_import_failed_event_inside_docker_if_folder_does_not_exist()
|
||||
{
|
||||
GivenDocker();
|
||||
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@
|
|||
using NzbDrone.Core.Books;
|
||||
using NzbDrone.Core.HealthCheck.Checks;
|
||||
using NzbDrone.Core.ImportLists;
|
||||
using NzbDrone.Core.Localization;
|
||||
using NzbDrone.Core.Test.Framework;
|
||||
|
||||
namespace NzbDrone.Core.Test.HealthCheck.Checks
|
||||
|
|
@ -14,6 +15,14 @@ namespace NzbDrone.Core.Test.HealthCheck.Checks
|
|||
[TestFixture]
|
||||
public class RootFolderCheckFixture : CoreTest<RootFolderCheck>
|
||||
{
|
||||
[SetUp]
|
||||
public void Setup()
|
||||
{
|
||||
Mocker.GetMock<ILocalizationService>()
|
||||
.Setup(s => s.GetLocalizedString(It.IsAny<string>()))
|
||||
.Returns("Some Warning Message");
|
||||
}
|
||||
|
||||
private void GivenMissingRootFolder()
|
||||
{
|
||||
var author = Builder<Author>.CreateListOfSize(1)
|
||||
|
|
@ -34,7 +43,7 @@ private void GivenMissingRootFolder()
|
|||
|
||||
Mocker.GetMock<IDiskProvider>()
|
||||
.Setup(s => s.GetParentFolder(author.First().Path))
|
||||
.Returns(@"C:\Music");
|
||||
.Returns(@"C:\Books");
|
||||
|
||||
Mocker.GetMock<IDiskProvider>()
|
||||
.Setup(s => s.FolderExists(It.IsAny<string>()))
|
||||
|
|
@ -42,7 +51,7 @@ private void GivenMissingRootFolder()
|
|||
}
|
||||
|
||||
[Test]
|
||||
public void should_not_return_error_when_no_author()
|
||||
public void should_not_return_error_when_no_book()
|
||||
{
|
||||
Mocker.GetMock<IAuthorService>()
|
||||
.Setup(s => s.AllAuthorPaths())
|
||||
|
|
@ -56,7 +65,7 @@ public void should_not_return_error_when_no_author()
|
|||
}
|
||||
|
||||
[Test]
|
||||
public void should_return_error_if_author_parent_is_missing()
|
||||
public void should_return_error_if_book_parent_is_missing()
|
||||
{
|
||||
GivenMissingRootFolder();
|
||||
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@
|
|||
using NzbDrone.Common.Http;
|
||||
using NzbDrone.Common.Serializer;
|
||||
using NzbDrone.Core.HealthCheck.Checks;
|
||||
using NzbDrone.Core.Localization;
|
||||
using NzbDrone.Core.Test.Framework;
|
||||
using NzbDrone.Test.Common;
|
||||
|
||||
|
|
@ -24,6 +25,10 @@ private void GivenServerTime(DateTime dateTime)
|
|||
{
|
||||
var json = new ServiceTimeResponse { DateTimeUtc = dateTime }.ToJson();
|
||||
|
||||
Mocker.GetMock<ILocalizationService>()
|
||||
.Setup(s => s.GetLocalizedString(It.IsAny<string>()))
|
||||
.Returns("System time is off by more than 1 day. Scheduled tasks may not run correctly until the time is corrected");
|
||||
|
||||
Mocker.GetMock<IHttpClient>()
|
||||
.Setup(s => s.Execute(It.IsAny<HttpRequest>()))
|
||||
.Returns<HttpRequest>(r => new HttpResponse(r, new HttpHeader(), Encoding.ASCII.GetBytes(json)));
|
||||
|
|
|
|||
|
|
@ -1,9 +1,10 @@
|
|||
using Moq;
|
||||
using Moq;
|
||||
using NUnit.Framework;
|
||||
using NzbDrone.Common.Disk;
|
||||
using NzbDrone.Common.EnvironmentInfo;
|
||||
using NzbDrone.Core.Configuration;
|
||||
using NzbDrone.Core.HealthCheck.Checks;
|
||||
using NzbDrone.Core.Localization;
|
||||
using NzbDrone.Core.Test.Framework;
|
||||
using NzbDrone.Core.Update;
|
||||
|
||||
|
|
@ -12,6 +13,14 @@ namespace NzbDrone.Core.Test.HealthCheck.Checks
|
|||
[TestFixture]
|
||||
public class UpdateCheckFixture : CoreTest<UpdateCheck>
|
||||
{
|
||||
[SetUp]
|
||||
public void Setup()
|
||||
{
|
||||
Mocker.GetMock<ILocalizationService>()
|
||||
.Setup(s => s.GetLocalizedString(It.IsAny<string>()))
|
||||
.Returns("Some Warning Message");
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void should_return_error_when_app_folder_is_write_protected()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ public override HealthCheck Check()
|
|||
if (_appFolderInfo.StartUpFolder.IsParentPath(_appFolderInfo.AppDataFolder) ||
|
||||
_appFolderInfo.StartUpFolder.PathEquals(_appFolderInfo.AppDataFolder))
|
||||
{
|
||||
return new HealthCheck(GetType(), HealthCheckResult.Warning, "Updating will not be possible to prevent deleting AppData on Update");
|
||||
return new HealthCheck(GetType(), HealthCheckResult.Warning, _localizationService.GetLocalizedString("AppDataLocationHealthCheckMessage"), "#updating-will-not-be-possible-to-prevent-deleting-appdata-on-update");
|
||||
}
|
||||
|
||||
return new HealthCheck(GetType());
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ public class DownloadClientCheck : HealthCheckBase
|
|||
private readonly IProvideDownloadClient _downloadClientProvider;
|
||||
private readonly Logger _logger;
|
||||
|
||||
public DownloadClientCheck(IProvideDownloadClient downloadClientProvider, Logger logger, ILocalizationService localizationService)
|
||||
public DownloadClientCheck(IProvideDownloadClient downloadClientProvider, ILocalizationService localizationService, Logger logger)
|
||||
: base(localizationService)
|
||||
{
|
||||
_downloadClientProvider = downloadClientProvider;
|
||||
|
|
@ -29,7 +29,7 @@ public override HealthCheck Check()
|
|||
|
||||
if (!downloadClients.Any())
|
||||
{
|
||||
return new HealthCheck(GetType(), HealthCheckResult.Warning, "No download client is available");
|
||||
return new HealthCheck(GetType(), HealthCheckResult.Warning, _localizationService.GetLocalizedString("DownloadClientCheckNoneAvailableMessage"), "#no-download-client-is-available");
|
||||
}
|
||||
|
||||
foreach (var downloadClient in downloadClients)
|
||||
|
|
@ -42,7 +42,7 @@ public override HealthCheck Check()
|
|||
{
|
||||
_logger.Debug(ex, "Unable to communicate with {0}", downloadClient.Definition.Name);
|
||||
|
||||
var message = $"Unable to communicate with {downloadClient.Definition.Name}.";
|
||||
var message = string.Format(_localizationService.GetLocalizedString("DownloadClientCheckUnableToCommunicateMessage"), downloadClient.Definition.Name);
|
||||
return new HealthCheck(GetType(), HealthCheckResult.Error, $"{message} {ex.Message}", "#unable-to-communicate-with-download-client");
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -37,10 +37,10 @@ public override HealthCheck Check()
|
|||
|
||||
if (backOffProviders.Count == enabledProviders.Count)
|
||||
{
|
||||
return new HealthCheck(GetType(), HealthCheckResult.Error, "All download clients are unavailable due to failures", "#download-clients-are-unavailable-due-to-failures");
|
||||
return new HealthCheck(GetType(), HealthCheckResult.Error, _localizationService.GetLocalizedString("DownloadClientStatusCheckAllClientMessage"), "#download-clients-are-unavailable-due-to-failures");
|
||||
}
|
||||
|
||||
return new HealthCheck(GetType(), HealthCheckResult.Warning, string.Format("Download clients unavailable due to failures: {0}", string.Join(", ", backOffProviders.Select(v => v.Provider.Definition.Name))), "#download-clients-are-unavailable-due-to-failures");
|
||||
return new HealthCheck(GetType(), HealthCheckResult.Warning, string.Format(_localizationService.GetLocalizedString("DownloadClientStatusCheckSingleClientMessage"), string.Join(", ", backOffProviders.Select(v => v.Provider.Definition.Name))), "#download-clients-are-unavailable-due-to-failures");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -37,10 +37,10 @@ public override HealthCheck Check()
|
|||
|
||||
if (backOffProviders.Count == enabledProviders.Count)
|
||||
{
|
||||
return new HealthCheck(GetType(), HealthCheckResult.Error, "All import lists are unavailable due to failures", "#import-lists-are-unavailable-due-to-failures");
|
||||
return new HealthCheck(GetType(), HealthCheckResult.Error, _localizationService.GetLocalizedString("ImportListStatusCheckAllClientMessage"), "#import-lists-are-unavailable-due-to-failures");
|
||||
}
|
||||
|
||||
return new HealthCheck(GetType(), HealthCheckResult.Warning, string.Format("Import lists unavailable due to failures: {0}", string.Join(", ", backOffProviders.Select(v => v.ImportList.Definition.Name))), "#import-lists-are-unavailable-due-to-failures");
|
||||
return new HealthCheck(GetType(), HealthCheckResult.Warning, string.Format(_localizationService.GetLocalizedString("ImportListStatusCheckSingleClientMessage"), string.Join(", ", backOffProviders.Select(v => v.ImportList.Definition.Name))), "#import-lists-are-unavailable-due-to-failures");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ public override HealthCheck Check()
|
|||
{
|
||||
if (!_configService.EnableCompletedDownloadHandling)
|
||||
{
|
||||
return new HealthCheck(GetType(), HealthCheckResult.Warning, "Enable Completed Download Handling");
|
||||
return new HealthCheck(GetType(), HealthCheckResult.Warning, _localizationService.GetLocalizedString("ImportMechanismHealthCheckMessage"), "#completed-download-handling-is-disabled");
|
||||
}
|
||||
|
||||
return new HealthCheck(GetType());
|
||||
|
|
|
|||
|
|
@ -15,7 +15,9 @@ public class IndexerLongTermStatusCheck : HealthCheckBase
|
|||
private readonly IIndexerFactory _providerFactory;
|
||||
private readonly IIndexerStatusService _providerStatusService;
|
||||
|
||||
public IndexerLongTermStatusCheck(IIndexerFactory providerFactory, IIndexerStatusService providerStatusService, ILocalizationService localizationService)
|
||||
public IndexerLongTermStatusCheck(IIndexerFactory providerFactory,
|
||||
IIndexerStatusService providerStatusService,
|
||||
ILocalizationService localizationService)
|
||||
: base(localizationService)
|
||||
{
|
||||
_providerFactory = providerFactory;
|
||||
|
|
@ -43,13 +45,13 @@ public override HealthCheck Check()
|
|||
{
|
||||
return new HealthCheck(GetType(),
|
||||
HealthCheckResult.Error,
|
||||
"All indexers are unavailable due to failures for more than 6 hours",
|
||||
_localizationService.GetLocalizedString("IndexerLongTermStatusCheckAllClientMessage"),
|
||||
"#indexers-are-unavailable-due-to-failures");
|
||||
}
|
||||
|
||||
return new HealthCheck(GetType(),
|
||||
HealthCheckResult.Warning,
|
||||
string.Format("Indexers unavailable due to failures for more than 6 hours: {0}",
|
||||
string.Format(_localizationService.GetLocalizedString("IndexerLongTermStatusCheckSingleClientMessage"),
|
||||
string.Join(", ", backOffProviders.Select(v => v.Provider.Definition.Name))),
|
||||
"#indexers-are-unavailable-due-to-failures");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,14 +25,14 @@ public override HealthCheck Check()
|
|||
|
||||
if (enabled.Empty())
|
||||
{
|
||||
return new HealthCheck(GetType(), HealthCheckResult.Error, "No indexers available with RSS sync enabled, Readarr will not grab new releases automatically");
|
||||
return new HealthCheck(GetType(), HealthCheckResult.Error, _localizationService.GetLocalizedString("IndexerRssHealthCheckNoIndexers"), "#no-indexers-available-with-rss-sync-enabled-readarr-will-not-grab-new-releases-automatically");
|
||||
}
|
||||
|
||||
var active = _indexerFactory.RssEnabled(true);
|
||||
|
||||
if (active.Empty())
|
||||
{
|
||||
return new HealthCheck(GetType(), HealthCheckResult.Warning, "All rss-capable indexers are temporarily unavailable due to recent indexer errors");
|
||||
return new HealthCheck(GetType(), HealthCheckResult.Warning, _localizationService.GetLocalizedString("IndexerRssHealthCheckNoAvailableIndexers"), "#indexers-are-unavailable-due-to-failures");
|
||||
}
|
||||
|
||||
return new HealthCheck(GetType());
|
||||
|
|
|
|||
|
|
@ -25,21 +25,21 @@ public override HealthCheck Check()
|
|||
|
||||
if (automaticSearchEnabled.Empty())
|
||||
{
|
||||
return new HealthCheck(GetType(), HealthCheckResult.Warning, "No indexers available with Automatic Search enabled, Readarr will not provide any automatic search results");
|
||||
return new HealthCheck(GetType(), HealthCheckResult.Warning, _localizationService.GetLocalizedString("IndexerSearchCheckNoAutomaticMessage"), "#no-indexers-available-with-automatic-search-enabled-readarr-will-not-provide-any-automatic-search-results");
|
||||
}
|
||||
|
||||
var interactiveSearchEnabled = _indexerFactory.InteractiveSearchEnabled(false);
|
||||
|
||||
if (interactiveSearchEnabled.Empty())
|
||||
{
|
||||
return new HealthCheck(GetType(), HealthCheckResult.Warning, "No indexers available with Interactive Search enabled, Readarr will not provide any interactive search results");
|
||||
return new HealthCheck(GetType(), HealthCheckResult.Warning, _localizationService.GetLocalizedString("IndexerSearchCheckNoInteractiveMessage"), "#no-indexers-available-with-interactive-search-enabled");
|
||||
}
|
||||
|
||||
var active = _indexerFactory.AutomaticSearchEnabled(true);
|
||||
|
||||
if (active.Empty())
|
||||
{
|
||||
return new HealthCheck(GetType(), HealthCheckResult.Warning, "All search-capable indexers are temporarily unavailable due to recent indexer errors");
|
||||
return new HealthCheck(GetType(), HealthCheckResult.Warning, _localizationService.GetLocalizedString("IndexerSearchCheckNoAvailableIndexersMessage"), "#indexers-are-unavailable-due-to-failures");
|
||||
}
|
||||
|
||||
return new HealthCheck(GetType());
|
||||
|
|
|
|||
|
|
@ -41,10 +41,17 @@ public override HealthCheck Check()
|
|||
|
||||
if (backOffProviders.Count == enabledProviders.Count)
|
||||
{
|
||||
return new HealthCheck(GetType(), HealthCheckResult.Error, "All indexers are unavailable due to failures", "#indexers-are-unavailable-due-to-failures");
|
||||
return new HealthCheck(GetType(),
|
||||
HealthCheckResult.Error,
|
||||
_localizationService.GetLocalizedString("IndexerStatusCheckAllClientMessage"),
|
||||
"#indexers-are-unavailable-due-to-failures");
|
||||
}
|
||||
|
||||
return new HealthCheck(GetType(), HealthCheckResult.Warning, string.Format("Indexers unavailable due to failures: {0}", string.Join(", ", backOffProviders.Select(v => v.Provider.Definition.Name))), "#indexers-are-unavailable-due-to-failures");
|
||||
return new HealthCheck(GetType(),
|
||||
HealthCheckResult.Warning,
|
||||
string.Format(_localizationService.GetLocalizedString("IndexerStatusCheckSingleClientMessage"),
|
||||
string.Join(", ", backOffProviders.Select(v => v.Provider.Definition.Name))),
|
||||
"#indexers-are-unavailable-due-to-failures");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
using System.Linq;
|
||||
using NzbDrone.Common.Disk;
|
||||
using NzbDrone.Common.Extensions;
|
||||
using NzbDrone.Core.Books;
|
||||
using NzbDrone.Core.Localization;
|
||||
|
||||
|
|
@ -22,14 +21,14 @@ public override HealthCheck Check()
|
|||
{
|
||||
// Not best for optimization but due to possible symlinks and junctions, we get mounts based on series path so internals can handle mount resolution.
|
||||
var mounts = _authorService.AllAuthorPaths()
|
||||
.Select(path => _diskProvider.GetMount(path.Value))
|
||||
.Where(m => m != null && m.MountOptions != null && m.MountOptions.IsReadOnly)
|
||||
.DistinctBy(m => m.RootDirectory)
|
||||
.ToList();
|
||||
.Select(p => _diskProvider.GetMount(p.Value))
|
||||
.Where(m => m != null && m.MountOptions != null && m.MountOptions.IsReadOnly)
|
||||
.DistinctBy(m => m.RootDirectory)
|
||||
.ToList();
|
||||
|
||||
if (mounts.Any())
|
||||
{
|
||||
return new HealthCheck(GetType(), HealthCheckResult.Error, "Mount containing a author path is mounted read-only: " + string.Join(",", mounts.Select(m => m.Name)), "#author-mount-ro");
|
||||
return new HealthCheck(GetType(), HealthCheckResult.Error, _localizationService.GetLocalizedString("MountCheckMessage") + string.Join(", ", mounts.Select(m => m.Name)), "#author-mount-ro");
|
||||
}
|
||||
|
||||
return new HealthCheck(GetType());
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ public override HealthCheck Check()
|
|||
}
|
||||
|
||||
var message = _deploymentInfoProvider.PackageGlobalMessage;
|
||||
HealthCheckResult result = HealthCheckResult.Notice;
|
||||
var result = HealthCheckResult.Notice;
|
||||
|
||||
if (message.StartsWith("Error:"))
|
||||
{
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ public class ProxyCheck : HealthCheckBase
|
|||
|
||||
private readonly IHttpRequestBuilderFactory _cloudRequestBuilder;
|
||||
|
||||
public ProxyCheck(IReadarrCloudRequestBuilder cloudRequestBuilder, IConfigService configService, IHttpClient client, Logger logger, ILocalizationService localizationService)
|
||||
public ProxyCheck(IReadarrCloudRequestBuilder cloudRequestBuilder, IConfigService configService, IHttpClient client, ILocalizationService localizationService, Logger logger)
|
||||
: base(localizationService)
|
||||
{
|
||||
_configService = configService;
|
||||
|
|
@ -36,7 +36,7 @@ public override HealthCheck Check()
|
|||
var addresses = Dns.GetHostAddresses(_configService.ProxyHostname);
|
||||
if (!addresses.Any())
|
||||
{
|
||||
return new HealthCheck(GetType(), HealthCheckResult.Error, string.Format("Failed to resolve the IP Address for the Configured Proxy Host {0}", _configService.ProxyHostname));
|
||||
return new HealthCheck(GetType(), HealthCheckResult.Error, string.Format(_localizationService.GetLocalizedString("ProxyCheckResolveIpMessage"), _configService.ProxyHostname), "#proxy-failed-resolve-ip");
|
||||
}
|
||||
|
||||
var request = _cloudRequestBuilder.Create()
|
||||
|
|
@ -51,13 +51,13 @@ public override HealthCheck Check()
|
|||
if (response.StatusCode == HttpStatusCode.BadRequest)
|
||||
{
|
||||
_logger.Error("Proxy Health Check failed: {0}", response.StatusCode);
|
||||
return new HealthCheck(GetType(), HealthCheckResult.Error, $"Failed to test proxy. StatusCode: {response.StatusCode}");
|
||||
return new HealthCheck(GetType(), HealthCheckResult.Error, string.Format(_localizationService.GetLocalizedString("ProxyCheckBadRequestMessage"), response.StatusCode), "#proxy-failed-test");
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.Error(ex, "Proxy Health Check failed");
|
||||
return new HealthCheck(GetType(), HealthCheckResult.Error, $"Failed to test proxy: {request.Url}");
|
||||
return new HealthCheck(GetType(), HealthCheckResult.Error, string.Format(_localizationService.GetLocalizedString("ProxyCheckFailedToTestMessage"), request.Url), "#proxy-failed-test");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ namespace NzbDrone.Core.HealthCheck.Checks
|
|||
[CheckOn(typeof(ModelEvent<RemotePathMapping>))]
|
||||
[CheckOn(typeof(TrackImportedEvent), CheckOnCondition.FailedOnly)]
|
||||
[CheckOn(typeof(TrackImportFailedEvent), CheckOnCondition.SuccessfulOnly)]
|
||||
public class RemotePathMappingCheck : HealthCheckBase, IProvideHealthCheckWithMessage
|
||||
public class RemotePathMappingCheck : HealthCheckBase, IProvideHealthCheck
|
||||
{
|
||||
private readonly IDiskProvider _diskProvider;
|
||||
private readonly IProvideDownloadClient _downloadClientProvider;
|
||||
|
|
@ -67,15 +67,15 @@ public override HealthCheck Check()
|
|||
{
|
||||
if (!status.IsLocalhost)
|
||||
{
|
||||
return new HealthCheck(GetType(), HealthCheckResult.Error, $"Remote download client {client.Definition.Name} places downloads in {folder.FullPath} but this is not a valid {_osInfo.Name} path. Review your remote path mappings and download client settings.", "#bad-remote-path-mapping");
|
||||
return new HealthCheck(GetType(), HealthCheckResult.Error, string.Format(_localizationService.GetLocalizedString("RemotePathMappingCheckWrongOSPath"), client.Definition.Name, folder.FullPath, _osInfo.Name), "#bad-remote-path-mapping");
|
||||
}
|
||||
else if (_osInfo.IsDocker)
|
||||
{
|
||||
return new HealthCheck(GetType(), HealthCheckResult.Error, $"You are using docker; download client {client.Definition.Name} places downloads in {folder.FullPath} but this is not a valid {_osInfo.Name} path. Review your remote path mappings and download client settings.", "#docker-bad-remote-path-mapping");
|
||||
return new HealthCheck(GetType(), HealthCheckResult.Error, string.Format(_localizationService.GetLocalizedString("RemotePathMappingCheckBadDockerPath"), client.Definition.Name, folder.FullPath, _osInfo.Name), "#docker-bad-remote-path-mapping");
|
||||
}
|
||||
else
|
||||
{
|
||||
return new HealthCheck(GetType(), HealthCheckResult.Error, $"Local download client {client.Definition.Name} places downloads in {folder.FullPath} but this is not a valid {_osInfo.Name} path. Review your download client settings.", "#bad-download-client-settings");
|
||||
return new HealthCheck(GetType(), HealthCheckResult.Error, string.Format(_localizationService.GetLocalizedString("RemotePathMappingCheckLocalWrongOSPath"), client.Definition.Name, folder.FullPath, _osInfo.Name), "#bad-download-client-settings");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -83,15 +83,15 @@ public override HealthCheck Check()
|
|||
{
|
||||
if (_osInfo.IsDocker)
|
||||
{
|
||||
return new HealthCheck(GetType(), HealthCheckResult.Error, $"You are using docker; download client {client.Definition.Name} places downloads in {folder.FullPath} but this directory does not appear to exist inside the container. Review your remote path mappings and container volume settings.", "#docker-bad-remote-path-mapping");
|
||||
return new HealthCheck(GetType(), HealthCheckResult.Error, string.Format(_localizationService.GetLocalizedString("RemotePathMappingCheckDockerFolderMissing"), client.Definition.Name, folder.FullPath), "#docker-bad-remote-path-mapping");
|
||||
}
|
||||
else if (!status.IsLocalhost)
|
||||
{
|
||||
return new HealthCheck(GetType(), HealthCheckResult.Error, $"Remote download client {client.Definition.Name} places downloads in {folder.FullPath} but this directory does not appear to exist. Likely missing or incorrect remote path mapping.", "#bad-remote-path-mapping");
|
||||
return new HealthCheck(GetType(), HealthCheckResult.Error, string.Format(_localizationService.GetLocalizedString("RemotePathMappingCheckLocalFolderMissing"), client.Definition.Name, folder.FullPath), "#bad-remote-path-mapping");
|
||||
}
|
||||
else
|
||||
{
|
||||
return new HealthCheck(GetType(), HealthCheckResult.Error, $"Download client {client.Definition.Name} places downloads in {folder.FullPath} but Readarr cannot see this directory. You may need to adjust the folder's permissions.", "#permissions-error");
|
||||
return new HealthCheck(GetType(), HealthCheckResult.Error, string.Format(_localizationService.GetLocalizedString("RemotePathMappingCheckGenericPermissions"), client.Definition.Name, folder.FullPath), "#permissions-error");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -127,13 +127,13 @@ public HealthCheck Check(IEvent message)
|
|||
var trackPath = failureMessage.BookInfo.Path;
|
||||
if (_diskProvider.FileExists(trackPath))
|
||||
{
|
||||
return new HealthCheck(GetType(), HealthCheckResult.Error, $"Readarr can see but not access downloaded track {trackPath}. Likely permissions error.", "#permissions-error");
|
||||
return new HealthCheck(GetType(), HealthCheckResult.Error, string.Format(_localizationService.GetLocalizedString("RemotePathMappingCheckDownloadPermissions"), trackPath), "#permissions-error");
|
||||
}
|
||||
else
|
||||
{
|
||||
// If the file doesn't exist but TrackInfo is not null then the message is coming from
|
||||
// ImportApprovedTracks and the file must have been removed part way through processing
|
||||
return new HealthCheck(GetType(), HealthCheckResult.Error, $"File {trackPath} was removed part way though procesing.");
|
||||
return new HealthCheck(GetType(), HealthCheckResult.Error, string.Format(_localizationService.GetLocalizedString("RemotePathMappingCheckFileRemoved"), trackPath), "#remote-path-file-removed");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -149,43 +149,43 @@ public HealthCheck Check(IEvent message)
|
|||
// that the user realises something is wrong.
|
||||
if (dlpath.IsNullOrWhiteSpace())
|
||||
{
|
||||
return new HealthCheck(GetType(), HealthCheckResult.Error, $"Readarr failed to import a track. Check your logs for details.");
|
||||
return new HealthCheck(GetType(), HealthCheckResult.Error, _localizationService.GetLocalizedString("RemotePathMappingCheckImportFailed"), "#remote-path-import-failed");
|
||||
}
|
||||
|
||||
if (!dlpath.IsPathValid())
|
||||
{
|
||||
if (!status.IsLocalhost)
|
||||
{
|
||||
return new HealthCheck(GetType(), HealthCheckResult.Error, $"Remote download client {client.Definition.Name} reported files in {dlpath} but this is not a valid {_osInfo.Name} path. Review your remote path mappings and download client settings.", "#bad-remote-path-mapping");
|
||||
return new HealthCheck(GetType(), HealthCheckResult.Error, string.Format(_localizationService.GetLocalizedString("RemotePathMappingCheckFilesWrongOSPath"), client.Definition.Name, dlpath, _osInfo.Name), "#bad-remote-path-mapping");
|
||||
}
|
||||
else if (_osInfo.IsDocker)
|
||||
{
|
||||
return new HealthCheck(GetType(), HealthCheckResult.Error, $"You are using docker; download client {client.Definition.Name} reported files in {dlpath} but this is not a valid {_osInfo.Name} path. Review your remote path mappings and download client settings.", "#docker-bad-remote-path-mapping");
|
||||
return new HealthCheck(GetType(), HealthCheckResult.Error, string.Format(_localizationService.GetLocalizedString("RemotePathMappingCheckFilesBadDockerPath"), client.Definition.Name, dlpath, _osInfo.Name), "#docker-bad-remote-path-mapping");
|
||||
}
|
||||
else
|
||||
{
|
||||
return new HealthCheck(GetType(), HealthCheckResult.Error, $"Local download client {client.Definition.Name} reported files in {dlpath} but this is not a valid {_osInfo.Name} path. Review your download client settings.", "#bad-download-client-settings");
|
||||
return new HealthCheck(GetType(), HealthCheckResult.Error, string.Format(_localizationService.GetLocalizedString("RemotePathMappingCheckFilesLocalWrongOSPath"), client.Definition.Name, dlpath, _osInfo.Name), "#bad-download-client-settings");
|
||||
}
|
||||
}
|
||||
|
||||
if (_diskProvider.FolderExists(dlpath))
|
||||
{
|
||||
return new HealthCheck(GetType(), HealthCheckResult.Error, $"Readarr can see but not access download directory {dlpath}. Likely permissions error.", "#permissions-error");
|
||||
return new HealthCheck(GetType(), HealthCheckResult.Error, string.Format(_localizationService.GetLocalizedString("RemotePathMappingCheckFolderPermissions"), dlpath), "#permissions-error");
|
||||
}
|
||||
|
||||
// if it's a remote client/docker, likely missing path mappings
|
||||
if (_osInfo.IsDocker)
|
||||
{
|
||||
return new HealthCheck(GetType(), HealthCheckResult.Error, $"You are using docker; download client {client.Definition.Name} reported files in {dlpath} but this directory does not appear to exist inside the container. Review your remote path mappings and container volume settings.", "#docker-bad-remote-path-mapping");
|
||||
return new HealthCheck(GetType(), HealthCheckResult.Error, string.Format(_localizationService.GetLocalizedString("RemotePathMappingCheckFolderPermissions"), client.Definition.Name, dlpath), "#docker-bad-remote-path-mapping");
|
||||
}
|
||||
else if (!status.IsLocalhost)
|
||||
{
|
||||
return new HealthCheck(GetType(), HealthCheckResult.Error, $"Remote download client {client.Definition.Name} reported files in {dlpath} but this directory does not appear to exist. Likely missing remote path mapping.", "#bad-remote-path-mapping");
|
||||
return new HealthCheck(GetType(), HealthCheckResult.Error, string.Format(_localizationService.GetLocalizedString("RemotePathMappingCheckRemoteDownloadClient"), client.Definition.Name, dlpath), "#bad-remote-path-mapping");
|
||||
}
|
||||
else
|
||||
{
|
||||
// path mappings shouldn't be needed locally so probably a permissions issue
|
||||
return new HealthCheck(GetType(), HealthCheckResult.Error, $"Download client {client.Definition.Name} reported files in {dlpath} but Readarr cannot see this directory. You may need to adjust the folder's permissions.", "#permissions-error");
|
||||
return new HealthCheck(GetType(), HealthCheckResult.Error, string.Format(_localizationService.GetLocalizedString("RemotePathMappingCheckFilesGenericPermissions"), client.Definition.Name, dlpath), "#permissions-error");
|
||||
}
|
||||
}
|
||||
catch (DownloadClientException ex)
|
||||
|
|
|
|||
|
|
@ -50,10 +50,10 @@ public override HealthCheck Check()
|
|||
{
|
||||
if (missingRootFolders.Count == 1)
|
||||
{
|
||||
return new HealthCheck(GetType(), HealthCheckResult.Error, "Missing root folder: " + missingRootFolders.First(), "#missing-root-folder");
|
||||
return new HealthCheck(GetType(), HealthCheckResult.Error, string.Format(_localizationService.GetLocalizedString("RootFolderCheckSingleMessage"), missingRootFolders.First()), "#missing-root-folder");
|
||||
}
|
||||
|
||||
var message = string.Format("Multiple root folders are missing: {0}", string.Join(" | ", missingRootFolders));
|
||||
var message = string.Format(_localizationService.GetLocalizedString("RootFolderCheckMultipleMessage"), string.Join(" | ", missingRootFolders));
|
||||
return new HealthCheck(GetType(), HealthCheckResult.Error, message, "#missing-root-folder");
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ public class SystemTimeCheck : HealthCheckBase
|
|||
private readonly IHttpRequestBuilderFactory _cloudRequestBuilder;
|
||||
private readonly Logger _logger;
|
||||
|
||||
public SystemTimeCheck(IHttpClient client, IReadarrCloudRequestBuilder cloudRequestBuilder, Logger logger, ILocalizationService localizationService)
|
||||
public SystemTimeCheck(IHttpClient client, IReadarrCloudRequestBuilder cloudRequestBuilder, ILocalizationService localizationService, Logger logger)
|
||||
: base(localizationService)
|
||||
{
|
||||
_client = client;
|
||||
|
|
@ -35,7 +35,7 @@ public override HealthCheck Check()
|
|||
if (Math.Abs(result.DateTimeUtc.Subtract(systemTime).TotalDays) >= 1)
|
||||
{
|
||||
_logger.Error("System time mismatch. SystemTime: {0} Expected Time: {1}. Update system time", systemTime, result.DateTimeUtc);
|
||||
return new HealthCheck(GetType(), HealthCheckResult.Error, $"System time is off by more than 1 day. Scheduled tasks may not run correctly until the time is corrected");
|
||||
return new HealthCheck(GetType(), HealthCheckResult.Error, _localizationService.GetLocalizedString("SystemTimeCheckMessage"), "#system-time-off");
|
||||
}
|
||||
|
||||
return new HealthCheck(GetType());
|
||||
|
|
|
|||
|
|
@ -47,33 +47,30 @@ public override HealthCheck Check()
|
|||
{
|
||||
return new HealthCheck(GetType(),
|
||||
HealthCheckResult.Error,
|
||||
string.Format("Cannot install update because startup folder '{0}' is in an App Translocation folder.", startupFolder),
|
||||
"Cannot install update because startup folder is in an App Translocation folder.");
|
||||
string.Format(_localizationService.GetLocalizedString("UpdateCheckStartupTranslocationMessage"), startupFolder),
|
||||
"#cannot-install-update-because-startup-folder-is-in-an-app-translocation-folder.");
|
||||
}
|
||||
|
||||
if (!_diskProvider.FolderWritable(startupFolder))
|
||||
{
|
||||
return new HealthCheck(GetType(),
|
||||
HealthCheckResult.Error,
|
||||
string.Format("Cannot install update because startup folder '{0}' is not writable by the user '{1}'.", startupFolder, Environment.UserName),
|
||||
"Cannot install update because startup folder is not writable by the user");
|
||||
string.Format(_localizationService.GetLocalizedString("UpdateCheckStartupNotWritableMessage"), startupFolder, Environment.UserName),
|
||||
"#cannot-install-update-because-startup-folder-is-not-writable-by-the-user");
|
||||
}
|
||||
|
||||
if (!_diskProvider.FolderWritable(uiFolder))
|
||||
{
|
||||
return new HealthCheck(GetType(),
|
||||
HealthCheckResult.Error,
|
||||
string.Format("Cannot install update because UI folder '{0}' is not writable by the user '{1}'.", uiFolder, Environment.UserName),
|
||||
"Cannot install update because UI folder is not writable by the user");
|
||||
string.Format(_localizationService.GetLocalizedString("UpdateCheckUINotWritableMessage"), uiFolder, Environment.UserName),
|
||||
"#cannot-install-update-because-ui-folder-is-not-writable-by-the-user");
|
||||
}
|
||||
}
|
||||
|
||||
if (BuildInfo.BuildDateTime < DateTime.UtcNow.AddDays(-14))
|
||||
if (BuildInfo.BuildDateTime < DateTime.UtcNow.AddDays(-14) && _checkUpdateService.AvailableUpdate() != null)
|
||||
{
|
||||
if (_checkUpdateService.AvailableUpdate() != null)
|
||||
{
|
||||
return new HealthCheck(GetType(), HealthCheckResult.Warning, "New update is available");
|
||||
}
|
||||
return new HealthCheck(GetType(), HealthCheckResult.Warning, _localizationService.GetLocalizedString("UpdateAvailable"), "#new-update-is-available");
|
||||
}
|
||||
|
||||
return new HealthCheck(GetType());
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
using System;
|
||||
using NzbDrone.Common.Messaging;
|
||||
|
||||
namespace NzbDrone.Core.HealthCheck
|
||||
|
|
|
|||
|
|
@ -32,6 +32,7 @@
|
|||
"APIKey": "API Key",
|
||||
"ApiKeyHelpTextWarning": "Requires restart to take effect",
|
||||
"AppDataDirectory": "AppData directory",
|
||||
"AppDataLocationHealthCheckMessage": "Updating will not be possible to prevent deleting AppData on Update",
|
||||
"ApplyTags": "Apply Tags",
|
||||
"ApplyTagsHelpTexts1": "How to apply tags to the selected author",
|
||||
"ApplyTagsHelpTexts2": "Add: Add the tags the existing list of tags",
|
||||
|
|
@ -190,8 +191,10 @@
|
|||
"Docker": "Docker",
|
||||
"DownloadClient": "Download Client",
|
||||
"DownloadClientCheckDownloadingToRoot": "Download client {0} places downloads in the root folder {1}. You should not download to a root folder.",
|
||||
"DownloadClientCheckNoneAvailableMessage": "No download client is available",
|
||||
"DownloadClients": "Download Clients",
|
||||
"DownloadClientSettings": "Download Client Settings",
|
||||
"DownloadClientStatusCheckAllClientMessage": "All download clients are unavailable due to failures",
|
||||
"DownloadFailedCheckDownloadClientForMoreDetails": "Download failed: check download client for more details",
|
||||
"DownloadFailedInterp": "Download failed: {0}",
|
||||
"DownloadPropersAndRepacksHelpTexts1": "Whether or not to automatically upgrade to Propers/Repacks",
|
||||
|
|
@ -297,6 +300,8 @@
|
|||
"ImportLists": "Import Lists",
|
||||
"ImportListSettings": "General Import List Settings",
|
||||
"ImportListSpecificSettings": "Import List Specific Settings",
|
||||
"ImportListStatusCheckAllClientMessage": "All lists are unavailable due to failures",
|
||||
"ImportMechanismHealthCheckMessage": "Enable Completed Download Handling",
|
||||
"IncludeHealthWarningsHelpText": "Include Health Warnings",
|
||||
"IncludePreferredWhenRenaming": "Include Preferred when Renaming",
|
||||
"IncludeUnknownAuthorItemsHelpText": "Show items without a author in the queue, this could include removed authors, movies or anything else in Readarr's category",
|
||||
|
|
@ -306,10 +311,14 @@
|
|||
"IndexerIdHelpTextWarning": "Using a specific indexer with preferred words can lead to duplicate releases being grabbed",
|
||||
"IndexerIdvalue0IncludeInPreferredWordsRenamingFormat": "Include in {Preferred Words} renaming format",
|
||||
"IndexerIdvalue0OnlySupportedWhenIndexerIsSetToAll": "Only supported when Indexer is set to (All)",
|
||||
"IndexerLongTermStatusCheckAllClientMessage": "All indexers are unavailable due to failures for more than 6 hours",
|
||||
"IndexerPriority": "Indexer Priority",
|
||||
"IndexerRssHealthCheckNoIndexers": "No indexers available with RSS sync enabled, Readarr will not grab new releases automatically",
|
||||
"Indexers": "Indexers",
|
||||
"IndexerSearchCheckNoAutomaticMessage": "No indexers available with Automatic Search enabled, Readarr will not provide any automatic search results",
|
||||
"IndexerSettings": "Indexer Settings",
|
||||
"IndexersSettingsSummary": "Download clients, download handling and remote path mappings",
|
||||
"IndexerStatusCheckAllClientMessage": "All indexers are unavailable due to failures",
|
||||
"Interval": "Interval",
|
||||
"ISBN": "ISBN",
|
||||
"IsCalibreLibraryHelpText": "Use Calibre Content Server to manipulate library",
|
||||
|
|
@ -402,6 +411,7 @@
|
|||
"MonitorNewItemsHelpText": "Which new books should be monitored",
|
||||
"MonoVersion": "Mono Version",
|
||||
"MoreInfo": "More Info",
|
||||
"MountCheckMessage": "Mount containing an author path is mounted read-only: ",
|
||||
"MusicBrainzAuthorID": "MusicBrainz Author ID",
|
||||
"MusicBrainzBookID": "MusicBrainz Book ID",
|
||||
"MusicbrainzId": "Musicbrainz Id",
|
||||
|
|
@ -495,6 +505,7 @@
|
|||
"ProtocolHelpText": "Choose which protocol(s) to use and which one is preferred when choosing between otherwise equal releases",
|
||||
"Proxy": "Proxy",
|
||||
"ProxyBypassFilterHelpText": "Use ',' as a separator, and '*.' as a wildcard for subdomains",
|
||||
"ProxyCheckResolveIpMessage": "Failed to resolve the IP Address for the Configured Proxy Host {0}",
|
||||
"ProxyPasswordHelpText": "You only need to enter a username and password if one is required. Leave them blank otherwise.",
|
||||
"ProxyType": "Proxy Type",
|
||||
"ProxyUsernameHelpText": "You only need to enter a username and password if one is required. Leave them blank otherwise.",
|
||||
|
|
@ -538,6 +549,7 @@
|
|||
"Reload": "Reload",
|
||||
"RemotePath": "Remote Path",
|
||||
"RemotePathHelpText": "Root path to the directory that the Download Client accesses",
|
||||
"RemotePathMappingCheckWrongOSPath": "Remote download client {0} places downloads in {1} but this is not a valid {2} path. Review your remote path mappings and download client settings.",
|
||||
"RemotePathMappings": "Remote Path Mappings",
|
||||
"Remove": "Remove",
|
||||
"RemoveCompletedDownloadsHelpText": "Remove imported downloads from download client history",
|
||||
|
|
@ -575,6 +587,7 @@
|
|||
"RetentionHelpText": "Usenet only: Set to zero to set for unlimited retention",
|
||||
"RetryingDownloadInterp": "Retrying download {0} at {1}",
|
||||
"RootFolder": "Root Folder",
|
||||
"RootFolderCheckSingleMessage": "Missing root folder: {0}",
|
||||
"RootFolderPathHelpText": "Root Folder list items will be added to",
|
||||
"RootFolders": "Root Folders",
|
||||
"RSSSync": "RSS Sync",
|
||||
|
|
@ -672,6 +685,7 @@
|
|||
"SupportsSearchvalueSearchIsNotSupportedWithThisIndexer": "Search is not supported with this indexer",
|
||||
"SupportsSearchvalueWillBeUsedWhenAutomaticSearchesArePerformedViaTheUIOrByReadarr": "Will be used when automatic searches are performed via the UI or by Readarr",
|
||||
"SupportsSearchvalueWillBeUsedWhenInteractiveSearchIsUsed": "Will be used when interactive search is used",
|
||||
"SystemTimeCheckMessage": "System time is off by more than 1 day. Scheduled tasks may not run correctly until the time is corrected",
|
||||
"TagIsNotUsedAndCanBeDeleted": "Tag is not used and can be deleted",
|
||||
"Tags": "Tags",
|
||||
"TagsHelpText": "Applies to authors with at least one matching tag. Leave blank to apply to all authors",
|
||||
|
|
@ -749,6 +763,7 @@
|
|||
"UnselectAll": "Unselect All",
|
||||
"UpdateAll": "Update all",
|
||||
"UpdateAutomaticallyHelpText": "Automatically download and install updates. You will still be able to install from System: Updates",
|
||||
"UpdateCheckStartupTranslocationMessage": "Cannot install update because startup folder '{0}' is in an App Translocation folder.",
|
||||
"UpdateCovers": "Update Covers",
|
||||
"UpdateCoversHelpText": "Set book covers in Calibre to match those in Readarr",
|
||||
"UpdateMechanismHelpText": "Use Readarr's built-in updater or a script",
|
||||
|
|
|
|||
Loading…
Reference in a new issue