GoogleBooksProvider.cs 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading;
  6. using System.Threading.Tasks;
  7. using MediaBrowser.Common.Net;
  8. using MediaBrowser.Controller.Entities;
  9. using MediaBrowser.Controller.Entities.TV;
  10. using MediaBrowser.Controller.Providers;
  11. using MediaBrowser.Model.Providers;
  12. namespace MediaBrowser.Providers.Books
  13. {
  14. public class GoogleBooksProvider : IRemoteMetadataProvider<AudioBook, SongInfo>
  15. {
  16. public string Name => "Google Books";
  17. private readonly IHttpClient _httpClient;
  18. public GoogleBooksProvider(IHttpClient httpClient)
  19. {
  20. _httpClient = httpClient;
  21. }
  22. public Task<HttpResponseInfo> GetImageResponse(string url, CancellationToken cancellationToken)
  23. {
  24. return _httpClient.GetResponse(new HttpRequestOptions
  25. {
  26. CancellationToken = cancellationToken,
  27. Url = url,
  28. BufferContent = false
  29. });
  30. }
  31. public async Task<MetadataResult<AudioBook>> GetMetadata(SongInfo info, CancellationToken cancellationToken)
  32. {
  33. return new MetadataResult<AudioBook>();
  34. }
  35. public async Task<IEnumerable<RemoteSearchResult>> GetSearchResults(SongInfo searchInfo, CancellationToken cancellationToken)
  36. {
  37. return new List<RemoteSearchResult>();
  38. }
  39. }
  40. }