mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-12-23 09:14:45 +03:00
update offline detection
This commit is contained in:
@@ -184,15 +184,24 @@ namespace MediaBrowser.Server.Implementations.Persistence
|
||||
|
||||
try
|
||||
{
|
||||
if (!_fileSystem.FileExists(path) && !_fileSystem.DirectoryExists(path))
|
||||
if (_fileSystem.FileExists(path) || _fileSystem.DirectoryExists(path))
|
||||
{
|
||||
var libraryItem = _libraryManager.GetItemById(item.Item1);
|
||||
|
||||
await _libraryManager.DeleteItem(libraryItem, new DeleteOptions
|
||||
{
|
||||
DeleteFileLocation = false
|
||||
});
|
||||
continue;
|
||||
}
|
||||
|
||||
var libraryItem = _libraryManager.GetItemById(item.Item1);
|
||||
|
||||
if (Folder.IsPathOffline(path))
|
||||
{
|
||||
libraryItem.IsOffline = true;
|
||||
await libraryItem.UpdateToRepository(ItemUpdateType.None, cancellationToken).ConfigureAwait(false);
|
||||
continue;
|
||||
}
|
||||
|
||||
await _libraryManager.DeleteItem(libraryItem, new DeleteOptions
|
||||
{
|
||||
DeleteFileLocation = false
|
||||
});
|
||||
}
|
||||
catch (OperationCanceledException)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user