aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Eisele <Shadowghost@users.noreply.github.com>2024-04-13 01:44:45 +0200
committerGitHub <noreply@github.com>2024-04-12 17:44:45 -0600
commit134bf7a6a58402a08e8e59f7f9ee626881dfa183 (patch)
treed024619a279a5e054dce70b62360626921bad197
parentab731d92128f7068771434f3e157495e3d3f66e5 (diff)
Don't throw if file was already removed (#11286)
-rw-r--r--Emby.Server.Implementations/Library/LibraryManager.cs26
1 files changed, 22 insertions, 4 deletions
diff --git a/Emby.Server.Implementations/Library/LibraryManager.cs b/Emby.Server.Implementations/Library/LibraryManager.cs
index 0c854bdb7..dced6868d 100644
--- a/Emby.Server.Implementations/Library/LibraryManager.cs
+++ b/Emby.Server.Implementations/Library/LibraryManager.cs
@@ -338,7 +338,7 @@ namespace Emby.Server.Implementations.Library
if (item is LiveTvProgram)
{
_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.Name ?? "Unknown name",
item.Path ?? string.Empty,
@@ -347,7 +347,7 @@ namespace Emby.Server.Implementations.Library
else
{
_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.Name ?? "Unknown name",
item.Path ?? string.Empty,
@@ -366,7 +366,7 @@ namespace Emby.Server.Implementations.Library
}
_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.Name ?? "Unknown name",
metadataPath,
@@ -395,7 +395,7 @@ namespace Emby.Server.Implementations.Library
try
{
_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.Name ?? "Unknown name",
fileSystemInfo.FullName,
@@ -410,6 +410,24 @@ namespace Emby.Server.Implementations.Library
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)
{
if (isRequiredForDelete)