aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Api/LibraryService.cs
diff options
context:
space:
mode:
authorLuke Pulverenti <luke.pulverenti@gmail.com>2014-02-19 13:50:37 -0500
committerLuke Pulverenti <luke.pulverenti@gmail.com>2014-02-19 13:50:37 -0500
commit4a39df98cdd56505db5eea61d29509179cd9e48e (patch)
treec6b43a8d539fa0c3504c007afffb58fe9a9619c4 /MediaBrowser.Api/LibraryService.cs
parent411ce2175102c7e37546971b7f07f593260732c3 (diff)
rework image extraction settings
Diffstat (limited to 'MediaBrowser.Api/LibraryService.cs')
-rw-r--r--MediaBrowser.Api/LibraryService.cs49
1 files changed, 2 insertions, 47 deletions
diff --git a/MediaBrowser.Api/LibraryService.cs b/MediaBrowser.Api/LibraryService.cs
index aeb795a78..f8b4caf94 100644
--- a/MediaBrowser.Api/LibraryService.cs
+++ b/MediaBrowser.Api/LibraryService.cs
@@ -435,56 +435,11 @@ namespace MediaBrowser.Api
Task.WaitAll(task);
}
- private async Task DeleteItem(DeleteItem request)
+ private Task DeleteItem(DeleteItem request)
{
var item = _dtoService.GetItemByDtoId(request.Id);
- var parent = item.Parent;
-
- var locationType = item.LocationType;
-
- if (locationType == LocationType.FileSystem || locationType == LocationType.Offline)
- {
- foreach (var path in item.GetDeletePaths().ToList())
- {
- if (Directory.Exists(path))
- {
- Directory.Delete(path, true);
- }
- else if (File.Exists(path))
- {
- File.Delete(path);
- }
- }
-
- if (parent != null)
- {
- try
- {
- await parent.ValidateChildren(new Progress<double>(), CancellationToken.None)
- .ConfigureAwait(false);
- }
- catch (Exception ex)
- {
- Logger.ErrorException("Error refreshing item", ex);
- }
- }
- }
- else if (parent != null)
- {
- try
- {
- await parent.RemoveChild(item, CancellationToken.None).ConfigureAwait(false);
- }
- catch (Exception ex)
- {
- Logger.ErrorException("Error removing item", ex);
- }
- }
- else
- {
- throw new InvalidOperationException("Don't know how to delete " + item.Name);
- }
+ return _libraryManager.DeleteItem(item);
}
/// <summary>