a start to the lookup feature

This commit is contained in:
Luke Pulverenti
2014-03-01 17:34:27 -05:00
parent d537826d81
commit 6c5cf81752
14 changed files with 484 additions and 94 deletions

View File

@@ -1,4 +1,5 @@
using MediaBrowser.Controller.Entities;
using MediaBrowser.Common.Net;
using MediaBrowser.Controller.Entities;
using MediaBrowser.Controller.Library;
using MediaBrowser.Model.Configuration;
using MediaBrowser.Model.Entities;
@@ -126,5 +127,14 @@ namespace MediaBrowser.Controller.Providers
CancellationToken cancellationToken)
where TItemType : BaseItem, new()
where TLookupType : ItemLookupInfo;
/// <summary>
/// Gets the search image.
/// </summary>
/// <param name="providerName">Name of the provider.</param>
/// <param name="url">The URL.</param>
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns>Task{HttpResponseInfo}.</returns>
Task<HttpResponseInfo> GetSearchImage(string providerName, string url, CancellationToken cancellationToken);
}
}

View File

@@ -18,11 +18,8 @@ namespace MediaBrowser.Controller.Providers
Task<MetadataResult<TItemType>> GetMetadata(TLookupInfoType info, CancellationToken cancellationToken);
}
public interface IRemoteSearchProvider<in TLookupInfoType> : IMetadataProvider
where TLookupInfoType : ItemLookupInfo
public interface IRemoteSearchProvider : IMetadataProvider
{
Task<IEnumerable<RemoteSearchResult>> GetSearchResults(TLookupInfoType searchInfo, CancellationToken cancellationToken);
/// <summary>
/// Gets the image response.
/// </summary>
@@ -31,6 +28,12 @@ namespace MediaBrowser.Controller.Providers
/// <returns>Task{HttpResponseInfo}.</returns>
Task<HttpResponseInfo> GetImageResponse(string url, CancellationToken cancellationToken);
}
public interface IRemoteSearchProvider<in TLookupInfoType> : IRemoteSearchProvider
where TLookupInfoType : ItemLookupInfo
{
Task<IEnumerable<RemoteSearchResult>> GetSearchResults(TLookupInfoType searchInfo, CancellationToken cancellationToken);
}
public class RemoteSearchQuery<T>
where T : ItemLookupInfo