Add documentation around Name, Id, and Type. Changed ExternalIdType to ExternalIdMediaType

pull/2643/head
Luke Foust 5 years ago
parent ae4e727b24
commit 0fb78cf54b

@ -0,0 +1,45 @@
namespace MediaBrowser.Controller.Providers
{
/// <summary>The specific media type of an <see cref="IExternalId"/>.</summary>
public enum ExternalIdMediaType
{
/// <summary>There is no specific media type</summary>
None,
/// <summary>A music album</summary>
Album,
/// <summary>The artist of a music album</summary>
AlbumArtist,
/// <summary>The artist of a media item</summary>
Artist,
/// <summary>A boxed set of media</summary>
BoxSet,
/// <summary>A series episode</summary>
Episode,
/// <summary>A movie</summary>
Movie,
/// <summary>An alternative artist apart from the main artist</summary>
OtherArtist,
/// <summary>A person</summary>
Person,
/// <summary>A release group</summary>
ReleaseGroup,
/// <summary>A single season of a series</summary>
Season,
/// <summary>A series</summary>
Series,
/// <summary>A music track</summary>
Track
}
}

@ -2,33 +2,24 @@ using MediaBrowser.Model.Entities;
namespace MediaBrowser.Controller.Providers namespace MediaBrowser.Controller.Providers
{ {
/// <summary>Represents and identifier for an external provider.</summary>
public interface IExternalId public interface IExternalId
{ {
/// <summary>Gets the name used to identify this provider</summary>
string Name { get; } string Name { get; }
/// <summary>Gets the unique key to distinguish this provider/type pair. This should be unique across providers.</summary>
string Key { get; } string Key { get; }
ExternalIdType Type { get; } /// <summary>Gets the specific media type for this id.</summary>
ExternalIdMediaType Type { get; }
/// <summary>Gets the url format string for this id.</summary>
string UrlFormatString { get; } string UrlFormatString { get; }
/// <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>
bool Supports(IHasProviderIds item); bool Supports(IHasProviderIds item);
} }
public enum ExternalIdType
{
None,
Album,
AlbumArtist,
Artist,
BoxSet,
Episode,
Movie,
OtherArtist,
Person,
ReleaseGroup,
Season,
Series,
Track
}
} }

@ -1,31 +1,30 @@
#pragma warning disable CS1591
namespace MediaBrowser.Model.Providers namespace MediaBrowser.Model.Providers
{ {
/// <summary>
/// Represents the external id information for serialization to the client.
/// </summary>
public class ExternalIdInfo public class ExternalIdInfo
{ {
/// <summary> /// <summary>
/// Gets or sets the name. /// Gets or sets the name of the external id provider (IE: IMDB, MusicBrainz, etc).
/// </summary> /// </summary>
/// <value>The name.</value>
public string Name { get; set; } public string Name { get; set; }
/// <summary> /// <summary>
/// Gets or sets the key. /// Gets or sets the unique key for this id. This key should be unique across all providers.
/// </summary> /// </summary>
/// <value>The key.</value>
public string Key { get; set; } public string Key { get; set; }
/// <summary> /// <summary>
/// Gets or sets the type. /// Gets or sets the media type (Album, Artist, etc).
/// This can be null if there is no specific type.
/// This string is also used to localize the media type on the client.
/// </summary> /// </summary>
/// <value>The type.</value>
public string Type { get; set; } public string Type { get; set; }
/// <summary> /// <summary>
/// Gets or sets the URL format string. /// Gets or sets the URL format string.
/// </summary> /// </summary>
/// <value>The URL format string.</value>
public string UrlFormatString { get; set; } public string UrlFormatString { get; set; }
} }
} }

@ -910,7 +910,7 @@ namespace MediaBrowser.Providers.Manager
{ {
Name = i.Name, Name = i.Name,
Key = i.Key, Key = i.Key,
Type = i.Type == ExternalIdType.None ? null : i.Type.ToString(), Type = i.Type == ExternalIdMediaType.None ? null : i.Type.ToString(),
UrlFormatString = i.UrlFormatString UrlFormatString = i.UrlFormatString
}); });

