mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-07-09 03:04:24 -04:00
have some endpoints throw exceptions for offline items
This commit is contained in:
parent
53450bd514
commit
540b904eba
@ -194,6 +194,11 @@ namespace MediaBrowser.Api
|
|||||||
|
|
||||||
private void UpdateItem(BaseItemDto request, BaseItem item)
|
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;
|
item.Name = request.Name;
|
||||||
|
|
||||||
// Only set the forced value if they changed it, or there's already one
|
// Only set the forced value if they changed it, or there's already one
|
||||||
|
@ -226,6 +226,11 @@ namespace MediaBrowser.Api
|
|||||||
|
|
||||||
var parent = item.Parent;
|
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 (item.LocationType == LocationType.FileSystem)
|
||||||
{
|
{
|
||||||
if (Directory.Exists(item.Path))
|
if (Directory.Exists(item.Path))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user