add chapter image error handling

This commit is contained in:
Luke Pulverenti
2016-09-05 16:07:36 -04:00
parent cc7b150b90
commit d4324b7e89
12 changed files with 126 additions and 34 deletions

View File

@@ -0,0 +1,36 @@
using MediaBrowser.Controller.Entities;
namespace MediaBrowser.Controller.Collections
{
public class ManualCollectionsFolder : BasePluginFolder, IHiddenFromDisplay
{
public ManualCollectionsFolder()
{
Name = "Collections";
DisplayMediaType = "CollectionFolder";
}
public override bool IsHidden
{
get
{
return true;
}
}
public bool IsHiddenFromUser(User user)
{
return !ConfigurationManager.Configuration.DisplayCollectionsView;
}
public override string CollectionType
{
get { return Model.Entities.CollectionType.BoxSets; }
}
public override string GetClientTypeName()
{
return typeof(CollectionFolder).Name;
}
}
}

View File

@@ -113,8 +113,7 @@ namespace MediaBrowser.Controller.Entities
{
var standaloneTypes = new List<string>
{
CollectionType.Playlists,
CollectionType.BoxSets
CollectionType.Playlists
};
var collectionFolder = folder as ICollectionFolder;

View File

@@ -98,6 +98,7 @@
<Compile Include="Collections\CollectionCreationOptions.cs" />
<Compile Include="Collections\CollectionEvents.cs" />
<Compile Include="Collections\ICollectionManager.cs" />
<Compile Include="Collections\ManualCollectionsFolder.cs" />
<Compile Include="Connect\ConnectSupporterSummary.cs" />
<Compile Include="Connect\IConnectManager.cs" />
<Compile Include="Connect\UserLinkResult.cs" />

View File

@@ -790,20 +790,25 @@ namespace MediaBrowser.Controller.Providers
}
default:
if (_validProviderIds.ContainsKey(reader.Name))
{
var id = reader.ReadElementContentAsString();
if (!string.IsNullOrWhiteSpace(id))
{
string readerName = reader.Name;
string providerIdValue;
if (_validProviderIds.TryGetValue(readerName, out providerIdValue))
{
item.SetProviderId(_validProviderIds[reader.Name], id);
var id = reader.ReadElementContentAsString();
if (!string.IsNullOrWhiteSpace(id))
{
item.SetProviderId(providerIdValue, id);
}
}
else
{
reader.Skip();
}
}
else
{
reader.Skip();
}
break;
break;
}
}
}