IExternalId.cs 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. using MediaBrowser.Model.Entities;
  2. using MediaBrowser.Model.Providers;
  3. namespace MediaBrowser.Controller.Providers
  4. {
  5. /// <summary>
  6. /// Represents an identifier for an external provider.
  7. /// </summary>
  8. public interface IExternalId
  9. {
  10. /// <summary>
  11. /// Gets the display name of the provider associated with this ID type.
  12. /// </summary>
  13. string ProviderName { get; }
  14. /// <summary>
  15. /// Gets the unique key to distinguish this provider/type pair. This should be unique across providers.
  16. /// </summary>
  17. // TODO: This property is not actually unique across the concrete types at the moment. It should be updated to be unique.
  18. string Key { get; }
  19. /// <summary>
  20. /// Gets the specific media type for this id. This is used to distinguish between the different
  21. /// external id types for providers with multiple ids.
  22. /// A null value indicates there is no specific media type associated with the external id, or this is the
  23. /// default id for the external provider so there is no need to specify a type.
  24. /// </summary>
  25. /// <remarks>
  26. /// This can be used along with the <see cref="ProviderName"/> to localize the external id on the client.
  27. /// </remarks>
  28. ExternalIdMediaType? Type { get; }
  29. /// <summary>
  30. /// Gets the URL format string for this id.
  31. /// </summary>
  32. string? UrlFormatString { get; }
  33. /// <summary>
  34. /// Determines whether this id supports a given item type.
  35. /// </summary>
  36. /// <param name="item">The item.</param>
  37. /// <returns>True if this item is supported, otherwise false.</returns>
  38. bool Supports(IHasProviderIds item);
  39. }
  40. }