aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Api
diff options
context:
space:
mode:
authorLuke Pulverenti <luke.pulverenti@gmail.com>2014-02-10 15:11:46 -0500
committerLuke Pulverenti <luke.pulverenti@gmail.com>2014-02-10 15:11:46 -0500
commitcf9ef0e43d01decd743c5444785ee247bda3cb32 (patch)
tree147bd7b0e2afdb8d88a56e1cf6b9b59bbb1eb14a /MediaBrowser.Api
parent326fa5a67090246c519cdb318c314bee4049a460 (diff)
fix refresh of tv recordings
Diffstat (limited to 'MediaBrowser.Api')
-rw-r--r--MediaBrowser.Api/Library/LibraryService.cs12
-rw-r--r--MediaBrowser.Api/LibraryService.cs14
2 files changed, 6 insertions, 20 deletions
diff --git a/MediaBrowser.Api/Library/LibraryService.cs b/MediaBrowser.Api/Library/LibraryService.cs
index 17520ba1c4..6ffa10191c 100644
--- a/MediaBrowser.Api/Library/LibraryService.cs
+++ b/MediaBrowser.Api/Library/LibraryService.cs
@@ -69,17 +69,7 @@ namespace MediaBrowser.Api.Library
public object Get(GetPhyscialPaths request)
{
var result = _libraryManager.RootFolder.Children
- .SelectMany(c =>
- {
- var locationType = c.LocationType;
-
- if (locationType != LocationType.Remote && locationType != LocationType.Virtual)
- {
- return c.PhysicalLocations;
- }
-
- return new List<string>();
- })
+ .SelectMany(c => c.PhysicalLocations)
.ToList();
return ToOptimizedSerializedResultUsingCache(result);
diff --git a/MediaBrowser.Api/LibraryService.cs b/MediaBrowser.Api/LibraryService.cs
index a7a58dbfb4..aeb795a78d 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())
{