mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-06-03 05:34:16 -04:00
Don't throw if file was already removed (#11286)
This commit is contained in:
parent
ab731d9212
commit
134bf7a6a5
@ -338,7 +338,7 @@ namespace Emby.Server.Implementations.Library
|
|||||||
if (item is LiveTvProgram)
|
if (item is LiveTvProgram)
|
||||||
{
|
{
|
||||||
_logger.LogDebug(
|
_logger.LogDebug(
|
||||||
"Removing item, Type: {0}, Name: {1}, Path: {2}, Id: {3}",
|
"Removing item, Type: {Type}, Name: {Name}, Path: {Path}, Id: {Id}",
|
||||||
item.GetType().Name,
|
item.GetType().Name,
|
||||||
item.Name ?? "Unknown name",
|
item.Name ?? "Unknown name",
|
||||||
item.Path ?? string.Empty,
|
item.Path ?? string.Empty,
|
||||||
@ -347,7 +347,7 @@ namespace Emby.Server.Implementations.Library
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
_logger.LogInformation(
|
_logger.LogInformation(
|
||||||
"Removing item, Type: {0}, Name: {1}, Path: {2}, Id: {3}",
|
"Removing item, Type: {Type}, Name: {Name}, Path: {Path}, Id: {Id}",
|
||||||
item.GetType().Name,
|
item.GetType().Name,
|
||||||
item.Name ?? "Unknown name",
|
item.Name ?? "Unknown name",
|
||||||
item.Path ?? string.Empty,
|
item.Path ?? string.Empty,
|
||||||
@ -366,7 +366,7 @@ namespace Emby.Server.Implementations.Library
|
|||||||
}
|
}
|
||||||
|
|
||||||
_logger.LogDebug(
|
_logger.LogDebug(
|
||||||
"Deleting metadata path, Type: {0}, Name: {1}, Path: {2}, Id: {3}",
|
"Deleting metadata path, Type: {Type}, Name: {Name}, Path: {Path}, Id: {Id}",
|
||||||
item.GetType().Name,
|
item.GetType().Name,
|
||||||
item.Name ?? "Unknown name",
|
item.Name ?? "Unknown name",
|
||||||
metadataPath,
|
metadataPath,
|
||||||
@ -395,7 +395,7 @@ namespace Emby.Server.Implementations.Library
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
_logger.LogInformation(
|
_logger.LogInformation(
|
||||||
"Deleting item path, Type: {0}, Name: {1}, Path: {2}, Id: {3}",
|
"Deleting item path, Type: {Type}, Name: {Name}, Path: {Path}, Id: {Id}",
|
||||||
item.GetType().Name,
|
item.GetType().Name,
|
||||||
item.Name ?? "Unknown name",
|
item.Name ?? "Unknown name",
|
||||||
fileSystemInfo.FullName,
|
fileSystemInfo.FullName,
|
||||||
@ -410,6 +410,24 @@ namespace Emby.Server.Implementations.Library
|
|||||||
File.Delete(fileSystemInfo.FullName);
|
File.Delete(fileSystemInfo.FullName);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
catch (DirectoryNotFoundException)
|
||||||
|
{
|
||||||
|
_logger.LogInformation(
|
||||||
|
"Directory not found, only removing from database, Type: {Type}, Name: {Name}, Path: {Path}, Id: {Id}",
|
||||||
|
item.GetType().Name,
|
||||||
|
item.Name ?? "Unknown name",
|
||||||
|
fileSystemInfo.FullName,
|
||||||
|
item.Id);
|
||||||
|
}
|
||||||
|
catch (FileNotFoundException)
|
||||||
|
{
|
||||||
|
_logger.LogInformation(
|
||||||
|
"File not found, only removing from database, Type: {Type}, Name: {Name}, Path: {Path}, Id: {Id}",
|
||||||
|
item.GetType().Name,
|
||||||
|
item.Name ?? "Unknown name",
|
||||||
|
fileSystemInfo.FullName,
|
||||||
|
item.Id);
|
||||||
|
}
|
||||||
catch (IOException)
|
catch (IOException)
|
||||||
{
|
{
|
||||||
if (isRequiredForDelete)
|
if (isRequiredForDelete)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user