ExternalIdInfo.cs 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. namespace MediaBrowser.Model.Providers
  2. {
  3. /// <summary>
  4. /// Represents the external id information for serialization to the client.
  5. /// </summary>
  6. public class ExternalIdInfo
  7. {
  8. /// <summary>
  9. /// Initializes a new instance of the <see cref="ExternalIdInfo"/> class.
  10. /// </summary>
  11. /// <param name="name">Name of the external id provider (IE: IMDB, MusicBrainz, etc).</param>
  12. /// <param name="key">Key for this id. This key should be unique across all providers.</param>
  13. /// <param name="type">Specific media type for this id.</param>
  14. /// <param name="urlFormatString">URL format string.</param>
  15. public ExternalIdInfo(string name, string key, ExternalIdMediaType? type, string? urlFormatString)
  16. {
  17. Name = name;
  18. Key = key;
  19. Type = type;
  20. UrlFormatString = urlFormatString;
  21. }
  22. /// <summary>
  23. /// Gets or sets the display name of the external id provider (IE: IMDB, MusicBrainz, etc).
  24. /// </summary>
  25. // TODO: This should be renamed to ProviderName
  26. public string Name { get; set; }
  27. /// <summary>
  28. /// Gets or sets the unique key for this id. This key should be unique across all providers.
  29. /// </summary>
  30. // TODO: This property is not actually unique across the concrete types at the moment. It should be updated to be unique.
  31. public string Key { get; set; }
  32. /// <summary>
  33. /// Gets or sets the specific media type for this id. This is used to distinguish between the different
  34. /// external id types for providers with multiple ids.
  35. /// A null value indicates there is no specific media type associated with the external id, or this is the
  36. /// default id for the external provider so there is no need to specify a type.
  37. /// </summary>
  38. /// <remarks>
  39. /// This can be used along with the <see cref="Name"/> to localize the external id on the client.
  40. /// </remarks>
  41. public ExternalIdMediaType? Type { get; set; }
  42. /// <summary>
  43. /// Gets or sets the URL format string.
  44. /// </summary>
  45. public string? UrlFormatString { get; set; }
  46. }
  47. }