@ -16,7 +16,7 @@ namespace MediaBrowser.Providers.Movies
public string Key => MetadataProviders.Imdb.ToString(); public string Key => MetadataProviders.Imdb.ToString();
/// <inheritdoc /> /// <inheritdoc />
public ExternalIdType Type => ExternalIdType.None; public ExternalIdMediaType Type => ExternalIdMediaType.None;
/// <inheritdoc /> /// <inheritdoc />
public string UrlFormatString => "https://www.imdb.com/title/{0}"; public string UrlFormatString => "https://www.imdb.com/title/{0}";
@ -43,7 +43,7 @@ namespace MediaBrowser.Providers.Movies
public string Key => MetadataProviders.Imdb.ToString(); public string Key => MetadataProviders.Imdb.ToString();
/// <inheritdoc /> /// <inheritdoc />
public ExternalIdType Type => ExternalIdType.Person; public ExternalIdMediaType Type => ExternalIdMediaType.Person;
/// <inheritdoc /> /// <inheritdoc />
public string UrlFormatString => "https://www.imdb.com/name/{0}"; public string UrlFormatString => "https://www.imdb.com/name/{0}";

@ -13,7 +13,7 @@ namespace MediaBrowser.Providers.Music
public string Key => "IMVDb"; public string Key => "IMVDb";
/// <inheritdoc /> /// <inheritdoc />
public ExternalIdType Type => ExternalIdType.None; public ExternalIdMediaType Type => ExternalIdMediaType.None;
/// <inheritdoc /> /// <inheritdoc />
public string UrlFormatString => null; public string UrlFormatString => null;

@ -13,7 +13,7 @@ namespace MediaBrowser.Providers.Plugins.AudioDb
public string Key => MetadataProviders.AudioDbAlbum.ToString(); public string Key => MetadataProviders.AudioDbAlbum.ToString();
/// <inheritdoc /> /// <inheritdoc />
public ExternalIdType Type => ExternalIdType.None; public ExternalIdMediaType Type => ExternalIdMediaType.None;
/// <inheritdoc /> /// <inheritdoc />
public string UrlFormatString => "https://www.theaudiodb.com/album/{0}"; public string UrlFormatString => "https://www.theaudiodb.com/album/{0}";
@ -31,7 +31,7 @@ namespace MediaBrowser.Providers.Plugins.AudioDb
public string Key => MetadataProviders.AudioDbAlbum.ToString(); public string Key => MetadataProviders.AudioDbAlbum.ToString();
/// <inheritdoc /> /// <inheritdoc />
public ExternalIdType Type => ExternalIdType.Album; public ExternalIdMediaType Type => ExternalIdMediaType.Album;
/// <inheritdoc /> /// <inheritdoc />
public string UrlFormatString => "https://www.theaudiodb.com/album/{0}"; public string UrlFormatString => "https://www.theaudiodb.com/album/{0}";
@ -49,7 +49,7 @@ namespace MediaBrowser.Providers.Plugins.AudioDb
public string Key => MetadataProviders.AudioDbArtist.ToString(); public string Key => MetadataProviders.AudioDbArtist.ToString();
/// <inheritdoc /> /// <inheritdoc />
public ExternalIdType Type => ExternalIdType.Artist; public ExternalIdMediaType Type => ExternalIdMediaType.Artist;
/// <inheritdoc /> /// <inheritdoc />
public string UrlFormatString => "https://www.theaudiodb.com/artist/{0}"; public string UrlFormatString => "https://www.theaudiodb.com/artist/{0}";
@ -67,7 +67,7 @@ namespace MediaBrowser.Providers.Plugins.AudioDb
public string Key => MetadataProviders.AudioDbArtist.ToString(); public string Key => MetadataProviders.AudioDbArtist.ToString();
/// <inheritdoc /> /// <inheritdoc />
public ExternalIdType Type => ExternalIdType.OtherArtist; public ExternalIdMediaType Type => ExternalIdMediaType.OtherArtist;
/// <inheritdoc /> /// <inheritdoc />
public string UrlFormatString => "https://www.theaudiodb.com/artist/{0}"; public string UrlFormatString => "https://www.theaudiodb.com/artist/{0}";

