diff options
| author | Luke Pulverenti <luke.pulverenti@gmail.com> | 2013-12-01 14:31:58 -0500 |
|---|---|---|
| committer | Luke Pulverenti <luke.pulverenti@gmail.com> | 2013-12-01 14:31:58 -0500 |
| commit | 7ac2f7481734694ae411f5481c6a73264671b55b (patch) | |
| tree | c9c5a2f32e4a8e41b81da4f5e4abfc9cedcaf66c /MediaBrowser.Api/LibraryService.cs | |
| parent | e191836ea0405c5a152a742fc5526d8ceb5c5db5 (diff) | |
fixes #629 - Deleting a movie only deletes the video file
Diffstat (limited to 'MediaBrowser.Api/LibraryService.cs')
| -rw-r--r-- | MediaBrowser.Api/LibraryService.cs | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/MediaBrowser.Api/LibraryService.cs b/MediaBrowser.Api/LibraryService.cs index 55ee454d2..cf62e42ba 100644 --- a/MediaBrowser.Api/LibraryService.cs +++ b/MediaBrowser.Api/LibraryService.cs @@ -465,13 +465,16 @@ namespace MediaBrowser.Api if (item.LocationType == LocationType.FileSystem) { - if (Directory.Exists(item.Path)) + foreach (var path in item.GetDeletePaths().ToList()) { - Directory.Delete(item.Path, true); - } - else if (File.Exists(item.Path)) - { - File.Delete(item.Path); + if (Directory.Exists(path)) + { + Directory.Delete(path, true); + } + else if (File.Exists(path)) + { + File.Delete(path); + } } if (parent != null) |
