|
|
@ -274,35 +274,25 @@ namespace MediaBrowser.Api
|
|
|
|
private T GetItemFromSlugName<T>(ILibraryManager libraryManager, string name, DtoOptions dtoOptions)
|
|
|
|
private T GetItemFromSlugName<T>(ILibraryManager libraryManager, string name, DtoOptions dtoOptions)
|
|
|
|
where T : BaseItem, new()
|
|
|
|
where T : BaseItem, new()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
var result = libraryManager.GetItemList(new InternalItemsQuery
|
|
|
|
var result = (libraryManager.GetItemList(new InternalItemsQuery
|
|
|
|
{
|
|
|
|
{
|
|
|
|
Name = name.Replace(BaseItem.SlugChar, '&'),
|
|
|
|
Name = name.Replace(BaseItem.SlugChar, '&'),
|
|
|
|
IncludeItemTypes = new[] { typeof(T).Name },
|
|
|
|
IncludeItemTypes = new[] { typeof(T).Name },
|
|
|
|
DtoOptions = dtoOptions
|
|
|
|
DtoOptions = dtoOptions
|
|
|
|
|
|
|
|
|
|
|
|
}).OfType<T>().FirstOrDefault();
|
|
|
|
}).OfType<T>().FirstOrDefault() ?? libraryManager.GetItemList(new InternalItemsQuery
|
|
|
|
|
|
|
|
|
|
|
|
if (result == null)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
result = libraryManager.GetItemList(new InternalItemsQuery
|
|
|
|
|
|
|
|
{
|
|
|
|
{
|
|
|
|
Name = name.Replace(BaseItem.SlugChar, '/'),
|
|
|
|
Name = name.Replace(BaseItem.SlugChar, '/'),
|
|
|
|
IncludeItemTypes = new[] { typeof(T).Name },
|
|
|
|
IncludeItemTypes = new[] { typeof(T).Name },
|
|
|
|
DtoOptions = dtoOptions
|
|
|
|
DtoOptions = dtoOptions
|
|
|
|
|
|
|
|
|
|
|
|
}).OfType<T>().FirstOrDefault();
|
|
|
|
}).OfType<T>().FirstOrDefault()) ?? libraryManager.GetItemList(new InternalItemsQuery
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (result == null)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
result = libraryManager.GetItemList(new InternalItemsQuery
|
|
|
|
|
|
|
|
{
|
|
|
|
{
|
|
|
|
Name = name.Replace(BaseItem.SlugChar, '?'),
|
|
|
|
Name = name.Replace(BaseItem.SlugChar, '?'),
|
|
|
|
IncludeItemTypes = new[] { typeof(T).Name },
|
|
|
|
IncludeItemTypes = new[] { typeof(T).Name },
|
|
|
|
DtoOptions = dtoOptions
|
|
|
|
DtoOptions = dtoOptions
|
|
|
|
|
|
|
|
|
|
|
|
}).OfType<T>().FirstOrDefault();
|
|
|
|
}).OfType<T>().FirstOrDefault();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return result;
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
}
|
|
|
|