@ -14,7 +14,7 @@ namespace MediaBrowser.Providers.Music
public string Key => MetadataProviders.MusicBrainzReleaseGroup.ToString(); public string Key => MetadataProviders.MusicBrainzReleaseGroup.ToString();
/// <inheritdoc /> /// <inheritdoc />
public ExternalIdType Type => ExternalIdType.ReleaseGroup; public ExternalIdMediaType Type => ExternalIdMediaType.ReleaseGroup;
/// <inheritdoc /> /// <inheritdoc />
public string UrlFormatString => Plugin.Instance.Configuration.Server + "/release-group/{0}"; public string UrlFormatString => Plugin.Instance.Configuration.Server + "/release-group/{0}";
@ -32,7 +32,7 @@ namespace MediaBrowser.Providers.Music
public string Key => MetadataProviders.MusicBrainzAlbumArtist.ToString(); public string Key => MetadataProviders.MusicBrainzAlbumArtist.ToString();
/// <inheritdoc /> /// <inheritdoc />
public ExternalIdType Type => ExternalIdType.AlbumArtist; public ExternalIdMediaType Type => ExternalIdMediaType.AlbumArtist;
/// <inheritdoc /> /// <inheritdoc />
public string UrlFormatString => Plugin.Instance.Configuration.Server + "/artist/{0}"; public string UrlFormatString => Plugin.Instance.Configuration.Server + "/artist/{0}";
@ -50,7 +50,7 @@ namespace MediaBrowser.Providers.Music
public string Key => MetadataProviders.MusicBrainzAlbum.ToString(); public string Key => MetadataProviders.MusicBrainzAlbum.ToString();
/// <inheritdoc /> /// <inheritdoc />
public ExternalIdType Type => ExternalIdType.Album; public ExternalIdMediaType Type => ExternalIdMediaType.Album;
/// <inheritdoc /> /// <inheritdoc />
public string UrlFormatString => Plugin.Instance.Configuration.Server + "/release/{0}"; public string UrlFormatString => Plugin.Instance.Configuration.Server + "/release/{0}";
@ -68,7 +68,7 @@ namespace MediaBrowser.Providers.Music
public string Key => MetadataProviders.MusicBrainzArtist.ToString(); public string Key => MetadataProviders.MusicBrainzArtist.ToString();
/// <inheritdoc /> /// <inheritdoc />
public ExternalIdType Type => ExternalIdType.Artist; public ExternalIdMediaType Type => ExternalIdMediaType.Artist;
/// <inheritdoc /> /// <inheritdoc />
public string UrlFormatString => Plugin.Instance.Configuration.Server + "/artist/{0}"; public string UrlFormatString => Plugin.Instance.Configuration.Server + "/artist/{0}";
@ -87,7 +87,7 @@ namespace MediaBrowser.Providers.Music
public string Key => MetadataProviders.MusicBrainzArtist.ToString(); public string Key => MetadataProviders.MusicBrainzArtist.ToString();
/// <inheritdoc /> /// <inheritdoc />
public ExternalIdType Type => ExternalIdType.OtherArtist; public ExternalIdMediaType Type => ExternalIdMediaType.OtherArtist;
/// <inheritdoc /> /// <inheritdoc />
public string UrlFormatString => Plugin.Instance.Configuration.Server + "/artist/{0}"; public string UrlFormatString => Plugin.Instance.Configuration.Server + "/artist/{0}";
@ -105,7 +105,7 @@ namespace MediaBrowser.Providers.Music
public string Key => MetadataProviders.MusicBrainzTrack.ToString(); public string Key => MetadataProviders.MusicBrainzTrack.ToString();
/// <inheritdoc /> /// <inheritdoc />
public ExternalIdType Type => ExternalIdType.Track; public ExternalIdMediaType Type => ExternalIdMediaType.Track;
/// <inheritdoc /> /// <inheritdoc />
public string UrlFormatString => Plugin.Instance.Configuration.Server + "/track/{0}"; public string UrlFormatString => Plugin.Instance.Configuration.Server + "/track/{0}";

