private void LogInaccessiblePathError(string path)
        {
            if (_runtimeInfo.IsWindowsService)
            {
                var mounts = _diskProvider.GetMounts();
                var mount  = mounts.FirstOrDefault(m => m.RootDirectory == Path.GetPathRoot(path));

                if (mount.DriveType == DriveType.Network)
                {
                    _logger.Error("Import failed, path does not exist or is not accessible by Readarr: {0}. It's recommended to avoid mapped network drives when running as a Windows service. See the FAQ for more info", path);
                    return;
                }
            }

            if (OsInfo.IsWindows)
            {
                if (path.StartsWith(@"\\"))
                {
                    _logger.Error("Import failed, path does not exist or is not accessible by Readarr: {0}. Ensure the user running Readarr has access to the network share", path);
                    return;
                }
            }

            _logger.Error("Import failed, path does not exist or is not accessible by Readarr: {0}. Ensure the path exists and the user running Readarr has the correct permissions to access this file/folder", path);
        }
Example #2
0
 private IEnumerable <string> GetFixedDisksRootPaths()
 {
     return(_diskProvider.GetMounts()
            .Where(d => d.DriveType == DriveType.Fixed)
            .Where(d => !_regexSpecialDrive.IsMatch(d.RootDirectory))
            .Select(d => d.RootDirectory));
 }
Example #3
0
 private IEnumerable <DiskSpace> GetFixedDisksFreeSpace()
 {
     return(GetDiskSpace(_diskProvider.GetMounts()
                         .Where(d => d.DriveType == DriveType.Fixed)
                         .Where(d => !_regexSpecialDrive.IsMatch(d.RootDirectory))
                         .Select(d => d.RootDirectory), true));
 }
Example #4
0
 private List <FileSystemModel> GetDrives()
 {
     return(_diskProvider.GetMounts()
            .Select(d => new FileSystemModel
     {
         Type = FileSystemEntityType.Drive,
         Name = d.VolumeName,
         Path = d.RootDirectory,
         LastModified = null
     })
            .ToList());
 }
        private List <FileSystemModel> GetDrives()
        {
            return(_diskProvider.GetMounts()
                   .Where(d =>
            {
                // Fow Windows Services, exclude mapped network drives.
                if (_runtimeInfo.IsWindowsService)
                {
                    return d.DriveType != DriveType.Network;
                }

                return true;
            })
                   .Select(d => new FileSystemModel
            {
                Type = FileSystemEntityType.Drive,
                Name = d.VolumeName,
                Path = d.RootDirectory,
                LastModified = null
            })
                   .ToList());
        }