The Free Software Media System - Server Backend & API
have some endpoints throw exceptions for offline items
Luke Pulverenti540b904ebaec
diff --git a/MediaBrowser.Api/ItemUpdateService.cs b/MediaBrowser.Api/ItemUpdateService.csindex a86db896b0..033f4014b8 100644--- a/MediaBrowser.Api/ItemUpdateService.cs+++ b/MediaBrowser.Api/ItemUpdateService.cs@@ -194,6 +194,11 @@ namespace MediaBrowser.Apiprivate void UpdateItem(BaseItemDto request, BaseItem item){+ if (item.LocationType == LocationType.Offline)+ {+ throw new InvalidOperationException(string.Format("{0} is currently offline.", item.Name));+ }+item.Name = request.Name;// Only set the forced value if they changed it, or there's already onediff --git a/MediaBrowser.Api/LibraryService.cs b/MediaBrowser.Api/LibraryService.csindex 4042c7c24e..17a448c3d5 100644--- a/MediaBrowser.Api/LibraryService.cs+++ b/MediaBrowser.Api/LibraryService.cs@@ -226,6 +226,11 @@ namespace MediaBrowser.Apivar parent = item.Parent;+ if (item.LocationType == LocationType.Offline)+ {+ throw new InvalidOperationException(string.Format("{0} is currently offline.", item.Name));+ }+if (item.LocationType == LocationType.FileSystem){if (Directory.Exists(item.Path))