@ -14,7 +14,7 @@ namespace MediaBrowser.Providers.TV
public string Key => MetadataProviders.Zap2It.ToString(); public string Key => MetadataProviders.Zap2It.ToString();
/// <inheritdoc /> /// <inheritdoc />
public ExternalIdType Type => ExternalIdType.None; public ExternalIdMediaType Type => ExternalIdMediaType.None;
/// <inheritdoc /> /// <inheritdoc />
public string UrlFormatString => "http://tvlistings.zap2it.com/overview.html?programSeriesId={0}"; public string UrlFormatString => "http://tvlistings.zap2it.com/overview.html?programSeriesId={0}";
@ -32,7 +32,7 @@ namespace MediaBrowser.Providers.TV
public string Key => MetadataProviders.Tvdb.ToString(); public string Key => MetadataProviders.Tvdb.ToString();
/// <inheritdoc /> /// <inheritdoc />
public ExternalIdType Type => ExternalIdType.None; public ExternalIdMediaType Type => ExternalIdMediaType.None;
/// <inheritdoc /> /// <inheritdoc />
public string UrlFormatString => TvdbUtils.TvdbBaseUrl + "?tab=series&id={0}"; public string UrlFormatString => TvdbUtils.TvdbBaseUrl + "?tab=series&id={0}";
@ -51,7 +51,7 @@ namespace MediaBrowser.Providers.TV
public string Key => MetadataProviders.Tvdb.ToString(); public string Key => MetadataProviders.Tvdb.ToString();
/// <inheritdoc /> /// <inheritdoc />
public ExternalIdType Type => ExternalIdType.Season; public ExternalIdMediaType Type => ExternalIdMediaType.Season;
/// <inheritdoc /> /// <inheritdoc />
public string UrlFormatString => null; public string UrlFormatString => null;
@ -69,7 +69,7 @@ namespace MediaBrowser.Providers.TV
public string Key => MetadataProviders.Tvdb.ToString(); public string Key => MetadataProviders.Tvdb.ToString();
/// <inheritdoc /> /// <inheritdoc />
public ExternalIdType Type => ExternalIdType.Episode; public ExternalIdMediaType Type => ExternalIdMediaType.Episode;
/// <inheritdoc /> /// <inheritdoc />
public string UrlFormatString => TvdbUtils.TvdbBaseUrl + "?tab=episode&id={0}"; public string UrlFormatString => TvdbUtils.TvdbBaseUrl + "?tab=episode&id={0}";

@ -14,7 +14,7 @@ namespace MediaBrowser.Providers.Tmdb.BoxSets
public string Key => MetadataProviders.TmdbCollection.ToString(); public string Key => MetadataProviders.TmdbCollection.ToString();
/// <inheritdoc /> /// <inheritdoc />
public ExternalIdType Type => ExternalIdType.BoxSet; public ExternalIdMediaType Type => ExternalIdMediaType.BoxSet;
/// <inheritdoc /> /// <inheritdoc />
public string UrlFormatString => TmdbUtils.BaseTmdbUrl + "collection/{0}"; public string UrlFormatString => TmdbUtils.BaseTmdbUrl + "collection/{0}";

@ -15,7 +15,7 @@ namespace MediaBrowser.Providers.Tmdb.Movies
public string Key => MetadataProviders.Tmdb.ToString(); public string Key => MetadataProviders.Tmdb.ToString();
/// <inheritdoc /> /// <inheritdoc />
public ExternalIdType Type => ExternalIdType.Movie; public ExternalIdMediaType Type => ExternalIdMediaType.Movie;
/// <inheritdoc /> /// <inheritdoc />
public string UrlFormatString => TmdbUtils.BaseTmdbUrl + "movie/{0}"; public string UrlFormatString => TmdbUtils.BaseTmdbUrl + "movie/{0}";

@ -13,7 +13,7 @@ namespace MediaBrowser.Providers.Tmdb.People
public string Key => MetadataProviders.Tmdb.ToString(); public string Key => MetadataProviders.Tmdb.ToString();
/// <inheritdoc /> /// <inheritdoc />
public ExternalIdType Type => ExternalIdType.Person; public ExternalIdMediaType Type => ExternalIdMediaType.Person;
/// <inheritdoc /> /// <inheritdoc />
public string UrlFormatString => TmdbUtils.BaseTmdbUrl + "person/{0}"; public string UrlFormatString => TmdbUtils.BaseTmdbUrl + "person/{0}";

@ -13,7 +13,7 @@ namespace MediaBrowser.Providers.Tmdb.TV
public string Key => MetadataProviders.Tmdb.ToString(); public string Key => MetadataProviders.Tmdb.ToString();
/// <inheritdoc /> /// <inheritdoc />
public ExternalIdType Type => ExternalIdType.Series; public ExternalIdMediaType Type => ExternalIdMediaType.Series;
/// <inheritdoc /> /// <inheritdoc />
public string UrlFormatString => TmdbUtils.BaseTmdbUrl + "tv/{0}"; public string UrlFormatString => TmdbUtils.BaseTmdbUrl + "tv/{0}";

Loading…
Cancel
Save