jellyfin/MediaBrowser.Controller/Providers/IExternalId.cs

48 lines
1.8 KiB
C#
Raw Normal View History

#nullable disable
using MediaBrowser.Model.Entities;
using MediaBrowser.Model.Providers;
2018-12-27 23:27:57 +00:00
namespace MediaBrowser.Controller.Providers
{
2020-05-17 20:24:28 +00:00
/// <summary>
/// Represents an identifier for an external provider.
/// </summary>
2018-12-27 23:27:57 +00:00
public interface IExternalId
{
2020-05-17 18:22:36 +00:00
/// <summary>
/// Gets the display name of the provider associated with this ID type.
/// </summary>
2020-05-17 21:35:43 +00:00
string ProviderName { get; }
2018-12-27 23:27:57 +00:00
2020-05-17 18:22:36 +00:00
/// <summary>
/// Gets the unique key to distinguish this provider/type pair. This should be unique across providers.
/// </summary>
2020-05-17 20:24:28 +00:00
// TODO: This property is not actually unique across the concrete types at the moment. It should be updated to be unique.
2018-12-27 23:27:57 +00:00
string Key { get; }
2020-05-17 18:22:36 +00:00
/// <summary>
2020-05-17 20:24:28 +00:00
/// Gets the specific media type for this id. This is used to distinguish between the different
/// external id types for providers with multiple ids.
/// A null value indicates there is no specific media type associated with the external id, or this is the
/// default id for the external provider so there is no need to specify a type.
2020-05-17 18:22:36 +00:00
/// </summary>
/// <remarks>
2020-05-17 21:35:43 +00:00
/// This can be used along with the <see cref="ProviderName"/> to localize the external id on the client.
/// </remarks>
ExternalIdMediaType? Type { get; }
2020-05-17 18:22:36 +00:00
/// <summary>
/// Gets the URL format string for this id.
/// </summary>
2018-12-27 23:27:57 +00:00
string UrlFormatString { get; }
2020-05-17 18:22:36 +00:00
/// <summary>
/// Determines whether this id supports a given item type.
/// </summary>
/// <param name="item">The item.</param>
/// <returns>True if this item is supported, otherwise false.</returns>
2018-12-27 23:27:57 +00:00
bool Supports(IHasProviderIds item);
}
}