mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-04-24 02:54:43 +01:00
create notion of locked path
This commit is contained in:
@@ -64,6 +64,13 @@ namespace MediaBrowser.Server.Implementations.FileOrganization
|
||||
FileSize = new FileInfo(path).Length
|
||||
};
|
||||
|
||||
if (_libraryMonitor.IsPathLocked(path))
|
||||
{
|
||||
result.Status = FileSortingStatus.Failure;
|
||||
result.StatusMessage = "Path is locked by other processes. Please try again later.";
|
||||
return result;
|
||||
}
|
||||
|
||||
var namingOptions = ((LibraryManager)_libraryManager).GetNamingOptions();
|
||||
var resolver = new Naming.TV.EpisodeResolver(namingOptions, new PatternsLogger());
|
||||
|
||||
|
||||
@@ -78,6 +78,12 @@ namespace MediaBrowser.Server.Implementations.IO
|
||||
TemporarilyIgnore(path);
|
||||
}
|
||||
|
||||
public bool IsPathLocked(string path)
|
||||
{
|
||||
var lockedPaths = _tempIgnoredPaths.Keys.ToList();
|
||||
return lockedPaths.Any(i => string.Equals(i, path, StringComparison.OrdinalIgnoreCase) || _fileSystem.ContainsSubPath(i, path));
|
||||
}
|
||||
|
||||
public async void ReportFileSystemChangeComplete(string path, bool refreshPath)
|
||||
{
|
||||
if (string.IsNullOrEmpty(path))
|
||||
|
||||
Reference in New Issue
Block a user