2014-02-19 05:21:03 +00:00
|
|
|
|
using MediaBrowser.Controller.Entities;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Threading;
|
2014-01-31 19:55:21 +00:00
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
|
|
|
|
namespace MediaBrowser.Controller.Providers
|
|
|
|
|
{
|
|
|
|
|
public interface IRemoteMetadataProvider : IMetadataProvider
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2014-02-19 05:21:03 +00:00
|
|
|
|
public interface IRemoteMetadataProvider<TItemType, TLookupInfoType> : IMetadataProvider<TItemType>, IRemoteMetadataProvider
|
2014-02-07 03:10:13 +00:00
|
|
|
|
where TItemType : IHasMetadata, IHasLookupInfo<TLookupInfoType>
|
|
|
|
|
where TLookupInfoType : ItemLookupInfo, new()
|
2014-01-31 19:55:21 +00:00
|
|
|
|
{
|
2014-02-07 03:10:13 +00:00
|
|
|
|
Task<MetadataResult<TItemType>> GetMetadata(TLookupInfoType info, CancellationToken cancellationToken);
|
2014-01-31 19:55:21 +00:00
|
|
|
|
}
|
2014-02-19 05:21:03 +00:00
|
|
|
|
|
|
|
|
|
public interface IRemoteSearchProvider<TLookupInfoType>
|
|
|
|
|
where TLookupInfoType : ItemLookupInfo
|
|
|
|
|
{
|
2014-02-19 16:24:06 +00:00
|
|
|
|
string Name { get; }
|
|
|
|
|
|
2014-02-19 05:21:03 +00:00
|
|
|
|
Task<IEnumerable<SearchResult<TLookupInfoType>>> GetSearchResults(TLookupInfoType searchInfo, CancellationToken cancellationToken);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public class SearchResult<T>
|
|
|
|
|
where T : ItemLookupInfo
|
|
|
|
|
{
|
|
|
|
|
public T Item { get; set; }
|
|
|
|
|
|
|
|
|
|
public string ImageUrl { get; set; }
|
|
|
|
|
}
|
2014-02-19 16:24:06 +00:00
|
|
|
|
|
|
|
|
|
public class RemoteSearchQuery<T>
|
|
|
|
|
where T : ItemLookupInfo
|
|
|
|
|
{
|
|
|
|
|
public T SearchInfo { get; set; }
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// If set will only search within the given provider
|
|
|
|
|
/// </summary>
|
|
|
|
|
public string SearchProviderName { get; set; }
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets or sets a value indicating whether [include disabled providers].
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <value><c>true</c> if [include disabled providers]; otherwise, <c>false</c>.</value>
|
|
|
|
|
public bool IncludeDisabledProviders { get; set; }
|
|
|
|
|
}
|
2014-01-31 19:55:21 +00:00
|
|
|
|
}
|