2
0
Эх сурвалжийг харах

Remove 'General' as an ExternalIdMediaType, and instead use 'null' to represent a general external id type

Mark Monteiro 5 жил өмнө
parent
commit
4f6e5591ec

+ 3 - 1
MediaBrowser.Controller/Providers/IExternalId.cs

@@ -22,11 +22,13 @@ namespace MediaBrowser.Controller.Providers
         /// <summary>
         /// 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.
         /// </summary>
         /// <remarks>
         /// This can be used along with the <see cref="ProviderName"/> to localize the external id on the client.
         /// </remarks>
-        ExternalIdMediaType Type { get; }
+        ExternalIdMediaType? Type { get; }
 
         /// <summary>
         /// Gets the URL format string for this id.

+ 3 - 1
MediaBrowser.Model/Providers/ExternalIdInfo.cs

@@ -20,11 +20,13 @@ namespace MediaBrowser.Model.Providers
         /// <summary>
         /// Gets or sets 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.
         /// </summary>
         /// <remarks>
         /// This can be used along with the <see cref="Name"/> to localize the external id on the client.
         /// </remarks>
-        public ExternalIdMediaType Type { get; set; }
+        public ExternalIdMediaType? Type { get; set; }
 
         /// <summary>
         /// Gets or sets the URL format string.

+ 0 - 6
MediaBrowser.Model/Providers/ExternalIdMediaType.cs

@@ -8,12 +8,6 @@ namespace MediaBrowser.Model.Providers
     /// </remarks>
     public enum ExternalIdMediaType
     {
-        /// <summary>
-        /// 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.
-        /// </summary>
-        General = 0,
-
         /// <summary>
         /// A music album.
         /// </summary>

+ 2 - 2
MediaBrowser.Providers/Movies/MovieExternalIds.cs

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

+ 1 - 1
MediaBrowser.Providers/Music/MusicExternalIds.cs

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

+ 4 - 4
MediaBrowser.Providers/Plugins/AudioDb/ExternalIds.cs

@@ -14,7 +14,7 @@ namespace MediaBrowser.Providers.Plugins.AudioDb
         public string Key => MetadataProviders.AudioDbAlbum.ToString();
 
         /// <inheritdoc />
-        public ExternalIdMediaType Type => ExternalIdMediaType.General;
+        public ExternalIdMediaType? Type => null;
 
         /// <inheritdoc />
         public string UrlFormatString => "https://www.theaudiodb.com/album/{0}";
@@ -32,7 +32,7 @@ namespace MediaBrowser.Providers.Plugins.AudioDb
         public string Key => MetadataProviders.AudioDbAlbum.ToString();
 
         /// <inheritdoc />
-        public ExternalIdMediaType Type => ExternalIdMediaType.Album;
+        public ExternalIdMediaType? Type => ExternalIdMediaType.Album;
 
         /// <inheritdoc />
         public string UrlFormatString => "https://www.theaudiodb.com/album/{0}";
@@ -50,7 +50,7 @@ namespace MediaBrowser.Providers.Plugins.AudioDb
         public string Key => MetadataProviders.AudioDbArtist.ToString();
 
         /// <inheritdoc />
-        public ExternalIdMediaType Type => ExternalIdMediaType.Artist;
+        public ExternalIdMediaType? Type => ExternalIdMediaType.Artist;
 
         /// <inheritdoc />
         public string UrlFormatString => "https://www.theaudiodb.com/artist/{0}";
@@ -68,7 +68,7 @@ namespace MediaBrowser.Providers.Plugins.AudioDb
         public string Key => MetadataProviders.AudioDbArtist.ToString();
 
         /// <inheritdoc />
-        public ExternalIdMediaType Type => ExternalIdMediaType.OtherArtist;
+        public ExternalIdMediaType? Type => ExternalIdMediaType.OtherArtist;
 
         /// <inheritdoc />
         public string UrlFormatString => "https://www.theaudiodb.com/artist/{0}";

+ 6 - 6
MediaBrowser.Providers/Plugins/MusicBrainz/ExternalIds.cs

@@ -15,7 +15,7 @@ namespace MediaBrowser.Providers.Music
         public string Key => MetadataProviders.MusicBrainzReleaseGroup.ToString();
 
         /// <inheritdoc />
-        public ExternalIdMediaType Type => ExternalIdMediaType.ReleaseGroup;
+        public ExternalIdMediaType? Type => ExternalIdMediaType.ReleaseGroup;
 
         /// <inheritdoc />
         public string UrlFormatString => Plugin.Instance.Configuration.Server + "/release-group/{0}";
@@ -33,7 +33,7 @@ namespace MediaBrowser.Providers.Music
         public string Key => MetadataProviders.MusicBrainzAlbumArtist.ToString();
 
         /// <inheritdoc />
-        public ExternalIdMediaType Type => ExternalIdMediaType.AlbumArtist;
+        public ExternalIdMediaType? Type => ExternalIdMediaType.AlbumArtist;
 
         /// <inheritdoc />
         public string UrlFormatString => Plugin.Instance.Configuration.Server + "/artist/{0}";
@@ -51,7 +51,7 @@ namespace MediaBrowser.Providers.Music
         public string Key => MetadataProviders.MusicBrainzAlbum.ToString();
 
         /// <inheritdoc />
-        public ExternalIdMediaType Type => ExternalIdMediaType.Album;
+        public ExternalIdMediaType? Type => ExternalIdMediaType.Album;
 
         /// <inheritdoc />
         public string UrlFormatString => Plugin.Instance.Configuration.Server + "/release/{0}";
@@ -69,7 +69,7 @@ namespace MediaBrowser.Providers.Music
         public string Key => MetadataProviders.MusicBrainzArtist.ToString();
 
         /// <inheritdoc />
-        public ExternalIdMediaType Type => ExternalIdMediaType.Artist;
+        public ExternalIdMediaType? Type => ExternalIdMediaType.Artist;
 
         /// <inheritdoc />
         public string UrlFormatString => Plugin.Instance.Configuration.Server + "/artist/{0}";
@@ -88,7 +88,7 @@ namespace MediaBrowser.Providers.Music
         public string Key => MetadataProviders.MusicBrainzArtist.ToString();
 
         /// <inheritdoc />
-        public ExternalIdMediaType Type => ExternalIdMediaType.OtherArtist;
+        public ExternalIdMediaType? Type => ExternalIdMediaType.OtherArtist;
 
         /// <inheritdoc />
         public string UrlFormatString => Plugin.Instance.Configuration.Server + "/artist/{0}";
@@ -106,7 +106,7 @@ namespace MediaBrowser.Providers.Music
         public string Key => MetadataProviders.MusicBrainzTrack.ToString();
 
         /// <inheritdoc />
-        public ExternalIdMediaType Type => ExternalIdMediaType.Track;
+        public ExternalIdMediaType? Type => ExternalIdMediaType.Track;
 
         /// <inheritdoc />
         public string UrlFormatString => Plugin.Instance.Configuration.Server + "/track/{0}";

+ 4 - 4
MediaBrowser.Providers/TV/TvExternalIds.cs

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

+ 1 - 1
MediaBrowser.Providers/Tmdb/BoxSets/TmdbBoxSetExternalId.cs

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

+ 1 - 1
MediaBrowser.Providers/Tmdb/Movies/TmdbMovieExternalId.cs

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

+ 1 - 1
MediaBrowser.Providers/Tmdb/People/TmdbPersonExternalId.cs

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

+ 1 - 1
MediaBrowser.Providers/Tmdb/TV/TmdbSeriesExternalId.cs

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