ExternalIdInfo.cs 2.4 KB

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