diff options
| author | Luke Pulverenti <luke.pulverenti@gmail.com> | 2013-07-06 19:08:32 -0400 |
|---|---|---|
| committer | Luke Pulverenti <luke.pulverenti@gmail.com> | 2013-07-06 19:08:32 -0400 |
| commit | 540b904ebaecdc935cb622ebf2e2cf87162fa3fe (patch) | |
| tree | 99826cd4640abd9d28ea10a3ae4a9ded4fc089bb | |
| parent | 53450bd514eec97d58eb18b8a01feab36475826b (diff) | |
have some endpoints throw exceptions for offline items
| -rw-r--r-- | MediaBrowser.Api/ItemUpdateService.cs | 5 | ||||
| -rw-r--r-- | MediaBrowser.Api/LibraryService.cs | 5 |
2 files changed, 10 insertions, 0 deletions
diff --git a/MediaBrowser.Api/ItemUpdateService.cs b/MediaBrowser.Api/ItemUpdateService.cs index a86db896b..033f4014b 100644 --- a/MediaBrowser.Api/ItemUpdateService.cs +++ b/MediaBrowser.Api/ItemUpdateService.cs @@ -194,6 +194,11 @@ namespace MediaBrowser.Api private 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 one diff --git a/MediaBrowser.Api/LibraryService.cs b/MediaBrowser.Api/LibraryService.cs index 4042c7c24..17a448c3d 100644 --- a/MediaBrowser.Api/LibraryService.cs +++ b/MediaBrowser.Api/LibraryService.cs @@ -226,6 +226,11 @@ namespace MediaBrowser.Api var 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)) |
