diff options
| author | Luke Pulverenti <luke.pulverenti@gmail.com> | 2014-02-10 15:11:46 -0500 |
|---|---|---|
| committer | Luke Pulverenti <luke.pulverenti@gmail.com> | 2014-02-10 15:11:46 -0500 |
| commit | cf9ef0e43d01decd743c5444785ee247bda3cb32 (patch) | |
| tree | 147bd7b0e2afdb8d88a56e1cf6b9b59bbb1eb14a /MediaBrowser.Api/LibraryService.cs | |
| parent | 326fa5a67090246c519cdb318c314bee4049a460 (diff) | |
fix refresh of tv recordings
Diffstat (limited to 'MediaBrowser.Api/LibraryService.cs')
| -rw-r--r-- | MediaBrowser.Api/LibraryService.cs | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/MediaBrowser.Api/LibraryService.cs b/MediaBrowser.Api/LibraryService.cs index a7a58dbfb..aeb795a78 100644 --- a/MediaBrowser.Api/LibraryService.cs +++ b/MediaBrowser.Api/LibraryService.cs @@ -243,8 +243,8 @@ namespace MediaBrowser.Api public object Get(GetFile request) { var item = _dtoService.GetItemByDtoId(request.Id); - - if (item.LocationType == LocationType.Remote || item.LocationType == LocationType.Virtual) + var locationType = item.LocationType; + if (locationType == LocationType.Remote || locationType == LocationType.Virtual) { throw new ArgumentException("This command cannot be used for remote or virtual items."); } @@ -331,8 +331,7 @@ namespace MediaBrowser.Api { if (item.Parent is AggregateFolder) { - return user.RootFolder.GetChildren(user, true).FirstOrDefault(i => i.LocationType == LocationType.FileSystem && - i.PhysicalLocations.Contains(item.Path)); + return user.RootFolder.GetChildren(user, true).FirstOrDefault(i => i.PhysicalLocations.Contains(item.Path)); } return item; @@ -442,12 +441,9 @@ namespace MediaBrowser.Api var parent = item.Parent; - if (item.LocationType == LocationType.Offline) - { - throw new InvalidOperationException(string.Format("{0} is currently offline.", item.Name)); - } + var locationType = item.LocationType; - if (item.LocationType == LocationType.FileSystem) + if (locationType == LocationType.FileSystem || locationType == LocationType.Offline) { foreach (var path in item.GetDeletePaths().ToList()) { |
