mirror of
https://github.com/Readarr/Readarr.git
synced 2026-04-24 22:35:39 -04:00
Fixed: DriveInfo sees snap apps, handle at higher level
This commit is contained in:
@@ -127,7 +127,7 @@ namespace NzbDrone.Common.Disk
|
||||
|
||||
try
|
||||
{
|
||||
var testPath = Path.Combine(path, "Lidarr_write_test.txt");
|
||||
var testPath = Path.Combine(path, "lidarr_write_test.txt");
|
||||
var testContent = $"This file was created to verify if '{path}' is writable. It should've been automatically deleted. Feel free to delete it.";
|
||||
File.WriteAllText(testPath, testContent);
|
||||
File.Delete(testPath);
|
||||
@@ -418,7 +418,12 @@ namespace NzbDrone.Common.Disk
|
||||
return new FileStream(path, FileMode.Create);
|
||||
}
|
||||
|
||||
public virtual List<IMount> GetMounts()
|
||||
public List<IMount> GetMounts()
|
||||
{
|
||||
return GetAllMounts().Where(d => !IsSpecialMount(d)).ToList();
|
||||
}
|
||||
|
||||
protected virtual List<IMount> GetAllMounts()
|
||||
{
|
||||
return GetDriveInfoMounts().Where(d => d.DriveType == DriveType.Fixed || d.DriveType == DriveType.Network || d.DriveType == DriveType.Removable)
|
||||
.Select(d => new DriveInfoMount(d))
|
||||
@@ -426,11 +431,16 @@ namespace NzbDrone.Common.Disk
|
||||
.ToList();
|
||||
}
|
||||
|
||||
protected virtual bool IsSpecialMount(IMount mount)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
public virtual IMount GetMount(string path)
|
||||
{
|
||||
try
|
||||
{
|
||||
var mounts = GetMounts();
|
||||
var mounts = GetAllMounts();
|
||||
|
||||
return mounts.Where(drive => drive.RootDirectory.PathEquals(path) ||
|
||||
drive.RootDirectory.IsParentPath(path))
|
||||
|
||||
Reference in New Issue
Block a user