mirror of
https://github.com/Radarr/Radarr.git
synced 2024-11-20 01:42:35 +01:00
parent
1414a09111
commit
b4eff4d4f9
@ -1,3 +1,4 @@
|
|||||||
|
using System;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using NzbDrone.Common.Disk;
|
using NzbDrone.Common.Disk;
|
||||||
using NzbDrone.Core.Localization;
|
using NzbDrone.Core.Localization;
|
||||||
@ -21,14 +22,17 @@ 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.
|
// 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 = _movieService.AllMoviePaths()
|
var mounts = _movieService.AllMoviePaths()
|
||||||
.Select(p => _diskProvider.GetMount(p.Value))
|
.Select(p => new Tuple<IMount, string>(_diskProvider.GetMount(p.Value), p.Value))
|
||||||
.Where(m => m is { MountOptions.IsReadOnly: true })
|
.Where(m => m.Item1 is { MountOptions.IsReadOnly: true })
|
||||||
.DistinctBy(m => m.RootDirectory)
|
.DistinctBy(m => m.Item1.RootDirectory)
|
||||||
.ToList();
|
.ToList();
|
||||||
|
|
||||||
if (mounts.Any())
|
if (mounts.Any())
|
||||||
{
|
{
|
||||||
return new HealthCheck(GetType(), HealthCheckResult.Error, _localizationService.GetLocalizedString("MountCheckMessage") + string.Join(", ", mounts.Select(m => m.Name)), "#movie-mount-ro");
|
return new HealthCheck(GetType(),
|
||||||
|
HealthCheckResult.Error,
|
||||||
|
$"{_localizationService.GetLocalizedString("MountCheckMessage")}{string.Join(", ", mounts.Select(m => $"{m.Item1.Name} ({m.Item2})"))}",
|
||||||
|
"#movie-mount-ro");
|
||||||
}
|
}
|
||||||
|
|
||||||
return new HealthCheck(GetType());
|
return new HealthCheck(GetType());
|
||||||
|
Loading…
Reference in New Issue
Block a user