Merge pull request #3258 from aled/2149-fix-a-small-number-of-compile-warnings-1

Fix a small number of compile warnings
This commit is contained in:
Bond-009 2020-06-09 22:22:36 +02:00 committed by GitHub
commit ad5c41b542
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
68 changed files with 235 additions and 235 deletions

View File

@ -2734,7 +2734,7 @@ namespace Emby.Server.Implementations.Data
foreach (var providerId in newItem.ProviderIds) foreach (var providerId in newItem.ProviderIds)
{ {
if (providerId.Key == MetadataProviders.TmdbCollection.ToString()) if (providerId.Key == MetadataProvider.TmdbCollection.ToString())
{ {
continue; continue;
} }
@ -4324,7 +4324,7 @@ namespace Emby.Server.Implementations.Data
var index = 0; var index = 0;
foreach (var pair in query.ExcludeProviderIds) foreach (var pair in query.ExcludeProviderIds)
{ {
if (string.Equals(pair.Key, MetadataProviders.TmdbCollection.ToString(), StringComparison.OrdinalIgnoreCase)) if (string.Equals(pair.Key, MetadataProvider.TmdbCollection.ToString(), StringComparison.OrdinalIgnoreCase))
{ {
continue; continue;
} }
@ -4353,7 +4353,7 @@ namespace Emby.Server.Implementations.Data
var index = 0; var index = 0;
foreach (var pair in query.HasAnyProviderId) foreach (var pair in query.HasAnyProviderId)
{ {
if (string.Equals(pair.Key, MetadataProviders.TmdbCollection.ToString(), StringComparison.OrdinalIgnoreCase)) if (string.Equals(pair.Key, MetadataProvider.TmdbCollection.ToString(), StringComparison.OrdinalIgnoreCase))
{ {
continue; continue;
} }

View File

@ -69,7 +69,7 @@ namespace Emby.Server.Implementations.Library.Resolvers.Movies
if (!string.IsNullOrEmpty(id)) if (!string.IsNullOrEmpty(id))
{ {
item.SetProviderId(MetadataProviders.Tmdb, id); item.SetProviderId(MetadataProvider.Tmdb, id);
} }
} }
} }

View File

@ -350,7 +350,7 @@ namespace Emby.Server.Implementations.Library.Resolvers.Movies
if (!string.IsNullOrWhiteSpace(tmdbid)) if (!string.IsNullOrWhiteSpace(tmdbid))
{ {
item.SetProviderId(MetadataProviders.Tmdb, tmdbid); item.SetProviderId(MetadataProvider.Tmdb, tmdbid);
} }
} }
@ -361,7 +361,7 @@ namespace Emby.Server.Implementations.Library.Resolvers.Movies
if (!string.IsNullOrWhiteSpace(imdbid)) if (!string.IsNullOrWhiteSpace(imdbid))
{ {
item.SetProviderId(MetadataProviders.Imdb, imdbid); item.SetProviderId(MetadataProvider.Imdb, imdbid);
} }
} }
} }

View File

@ -217,7 +217,7 @@ namespace Emby.Server.Implementations.Library.Resolvers.TV
if (!string.IsNullOrEmpty(id)) if (!string.IsNullOrEmpty(id))
{ {
item.SetProviderId(MetadataProviders.Tvdb, id); item.SetProviderId(MetadataProvider.Tvdb, id);
} }
} }
} }

View File

@ -1893,22 +1893,22 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV
writer.WriteStartDocument(true); writer.WriteStartDocument(true);
writer.WriteStartElement("tvshow"); writer.WriteStartElement("tvshow");
string id; string id;
if (timer.SeriesProviderIds.TryGetValue(MetadataProviders.Tvdb.ToString(), out id)) if (timer.SeriesProviderIds.TryGetValue(MetadataProvider.Tvdb.ToString(), out id))
{ {
writer.WriteElementString("id", id); writer.WriteElementString("id", id);
} }
if (timer.SeriesProviderIds.TryGetValue(MetadataProviders.Imdb.ToString(), out id)) if (timer.SeriesProviderIds.TryGetValue(MetadataProvider.Imdb.ToString(), out id))
{ {
writer.WriteElementString("imdb_id", id); writer.WriteElementString("imdb_id", id);
} }
if (timer.SeriesProviderIds.TryGetValue(MetadataProviders.Tmdb.ToString(), out id)) if (timer.SeriesProviderIds.TryGetValue(MetadataProvider.Tmdb.ToString(), out id))
{ {
writer.WriteElementString("tmdbid", id); writer.WriteElementString("tmdbid", id);
} }
if (timer.SeriesProviderIds.TryGetValue(MetadataProviders.Zap2It.ToString(), out id)) if (timer.SeriesProviderIds.TryGetValue(MetadataProvider.Zap2It.ToString(), out id))
{ {
writer.WriteElementString("zap2itid", id); writer.WriteElementString("zap2itid", id);
} }
@ -2075,14 +2075,14 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV
writer.WriteElementString("credits", person); writer.WriteElementString("credits", person);
} }
var tmdbCollection = item.GetProviderId(MetadataProviders.TmdbCollection); var tmdbCollection = item.GetProviderId(MetadataProvider.TmdbCollection);
if (!string.IsNullOrEmpty(tmdbCollection)) if (!string.IsNullOrEmpty(tmdbCollection))
{ {
writer.WriteElementString("collectionnumber", tmdbCollection); writer.WriteElementString("collectionnumber", tmdbCollection);
} }
var imdb = item.GetProviderId(MetadataProviders.Imdb); var imdb = item.GetProviderId(MetadataProvider.Imdb);
if (!string.IsNullOrEmpty(imdb)) if (!string.IsNullOrEmpty(imdb))
{ {
if (!isSeriesEpisode) if (!isSeriesEpisode)
@ -2096,7 +2096,7 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV
lockData = false; lockData = false;
} }
var tvdb = item.GetProviderId(MetadataProviders.Tvdb); var tvdb = item.GetProviderId(MetadataProvider.Tvdb);
if (!string.IsNullOrEmpty(tvdb)) if (!string.IsNullOrEmpty(tvdb))
{ {
writer.WriteElementString("tvdbid", tvdb); writer.WriteElementString("tvdbid", tvdb);
@ -2105,7 +2105,7 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV
lockData = false; lockData = false;
} }
var tmdb = item.GetProviderId(MetadataProviders.Tmdb); var tmdb = item.GetProviderId(MetadataProvider.Tmdb);
if (!string.IsNullOrEmpty(tmdb)) if (!string.IsNullOrEmpty(tmdb))
{ {
writer.WriteElementString("tmdbid", tmdb); writer.WriteElementString("tmdbid", tmdb);

View File

@ -342,7 +342,7 @@ namespace Emby.Server.Implementations.LiveTv.Listings
{ {
info.SeriesId = programId.Substring(0, 10); info.SeriesId = programId.Substring(0, 10);
info.SeriesProviderIds[MetadataProviders.Zap2It.ToString()] = info.SeriesId; info.SeriesProviderIds[MetadataProvider.Zap2It.ToString()] = info.SeriesId;
if (details.metadata != null) if (details.metadata != null)
{ {

View File

@ -655,7 +655,7 @@ namespace MediaBrowser.Api.Library
EnableImages = false EnableImages = false
} }
}).Where(i => string.Equals(request.TvdbId, i.GetProviderId(MetadataProviders.Tvdb), StringComparison.OrdinalIgnoreCase)).ToArray(); }).Where(i => string.Equals(request.TvdbId, i.GetProviderId(MetadataProvider.Tvdb), StringComparison.OrdinalIgnoreCase)).ToArray();
foreach (var item in series) foreach (var item in series)
{ {
@ -688,11 +688,11 @@ namespace MediaBrowser.Api.Library
if (!string.IsNullOrWhiteSpace(request.ImdbId)) if (!string.IsNullOrWhiteSpace(request.ImdbId))
{ {
movies = movies.Where(i => string.Equals(request.ImdbId, i.GetProviderId(MetadataProviders.Imdb), StringComparison.OrdinalIgnoreCase)).ToList(); movies = movies.Where(i => string.Equals(request.ImdbId, i.GetProviderId(MetadataProvider.Imdb), StringComparison.OrdinalIgnoreCase)).ToList();
} }
else if (!string.IsNullOrWhiteSpace(request.TmdbId)) else if (!string.IsNullOrWhiteSpace(request.TmdbId))
{ {
movies = movies.Where(i => string.Equals(request.TmdbId, i.GetProviderId(MetadataProviders.Tmdb), StringComparison.OrdinalIgnoreCase)).ToList(); movies = movies.Where(i => string.Equals(request.TmdbId, i.GetProviderId(MetadataProvider.Tmdb), StringComparison.OrdinalIgnoreCase)).ToList();
} }
else else
{ {

View File

@ -273,7 +273,7 @@ namespace MediaBrowser.Api.Movies
EnableGroupByMetadataKey = true, EnableGroupByMetadataKey = true,
DtoOptions = dtoOptions DtoOptions = dtoOptions
}).GroupBy(i => i.GetProviderId(MetadataProviders.Imdb) ?? Guid.NewGuid().ToString("N", CultureInfo.InvariantCulture)) }).GroupBy(i => i.GetProviderId(MetadataProvider.Imdb) ?? Guid.NewGuid().ToString("N", CultureInfo.InvariantCulture))
.Select(x => x.First()) .Select(x => x.First())
.Take(itemLimit) .Take(itemLimit)
.ToList(); .ToList();
@ -314,7 +314,7 @@ namespace MediaBrowser.Api.Movies
EnableGroupByMetadataKey = true, EnableGroupByMetadataKey = true,
DtoOptions = dtoOptions DtoOptions = dtoOptions
}).GroupBy(i => i.GetProviderId(MetadataProviders.Imdb) ?? Guid.NewGuid().ToString("N", CultureInfo.InvariantCulture)) }).GroupBy(i => i.GetProviderId(MetadataProvider.Imdb) ?? Guid.NewGuid().ToString("N", CultureInfo.InvariantCulture))
.Select(x => x.First()) .Select(x => x.First())
.Take(itemLimit) .Take(itemLimit)
.ToList(); .ToList();

View File

@ -97,14 +97,14 @@ namespace MediaBrowser.Controller.Entities.Audio
list.Insert(0, albumArtist + "-" + Name); list.Insert(0, albumArtist + "-" + Name);
} }
var id = this.GetProviderId(MetadataProviders.MusicBrainzAlbum); var id = this.GetProviderId(MetadataProvider.MusicBrainzAlbum);
if (!string.IsNullOrEmpty(id)) if (!string.IsNullOrEmpty(id))
{ {
list.Insert(0, "MusicAlbum-Musicbrainz-" + id); list.Insert(0, "MusicAlbum-Musicbrainz-" + id);
} }
id = this.GetProviderId(MetadataProviders.MusicBrainzReleaseGroup); id = this.GetProviderId(MetadataProvider.MusicBrainzReleaseGroup);
if (!string.IsNullOrEmpty(id)) if (!string.IsNullOrEmpty(id))
{ {

View File

@ -128,7 +128,7 @@ namespace MediaBrowser.Controller.Entities.Audio
private static List<string> GetUserDataKeys(MusicArtist item) private static List<string> GetUserDataKeys(MusicArtist item)
{ {
var list = new List<string>(); var list = new List<string>();
var id = item.GetProviderId(MetadataProviders.MusicBrainzArtist); var id = item.GetProviderId(MetadataProvider.MusicBrainzArtist);
if (!string.IsNullOrEmpty(id)) if (!string.IsNullOrEmpty(id))
{ {

View File

@ -173,7 +173,7 @@ namespace MediaBrowser.Controller.Entities.Movies
{ {
var list = base.GetRelatedUrls(); var list = base.GetRelatedUrls();
var imdbId = this.GetProviderId(MetadataProviders.Imdb); var imdbId = this.GetProviderId(MetadataProvider.Imdb);
if (!string.IsNullOrEmpty(imdbId)) if (!string.IsNullOrEmpty(imdbId))
{ {
list.Add(new ExternalUrl list.Add(new ExternalUrl

View File

@ -164,13 +164,13 @@ namespace MediaBrowser.Controller.Entities.TV
{ {
var list = base.GetUserDataKeys(); var list = base.GetUserDataKeys();
var key = this.GetProviderId(MetadataProviders.Imdb); var key = this.GetProviderId(MetadataProvider.Imdb);
if (!string.IsNullOrEmpty(key)) if (!string.IsNullOrEmpty(key))
{ {
list.Insert(0, key); list.Insert(0, key);
} }
key = this.GetProviderId(MetadataProviders.Tvdb); key = this.GetProviderId(MetadataProvider.Tvdb);
if (!string.IsNullOrEmpty(key)) if (!string.IsNullOrEmpty(key))
{ {
list.Insert(0, key); list.Insert(0, key);
@ -493,7 +493,7 @@ namespace MediaBrowser.Controller.Entities.TV
{ {
var list = base.GetRelatedUrls(); var list = base.GetRelatedUrls();
var imdbId = this.GetProviderId(MetadataProviders.Imdb); var imdbId = this.GetProviderId(MetadataProvider.Imdb);
if (!string.IsNullOrEmpty(imdbId)) if (!string.IsNullOrEmpty(imdbId))
{ {
list.Add(new ExternalUrl list.Add(new ExternalUrl

View File

@ -80,7 +80,7 @@ namespace MediaBrowser.Controller.Entities
{ {
var list = base.GetRelatedUrls(); var list = base.GetRelatedUrls();
var imdbId = this.GetProviderId(MetadataProviders.Imdb); var imdbId = this.GetProviderId(MetadataProvider.Imdb);
if (!string.IsNullOrEmpty(imdbId)) if (!string.IsNullOrEmpty(imdbId))
{ {
list.Add(new ExternalUrl list.Add(new ExternalUrl

View File

@ -611,7 +611,7 @@ namespace MediaBrowser.Controller.Entities
{ {
var filterValue = query.HasImdbId.Value; var filterValue = query.HasImdbId.Value;
var hasValue = !string.IsNullOrEmpty(item.GetProviderId(MetadataProviders.Imdb)); var hasValue = !string.IsNullOrEmpty(item.GetProviderId(MetadataProvider.Imdb));
if (hasValue != filterValue) if (hasValue != filterValue)
{ {
@ -623,7 +623,7 @@ namespace MediaBrowser.Controller.Entities
{ {
var filterValue = query.HasTmdbId.Value; var filterValue = query.HasTmdbId.Value;
var hasValue = !string.IsNullOrEmpty(item.GetProviderId(MetadataProviders.Tmdb)); var hasValue = !string.IsNullOrEmpty(item.GetProviderId(MetadataProvider.Tmdb));
if (hasValue != filterValue) if (hasValue != filterValue)
{ {
@ -635,7 +635,7 @@ namespace MediaBrowser.Controller.Entities
{ {
var filterValue = query.HasTvdbId.Value; var filterValue = query.HasTvdbId.Value;
var hasValue = !string.IsNullOrEmpty(item.GetProviderId(MetadataProviders.Tvdb)); var hasValue = !string.IsNullOrEmpty(item.GetProviderId(MetadataProvider.Tvdb));
if (hasValue != filterValue) if (hasValue != filterValue)
{ {

View File

@ -272,13 +272,13 @@ namespace MediaBrowser.Controller.Entities
{ {
if (ExtraType.HasValue) if (ExtraType.HasValue)
{ {
var key = this.GetProviderId(MetadataProviders.Tmdb); var key = this.GetProviderId(MetadataProvider.Tmdb);
if (!string.IsNullOrEmpty(key)) if (!string.IsNullOrEmpty(key))
{ {
list.Insert(0, GetUserDataKey(key)); list.Insert(0, GetUserDataKey(key));
} }
key = this.GetProviderId(MetadataProviders.Imdb); key = this.GetProviderId(MetadataProvider.Imdb);
if (!string.IsNullOrEmpty(key)) if (!string.IsNullOrEmpty(key))
{ {
list.Insert(0, GetUserDataKey(key)); list.Insert(0, GetUserDataKey(key));
@ -286,13 +286,13 @@ namespace MediaBrowser.Controller.Entities
} }
else else
{ {
var key = this.GetProviderId(MetadataProviders.Imdb); var key = this.GetProviderId(MetadataProvider.Imdb);
if (!string.IsNullOrEmpty(key)) if (!string.IsNullOrEmpty(key))
{ {
list.Insert(0, key); list.Insert(0, key);
} }
key = this.GetProviderId(MetadataProviders.Tmdb); key = this.GetProviderId(MetadataProvider.Tmdb);
if (!string.IsNullOrEmpty(key)) if (!string.IsNullOrEmpty(key))
{ {
list.Insert(0, key); list.Insert(0, key);

View File

@ -26,13 +26,13 @@ namespace MediaBrowser.Controller.LiveTv
if (!IsSeries) if (!IsSeries)
{ {
var key = this.GetProviderId(MetadataProviders.Imdb); var key = this.GetProviderId(MetadataProvider.Imdb);
if (!string.IsNullOrEmpty(key)) if (!string.IsNullOrEmpty(key))
{ {
list.Insert(0, key); list.Insert(0, key);
} }
key = this.GetProviderId(MetadataProviders.Tmdb); key = this.GetProviderId(MetadataProvider.Tmdb);
if (!string.IsNullOrEmpty(key)) if (!string.IsNullOrEmpty(key))
{ {
list.Insert(0, key); list.Insert(0, key);
@ -253,7 +253,7 @@ namespace MediaBrowser.Controller.LiveTv
{ {
var list = base.GetRelatedUrls(); var list = base.GetRelatedUrls();
var imdbId = this.GetProviderId(MetadataProviders.Imdb); var imdbId = this.GetProviderId(MetadataProvider.Imdb);
if (!string.IsNullOrEmpty(imdbId)) if (!string.IsNullOrEmpty(imdbId))
{ {
if (IsMovie) if (IsMovie)

View File

@ -543,7 +543,7 @@ namespace MediaBrowser.LocalMetadata.Parsers
var tmdbCollection = reader.ReadElementContentAsString(); var tmdbCollection = reader.ReadElementContentAsString();
if (!string.IsNullOrWhiteSpace(tmdbCollection)) if (!string.IsNullOrWhiteSpace(tmdbCollection))
{ {
item.SetProviderId(MetadataProviders.TmdbCollection, tmdbCollection); item.SetProviderId(MetadataProvider.TmdbCollection, tmdbCollection);
} }
break; break;

View File

@ -1057,23 +1057,23 @@ namespace MediaBrowser.MediaEncoding.Probing
// These support mulitple values, but for now we only store the first. // These support mulitple values, but for now we only store the first.
var mb = GetMultipleMusicBrainzId(FFProbeHelpers.GetDictionaryValue(tags, "MusicBrainz Album Artist Id")); var mb = GetMultipleMusicBrainzId(FFProbeHelpers.GetDictionaryValue(tags, "MusicBrainz Album Artist Id"));
if (mb == null) mb = GetMultipleMusicBrainzId(FFProbeHelpers.GetDictionaryValue(tags, "MUSICBRAINZ_ALBUMARTISTID")); if (mb == null) mb = GetMultipleMusicBrainzId(FFProbeHelpers.GetDictionaryValue(tags, "MUSICBRAINZ_ALBUMARTISTID"));
audio.SetProviderId(MetadataProviders.MusicBrainzAlbumArtist, mb); audio.SetProviderId(MetadataProvider.MusicBrainzAlbumArtist, mb);
mb = GetMultipleMusicBrainzId(FFProbeHelpers.GetDictionaryValue(tags, "MusicBrainz Artist Id")); mb = GetMultipleMusicBrainzId(FFProbeHelpers.GetDictionaryValue(tags, "MusicBrainz Artist Id"));
if (mb == null) mb = GetMultipleMusicBrainzId(FFProbeHelpers.GetDictionaryValue(tags, "MUSICBRAINZ_ARTISTID")); if (mb == null) mb = GetMultipleMusicBrainzId(FFProbeHelpers.GetDictionaryValue(tags, "MUSICBRAINZ_ARTISTID"));
audio.SetProviderId(MetadataProviders.MusicBrainzArtist, mb); audio.SetProviderId(MetadataProvider.MusicBrainzArtist, mb);
mb = GetMultipleMusicBrainzId(FFProbeHelpers.GetDictionaryValue(tags, "MusicBrainz Album Id")); mb = GetMultipleMusicBrainzId(FFProbeHelpers.GetDictionaryValue(tags, "MusicBrainz Album Id"));
if (mb == null) mb = GetMultipleMusicBrainzId(FFProbeHelpers.GetDictionaryValue(tags, "MUSICBRAINZ_ALBUMID")); if (mb == null) mb = GetMultipleMusicBrainzId(FFProbeHelpers.GetDictionaryValue(tags, "MUSICBRAINZ_ALBUMID"));
audio.SetProviderId(MetadataProviders.MusicBrainzAlbum, mb); audio.SetProviderId(MetadataProvider.MusicBrainzAlbum, mb);
mb = GetMultipleMusicBrainzId(FFProbeHelpers.GetDictionaryValue(tags, "MusicBrainz Release Group Id")); mb = GetMultipleMusicBrainzId(FFProbeHelpers.GetDictionaryValue(tags, "MusicBrainz Release Group Id"));
if (mb == null) mb = GetMultipleMusicBrainzId(FFProbeHelpers.GetDictionaryValue(tags, "MUSICBRAINZ_RELEASEGROUPID")); if (mb == null) mb = GetMultipleMusicBrainzId(FFProbeHelpers.GetDictionaryValue(tags, "MUSICBRAINZ_RELEASEGROUPID"));
audio.SetProviderId(MetadataProviders.MusicBrainzReleaseGroup, mb); audio.SetProviderId(MetadataProvider.MusicBrainzReleaseGroup, mb);
mb = GetMultipleMusicBrainzId(FFProbeHelpers.GetDictionaryValue(tags, "MusicBrainz Release Track Id")); mb = GetMultipleMusicBrainzId(FFProbeHelpers.GetDictionaryValue(tags, "MusicBrainz Release Track Id"));
if (mb == null) mb = GetMultipleMusicBrainzId(FFProbeHelpers.GetDictionaryValue(tags, "MUSICBRAINZ_RELEASETRACKID")); if (mb == null) mb = GetMultipleMusicBrainzId(FFProbeHelpers.GetDictionaryValue(tags, "MUSICBRAINZ_RELEASETRACKID"));
audio.SetProviderId(MetadataProviders.MusicBrainzTrack, mb); audio.SetProviderId(MetadataProvider.MusicBrainzTrack, mb);
} }
private string GetMultipleMusicBrainzId(string value) private string GetMultipleMusicBrainzId(string value)

View File

@ -5,7 +5,7 @@ namespace MediaBrowser.Model.Entities
/// <summary> /// <summary>
/// Enum MetadataProviders /// Enum MetadataProviders
/// </summary> /// </summary>
public enum MetadataProviders public enum MetadataProvider
{ {
/// <summary> /// <summary>
/// The imdb /// The imdb

View File

@ -14,7 +14,7 @@ namespace MediaBrowser.Model.Entities
/// <param name="instance">The instance.</param> /// <param name="instance">The instance.</param>
/// <param name="provider">The provider.</param> /// <param name="provider">The provider.</param>
/// <returns><c>true</c> if [has provider identifier] [the specified instance]; otherwise, <c>false</c>.</returns> /// <returns><c>true</c> if [has provider identifier] [the specified instance]; otherwise, <c>false</c>.</returns>
public static bool HasProviderId(this IHasProviderIds instance, MetadataProviders provider) public static bool HasProviderId(this IHasProviderIds instance, MetadataProvider provider)
{ {
return !string.IsNullOrEmpty(instance.GetProviderId(provider.ToString())); return !string.IsNullOrEmpty(instance.GetProviderId(provider.ToString()));
} }
@ -25,7 +25,7 @@ namespace MediaBrowser.Model.Entities
/// <param name="instance">The instance.</param> /// <param name="instance">The instance.</param>
/// <param name="provider">The provider.</param> /// <param name="provider">The provider.</param>
/// <returns>System.String.</returns> /// <returns>System.String.</returns>
public static string? GetProviderId(this IHasProviderIds instance, MetadataProviders provider) public static string? GetProviderId(this IHasProviderIds instance, MetadataProvider provider)
{ {
return instance.GetProviderId(provider.ToString()); return instance.GetProviderId(provider.ToString());
} }
@ -94,7 +94,7 @@ namespace MediaBrowser.Model.Entities
/// <param name="instance">The instance.</param> /// <param name="instance">The instance.</param>
/// <param name="provider">The provider.</param> /// <param name="provider">The provider.</param>
/// <param name="value">The value.</param> /// <param name="value">The value.</param>
public static void SetProviderId(this IHasProviderIds instance, MetadataProviders provider, string value) public static void SetProviderId(this IHasProviderIds instance, MetadataProvider provider, string value)
{ {
instance.SetProviderId(provider.ToString(), value); instance.SetProviderId(provider.ToString(), value);
} }

View File

@ -158,11 +158,11 @@ namespace MediaBrowser.Providers.MediaInfo
audio.SetStudios(data.Studios); audio.SetStudios(data.Studios);
} }
audio.SetProviderId(MetadataProviders.MusicBrainzAlbumArtist, data.GetProviderId(MetadataProviders.MusicBrainzAlbumArtist)); audio.SetProviderId(MetadataProvider.MusicBrainzAlbumArtist, data.GetProviderId(MetadataProvider.MusicBrainzAlbumArtist));
audio.SetProviderId(MetadataProviders.MusicBrainzArtist, data.GetProviderId(MetadataProviders.MusicBrainzArtist)); audio.SetProviderId(MetadataProvider.MusicBrainzArtist, data.GetProviderId(MetadataProvider.MusicBrainzArtist));
audio.SetProviderId(MetadataProviders.MusicBrainzAlbum, data.GetProviderId(MetadataProviders.MusicBrainzAlbum)); audio.SetProviderId(MetadataProvider.MusicBrainzAlbum, data.GetProviderId(MetadataProvider.MusicBrainzAlbum));
audio.SetProviderId(MetadataProviders.MusicBrainzReleaseGroup, data.GetProviderId(MetadataProviders.MusicBrainzReleaseGroup)); audio.SetProviderId(MetadataProvider.MusicBrainzReleaseGroup, data.GetProviderId(MetadataProvider.MusicBrainzReleaseGroup));
audio.SetProviderId(MetadataProviders.MusicBrainzTrack, data.GetProviderId(MetadataProviders.MusicBrainzTrack)); audio.SetProviderId(MetadataProvider.MusicBrainzTrack, data.GetProviderId(MetadataProvider.MusicBrainzTrack));
} }
} }
} }

View File

@ -13,7 +13,7 @@ namespace MediaBrowser.Providers.Movies
public string Name => "IMDb"; public string Name => "IMDb";
/// <inheritdoc /> /// <inheritdoc />
public string Key => MetadataProviders.Imdb.ToString(); public string Key => MetadataProvider.Imdb.ToString();
/// <inheritdoc /> /// <inheritdoc />
public string UrlFormatString => "https://www.imdb.com/title/{0}"; public string UrlFormatString => "https://www.imdb.com/title/{0}";
@ -37,7 +37,7 @@ namespace MediaBrowser.Providers.Movies
public string Name => "IMDb"; public string Name => "IMDb";
/// <inheritdoc /> /// <inheritdoc />
public string Key => MetadataProviders.Imdb.ToString(); public string Key => MetadataProvider.Imdb.ToString();
/// <inheritdoc /> /// <inheritdoc />
public string UrlFormatString => "https://www.imdb.com/name/{0}"; public string UrlFormatString => "https://www.imdb.com/name/{0}";

View File

@ -21,11 +21,11 @@ namespace MediaBrowser.Providers.Music
public static string GetReleaseGroupId(this AlbumInfo info) public static string GetReleaseGroupId(this AlbumInfo info)
{ {
var id = info.GetProviderId(MetadataProviders.MusicBrainzReleaseGroup); var id = info.GetProviderId(MetadataProvider.MusicBrainzReleaseGroup);
if (string.IsNullOrEmpty(id)) if (string.IsNullOrEmpty(id))
{ {
return info.SongInfos.Select(i => i.GetProviderId(MetadataProviders.MusicBrainzReleaseGroup)) return info.SongInfos.Select(i => i.GetProviderId(MetadataProvider.MusicBrainzReleaseGroup))
.FirstOrDefault(i => !string.IsNullOrEmpty(i)); .FirstOrDefault(i => !string.IsNullOrEmpty(i));
} }
@ -34,11 +34,11 @@ namespace MediaBrowser.Providers.Music
public static string GetReleaseId(this AlbumInfo info) public static string GetReleaseId(this AlbumInfo info)
{ {
var id = info.GetProviderId(MetadataProviders.MusicBrainzAlbum); var id = info.GetProviderId(MetadataProvider.MusicBrainzAlbum);
if (string.IsNullOrEmpty(id)) if (string.IsNullOrEmpty(id))
{ {
return info.SongInfos.Select(i => i.GetProviderId(MetadataProviders.MusicBrainzAlbum)) return info.SongInfos.Select(i => i.GetProviderId(MetadataProvider.MusicBrainzAlbum))
.FirstOrDefault(i => !string.IsNullOrEmpty(i)); .FirstOrDefault(i => !string.IsNullOrEmpty(i));
} }
@ -47,16 +47,16 @@ namespace MediaBrowser.Providers.Music
public static string GetMusicBrainzArtistId(this AlbumInfo info) public static string GetMusicBrainzArtistId(this AlbumInfo info)
{ {
info.ProviderIds.TryGetValue(MetadataProviders.MusicBrainzAlbumArtist.ToString(), out string id); info.ProviderIds.TryGetValue(MetadataProvider.MusicBrainzAlbumArtist.ToString(), out string id);
if (string.IsNullOrEmpty(id)) if (string.IsNullOrEmpty(id))
{ {
info.ArtistProviderIds.TryGetValue(MetadataProviders.MusicBrainzArtist.ToString(), out id); info.ArtistProviderIds.TryGetValue(MetadataProvider.MusicBrainzArtist.ToString(), out id);
} }
if (string.IsNullOrEmpty(id)) if (string.IsNullOrEmpty(id))
{ {
return info.SongInfos.Select(i => i.GetProviderId(MetadataProviders.MusicBrainzAlbumArtist)) return info.SongInfos.Select(i => i.GetProviderId(MetadataProvider.MusicBrainzAlbumArtist))
.FirstOrDefault(i => !string.IsNullOrEmpty(i)); .FirstOrDefault(i => !string.IsNullOrEmpty(i));
} }
@ -65,11 +65,11 @@ namespace MediaBrowser.Providers.Music
public static string GetMusicBrainzArtistId(this ArtistInfo info) public static string GetMusicBrainzArtistId(this ArtistInfo info)
{ {
info.ProviderIds.TryGetValue(MetadataProviders.MusicBrainzArtist.ToString(), out var id); info.ProviderIds.TryGetValue(MetadataProvider.MusicBrainzArtist.ToString(), out var id);
if (string.IsNullOrEmpty(id)) if (string.IsNullOrEmpty(id))
{ {
return info.SongInfos.Select(i => i.GetProviderId(MetadataProviders.MusicBrainzAlbumArtist)) return info.SongInfos.Select(i => i.GetProviderId(MetadataProvider.MusicBrainzAlbumArtist))
.FirstOrDefault(i => !string.IsNullOrEmpty(i)); .FirstOrDefault(i => !string.IsNullOrEmpty(i));
} }

View File

@ -45,7 +45,7 @@ namespace MediaBrowser.Providers.Plugins.AudioDb
/// <inheritdoc /> /// <inheritdoc />
public async Task<IEnumerable<RemoteImageInfo>> GetImages(BaseItem item, CancellationToken cancellationToken) public async Task<IEnumerable<RemoteImageInfo>> GetImages(BaseItem item, CancellationToken cancellationToken)
{ {
var id = item.GetProviderId(MetadataProviders.MusicBrainzReleaseGroup); var id = item.GetProviderId(MetadataProvider.MusicBrainzReleaseGroup);
if (!string.IsNullOrWhiteSpace(id)) if (!string.IsNullOrWhiteSpace(id))
{ {

View File

@ -104,11 +104,11 @@ namespace MediaBrowser.Providers.Plugins.AudioDb
item.Genres = new[] { result.strGenre }; item.Genres = new[] { result.strGenre };
} }
item.SetProviderId(MetadataProviders.AudioDbArtist, result.idArtist); item.SetProviderId(MetadataProvider.AudioDbArtist, result.idArtist);
item.SetProviderId(MetadataProviders.AudioDbAlbum, result.idAlbum); item.SetProviderId(MetadataProvider.AudioDbAlbum, result.idAlbum);
item.SetProviderId(MetadataProviders.MusicBrainzAlbumArtist, result.strMusicBrainzArtistID); item.SetProviderId(MetadataProvider.MusicBrainzAlbumArtist, result.strMusicBrainzArtistID);
item.SetProviderId(MetadataProviders.MusicBrainzReleaseGroup, result.strMusicBrainzID); item.SetProviderId(MetadataProvider.MusicBrainzReleaseGroup, result.strMusicBrainzID);
string overview = null; string overview = null;

View File

@ -47,7 +47,7 @@ namespace MediaBrowser.Providers.Plugins.AudioDb
/// <inheritdoc /> /// <inheritdoc />
public async Task<IEnumerable<RemoteImageInfo>> GetImages(BaseItem item, CancellationToken cancellationToken) public async Task<IEnumerable<RemoteImageInfo>> GetImages(BaseItem item, CancellationToken cancellationToken)
{ {
var id = item.GetProviderId(MetadataProviders.MusicBrainzArtist); var id = item.GetProviderId(MetadataProvider.MusicBrainzArtist);
if (!string.IsNullOrWhiteSpace(id)) if (!string.IsNullOrWhiteSpace(id))
{ {

View File

@ -92,8 +92,8 @@ namespace MediaBrowser.Providers.Plugins.AudioDb
item.Genres = new[] { result.strGenre }; item.Genres = new[] { result.strGenre };
} }
item.SetProviderId(MetadataProviders.AudioDbArtist, result.idArtist); item.SetProviderId(MetadataProvider.AudioDbArtist, result.idArtist);
item.SetProviderId(MetadataProviders.MusicBrainzArtist, result.strMusicBrainzID); item.SetProviderId(MetadataProvider.MusicBrainzArtist, result.strMusicBrainzID);
string overview = null; string overview = null;

View File

@ -10,7 +10,7 @@ namespace MediaBrowser.Providers.Plugins.AudioDb
public string Name => "TheAudioDb"; public string Name => "TheAudioDb";
/// <inheritdoc /> /// <inheritdoc />
public string Key => MetadataProviders.AudioDbAlbum.ToString(); public string Key => MetadataProvider.AudioDbAlbum.ToString();
/// <inheritdoc /> /// <inheritdoc />
public string UrlFormatString => "https://www.theaudiodb.com/album/{0}"; public string UrlFormatString => "https://www.theaudiodb.com/album/{0}";
@ -25,7 +25,7 @@ namespace MediaBrowser.Providers.Plugins.AudioDb
public string Name => "TheAudioDb Album"; public string Name => "TheAudioDb Album";
/// <inheritdoc /> /// <inheritdoc />
public string Key => MetadataProviders.AudioDbAlbum.ToString(); public string Key => MetadataProvider.AudioDbAlbum.ToString();
/// <inheritdoc /> /// <inheritdoc />
public string UrlFormatString => "https://www.theaudiodb.com/album/{0}"; public string UrlFormatString => "https://www.theaudiodb.com/album/{0}";
@ -40,7 +40,7 @@ namespace MediaBrowser.Providers.Plugins.AudioDb
public string Name => "TheAudioDb"; public string Name => "TheAudioDb";
/// <inheritdoc /> /// <inheritdoc />
public string Key => MetadataProviders.AudioDbArtist.ToString(); public string Key => MetadataProvider.AudioDbArtist.ToString();
/// <inheritdoc /> /// <inheritdoc />
public string UrlFormatString => "https://www.theaudiodb.com/artist/{0}"; public string UrlFormatString => "https://www.theaudiodb.com/artist/{0}";
@ -55,7 +55,7 @@ namespace MediaBrowser.Providers.Plugins.AudioDb
public string Name => "TheAudioDb Artist"; public string Name => "TheAudioDb Artist";
/// <inheritdoc /> /// <inheritdoc />
public string Key => MetadataProviders.AudioDbArtist.ToString(); public string Key => MetadataProvider.AudioDbArtist.ToString();
/// <inheritdoc /> /// <inheritdoc />
public string UrlFormatString => "https://www.theaudiodb.com/artist/{0}"; public string UrlFormatString => "https://www.theaudiodb.com/artist/{0}";

View File

@ -163,17 +163,17 @@ namespace MediaBrowser.Providers.Music
Name = i.Artists[0].Item1 Name = i.Artists[0].Item1
}; };
result.AlbumArtist.SetProviderId(MetadataProviders.MusicBrainzArtist, i.Artists[0].Item2); result.AlbumArtist.SetProviderId(MetadataProvider.MusicBrainzArtist, i.Artists[0].Item2);
} }
if (!string.IsNullOrWhiteSpace(i.ReleaseId)) if (!string.IsNullOrWhiteSpace(i.ReleaseId))
{ {
result.SetProviderId(MetadataProviders.MusicBrainzAlbum, i.ReleaseId); result.SetProviderId(MetadataProvider.MusicBrainzAlbum, i.ReleaseId);
} }
if (!string.IsNullOrWhiteSpace(i.ReleaseGroupId)) if (!string.IsNullOrWhiteSpace(i.ReleaseGroupId))
{ {
result.SetProviderId(MetadataProviders.MusicBrainzReleaseGroup, i.ReleaseGroupId); result.SetProviderId(MetadataProvider.MusicBrainzReleaseGroup, i.ReleaseGroupId);
} }
return result; return result;
@ -247,12 +247,12 @@ namespace MediaBrowser.Providers.Music
{ {
if (!string.IsNullOrEmpty(releaseId)) if (!string.IsNullOrEmpty(releaseId))
{ {
result.Item.SetProviderId(MetadataProviders.MusicBrainzAlbum, releaseId); result.Item.SetProviderId(MetadataProvider.MusicBrainzAlbum, releaseId);
} }
if (!string.IsNullOrEmpty(releaseGroupId)) if (!string.IsNullOrEmpty(releaseGroupId))
{ {
result.Item.SetProviderId(MetadataProviders.MusicBrainzReleaseGroup, releaseGroupId); result.Item.SetProviderId(MetadataProvider.MusicBrainzReleaseGroup, releaseGroupId);
} }
} }

View File

@ -216,7 +216,7 @@ namespace MediaBrowser.Providers.Music
} }
} }
result.SetProviderId(MetadataProviders.MusicBrainzArtist, artistId); result.SetProviderId(MetadataProvider.MusicBrainzArtist, artistId);
if (string.IsNullOrWhiteSpace(artistId) || string.IsNullOrWhiteSpace(result.Name)) if (string.IsNullOrWhiteSpace(artistId) || string.IsNullOrWhiteSpace(result.Name))
{ {
@ -249,7 +249,7 @@ namespace MediaBrowser.Providers.Music
if (singleResult != null) if (singleResult != null)
{ {
musicBrainzId = singleResult.GetProviderId(MetadataProviders.MusicBrainzArtist); musicBrainzId = singleResult.GetProviderId(MetadataProvider.MusicBrainzArtist);
result.Item.Overview = singleResult.Overview; result.Item.Overview = singleResult.Overview;
if (Plugin.Instance.Configuration.ReplaceArtistName) if (Plugin.Instance.Configuration.ReplaceArtistName)
@ -262,7 +262,7 @@ namespace MediaBrowser.Providers.Music
if (!string.IsNullOrWhiteSpace(musicBrainzId)) if (!string.IsNullOrWhiteSpace(musicBrainzId))
{ {
result.HasMetadata = true; result.HasMetadata = true;
result.Item.SetProviderId(MetadataProviders.MusicBrainzArtist, musicBrainzId); result.Item.SetProviderId(MetadataProvider.MusicBrainzArtist, musicBrainzId);
} }
return result; return result;

View File

@ -11,7 +11,7 @@ namespace MediaBrowser.Providers.Music
public string Name => "MusicBrainz Release Group"; public string Name => "MusicBrainz Release Group";
/// <inheritdoc /> /// <inheritdoc />
public string Key => MetadataProviders.MusicBrainzReleaseGroup.ToString(); public string Key => MetadataProvider.MusicBrainzReleaseGroup.ToString();
/// <inheritdoc /> /// <inheritdoc />
public string UrlFormatString => Plugin.Instance.Configuration.Server + "/release-group/{0}"; public string UrlFormatString => Plugin.Instance.Configuration.Server + "/release-group/{0}";
@ -26,7 +26,7 @@ namespace MediaBrowser.Providers.Music
public string Name => "MusicBrainz Album Artist"; public string Name => "MusicBrainz Album Artist";
/// <inheritdoc /> /// <inheritdoc />
public string Key => MetadataProviders.MusicBrainzAlbumArtist.ToString(); public string Key => MetadataProvider.MusicBrainzAlbumArtist.ToString();
/// <inheritdoc /> /// <inheritdoc />
public string UrlFormatString => Plugin.Instance.Configuration.Server + "/artist/{0}"; public string UrlFormatString => Plugin.Instance.Configuration.Server + "/artist/{0}";
@ -41,7 +41,7 @@ namespace MediaBrowser.Providers.Music
public string Name => "MusicBrainz Album"; public string Name => "MusicBrainz Album";
/// <inheritdoc /> /// <inheritdoc />
public string Key => MetadataProviders.MusicBrainzAlbum.ToString(); public string Key => MetadataProvider.MusicBrainzAlbum.ToString();
/// <inheritdoc /> /// <inheritdoc />
public string UrlFormatString => Plugin.Instance.Configuration.Server + "/release/{0}"; public string UrlFormatString => Plugin.Instance.Configuration.Server + "/release/{0}";
@ -56,7 +56,7 @@ namespace MediaBrowser.Providers.Music
public string Name => "MusicBrainz"; public string Name => "MusicBrainz";
/// <inheritdoc /> /// <inheritdoc />
public string Key => MetadataProviders.MusicBrainzArtist.ToString(); public string Key => MetadataProvider.MusicBrainzArtist.ToString();
/// <inheritdoc /> /// <inheritdoc />
public string UrlFormatString => Plugin.Instance.Configuration.Server + "/artist/{0}"; public string UrlFormatString => Plugin.Instance.Configuration.Server + "/artist/{0}";
@ -72,7 +72,7 @@ namespace MediaBrowser.Providers.Music
/// <inheritdoc /> /// <inheritdoc />
public string Key => MetadataProviders.MusicBrainzArtist.ToString(); public string Key => MetadataProvider.MusicBrainzArtist.ToString();
/// <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 Name => "MusicBrainz Track"; public string Name => "MusicBrainz Track";
/// <inheritdoc /> /// <inheritdoc />
public string Key => MetadataProviders.MusicBrainzTrack.ToString(); public string Key => MetadataProvider.MusicBrainzTrack.ToString();
/// <inheritdoc /> /// <inheritdoc />
public string UrlFormatString => Plugin.Instance.Configuration.Server + "/track/{0}"; public string UrlFormatString => Plugin.Instance.Configuration.Server + "/track/{0}";

View File

@ -63,12 +63,12 @@ namespace MediaBrowser.Providers.Plugins.Omdb
return result; return result;
} }
if (info.SeriesProviderIds.TryGetValue(MetadataProviders.Imdb.ToString(), out string seriesImdbId) && !string.IsNullOrEmpty(seriesImdbId)) if (info.SeriesProviderIds.TryGetValue(MetadataProvider.Imdb.ToString(), out string seriesImdbId) && !string.IsNullOrEmpty(seriesImdbId))
{ {
if (info.IndexNumber.HasValue && info.ParentIndexNumber.HasValue) if (info.IndexNumber.HasValue && info.ParentIndexNumber.HasValue)
{ {
result.HasMetadata = await new OmdbProvider(_jsonSerializer, _httpClient, _fileSystem, _appHost, _configurationManager) result.HasMetadata = await new OmdbProvider(_jsonSerializer, _httpClient, _fileSystem, _appHost, _configurationManager)
.FetchEpisodeData(result, info.IndexNumber.Value, info.ParentIndexNumber.Value, info.GetProviderId(MetadataProviders.Imdb), seriesImdbId, info.MetadataLanguage, info.MetadataCountryCode, cancellationToken).ConfigureAwait(false); .FetchEpisodeData(result, info.IndexNumber.Value, info.ParentIndexNumber.Value, info.GetProviderId(MetadataProvider.Imdb), seriesImdbId, info.MetadataLanguage, info.MetadataCountryCode, cancellationToken).ConfigureAwait(false);
} }
} }

View File

@ -42,7 +42,7 @@ namespace MediaBrowser.Providers.Plugins.Omdb
public async Task<IEnumerable<RemoteImageInfo>> GetImages(BaseItem item, CancellationToken cancellationToken) public async Task<IEnumerable<RemoteImageInfo>> GetImages(BaseItem item, CancellationToken cancellationToken)
{ {
var imdbId = item.GetProviderId(MetadataProviders.Imdb); var imdbId = item.GetProviderId(MetadataProvider.Imdb);
var list = new List<RemoteImageInfo>(); var list = new List<RemoteImageInfo>();

View File

@ -68,12 +68,12 @@ namespace MediaBrowser.Providers.Plugins.Omdb
{ {
var episodeSearchInfo = searchInfo as EpisodeInfo; var episodeSearchInfo = searchInfo as EpisodeInfo;
var imdbId = searchInfo.GetProviderId(MetadataProviders.Imdb); var imdbId = searchInfo.GetProviderId(MetadataProvider.Imdb);
var urlQuery = "plot=full&r=json"; var urlQuery = "plot=full&r=json";
if (type == "episode" && episodeSearchInfo != null) if (type == "episode" && episodeSearchInfo != null)
{ {
episodeSearchInfo.SeriesProviderIds.TryGetValue(MetadataProviders.Imdb.ToString(), out imdbId); episodeSearchInfo.SeriesProviderIds.TryGetValue(MetadataProvider.Imdb.ToString(), out imdbId);
} }
var name = searchInfo.Name; var name = searchInfo.Name;
@ -165,7 +165,7 @@ namespace MediaBrowser.Providers.Plugins.Omdb
item.IndexNumberEnd = episodeSearchInfo.IndexNumberEnd.Value; item.IndexNumberEnd = episodeSearchInfo.IndexNumberEnd.Value;
} }
item.SetProviderId(MetadataProviders.Imdb, result.imdbID); item.SetProviderId(MetadataProvider.Imdb, result.imdbID);
if (result.Year.Length > 0 if (result.Year.Length > 0
&& int.TryParse(result.Year.Substring(0, Math.Min(result.Year.Length, 4)), NumberStyles.Integer, CultureInfo.InvariantCulture, out var parsedYear)) && int.TryParse(result.Year.Substring(0, Math.Min(result.Year.Length, 4)), NumberStyles.Integer, CultureInfo.InvariantCulture, out var parsedYear))
@ -210,7 +210,7 @@ namespace MediaBrowser.Providers.Plugins.Omdb
QueriedById = true QueriedById = true
}; };
var imdbId = info.GetProviderId(MetadataProviders.Imdb); var imdbId = info.GetProviderId(MetadataProvider.Imdb);
if (string.IsNullOrWhiteSpace(imdbId)) if (string.IsNullOrWhiteSpace(imdbId))
{ {
imdbId = await GetSeriesImdbId(info, cancellationToken).ConfigureAwait(false); imdbId = await GetSeriesImdbId(info, cancellationToken).ConfigureAwait(false);
@ -219,7 +219,7 @@ namespace MediaBrowser.Providers.Plugins.Omdb
if (!string.IsNullOrEmpty(imdbId)) if (!string.IsNullOrEmpty(imdbId))
{ {
result.Item.SetProviderId(MetadataProviders.Imdb, imdbId); result.Item.SetProviderId(MetadataProvider.Imdb, imdbId);
result.HasMetadata = true; result.HasMetadata = true;
await new OmdbProvider(_jsonSerializer, _httpClient, _fileSystem, _appHost, _configurationManager).Fetch(result, imdbId, info.MetadataLanguage, info.MetadataCountryCode, cancellationToken).ConfigureAwait(false); await new OmdbProvider(_jsonSerializer, _httpClient, _fileSystem, _appHost, _configurationManager).Fetch(result, imdbId, info.MetadataLanguage, info.MetadataCountryCode, cancellationToken).ConfigureAwait(false);
@ -242,7 +242,7 @@ namespace MediaBrowser.Providers.Plugins.Omdb
QueriedById = true QueriedById = true
}; };
var imdbId = info.GetProviderId(MetadataProviders.Imdb); var imdbId = info.GetProviderId(MetadataProvider.Imdb);
if (string.IsNullOrWhiteSpace(imdbId)) if (string.IsNullOrWhiteSpace(imdbId))
{ {
imdbId = await GetMovieImdbId(info, cancellationToken).ConfigureAwait(false); imdbId = await GetMovieImdbId(info, cancellationToken).ConfigureAwait(false);
@ -251,7 +251,7 @@ namespace MediaBrowser.Providers.Plugins.Omdb
if (!string.IsNullOrEmpty(imdbId)) if (!string.IsNullOrEmpty(imdbId))
{ {
result.Item.SetProviderId(MetadataProviders.Imdb, imdbId); result.Item.SetProviderId(MetadataProvider.Imdb, imdbId);
result.HasMetadata = true; result.HasMetadata = true;
await new OmdbProvider(_jsonSerializer, _httpClient, _fileSystem, _appHost, _configurationManager).Fetch(result, imdbId, info.MetadataLanguage, info.MetadataCountryCode, cancellationToken).ConfigureAwait(false); await new OmdbProvider(_jsonSerializer, _httpClient, _fileSystem, _appHost, _configurationManager).Fetch(result, imdbId, info.MetadataLanguage, info.MetadataCountryCode, cancellationToken).ConfigureAwait(false);
@ -264,14 +264,14 @@ namespace MediaBrowser.Providers.Plugins.Omdb
{ {
var results = await GetSearchResultsInternal(info, "movie", false, cancellationToken).ConfigureAwait(false); var results = await GetSearchResultsInternal(info, "movie", false, cancellationToken).ConfigureAwait(false);
var first = results.FirstOrDefault(); var first = results.FirstOrDefault();
return first == null ? null : first.GetProviderId(MetadataProviders.Imdb); return first == null ? null : first.GetProviderId(MetadataProvider.Imdb);
} }
private async Task<string> GetSeriesImdbId(SeriesInfo info, CancellationToken cancellationToken) private async Task<string> GetSeriesImdbId(SeriesInfo info, CancellationToken cancellationToken)
{ {
var results = await GetSearchResultsInternal(info, "series", false, cancellationToken).ConfigureAwait(false); var results = await GetSearchResultsInternal(info, "series", false, cancellationToken).ConfigureAwait(false);
var first = results.FirstOrDefault(); var first = results.FirstOrDefault();
return first == null ? null : first.GetProviderId(MetadataProviders.Imdb); return first == null ? null : first.GetProviderId(MetadataProvider.Imdb);
} }
public Task<HttpResponseInfo> GetImageResponse(string url, CancellationToken cancellationToken) public Task<HttpResponseInfo> GetImageResponse(string url, CancellationToken cancellationToken)

View File

@ -94,7 +94,7 @@ namespace MediaBrowser.Providers.Plugins.Omdb
if (!string.IsNullOrWhiteSpace(result.imdbID)) if (!string.IsNullOrWhiteSpace(result.imdbID))
{ {
item.SetProviderId(MetadataProviders.Imdb, result.imdbID); item.SetProviderId(MetadataProvider.Imdb, result.imdbID);
} }
ParseAdditionalMetadata(itemResult, result); ParseAdditionalMetadata(itemResult, result);
@ -195,7 +195,7 @@ namespace MediaBrowser.Providers.Plugins.Omdb
if (!string.IsNullOrWhiteSpace(result.imdbID)) if (!string.IsNullOrWhiteSpace(result.imdbID))
{ {
item.SetProviderId(MetadataProviders.Imdb, result.imdbID); item.SetProviderId(MetadataProvider.Imdb, result.imdbID);
} }
ParseAdditionalMetadata(itemResult, result); ParseAdditionalMetadata(itemResult, result);
@ -243,7 +243,7 @@ namespace MediaBrowser.Providers.Plugins.Omdb
internal static bool IsValidSeries(Dictionary<string, string> seriesProviderIds) internal static bool IsValidSeries(Dictionary<string, string> seriesProviderIds)
{ {
if (seriesProviderIds.TryGetValue(MetadataProviders.Imdb.ToString(), out string id) && !string.IsNullOrEmpty(id)) if (seriesProviderIds.TryGetValue(MetadataProvider.Imdb.ToString(), out string id) && !string.IsNullOrEmpty(id))
{ {
// This check should ideally never be necessary but we're seeing some cases of this and haven't tracked them down yet. // This check should ideally never be necessary but we're seeing some cases of this and haven't tracked them down yet.
if (!string.IsNullOrWhiteSpace(id)) if (!string.IsNullOrWhiteSpace(id))

View File

@ -173,7 +173,7 @@ namespace MediaBrowser.Providers.Plugins.TheTvdb
string language, string language,
CancellationToken cancellationToken) CancellationToken cancellationToken)
{ {
searchInfo.SeriesProviderIds.TryGetValue(MetadataProviders.Tvdb.ToString(), searchInfo.SeriesProviderIds.TryGetValue(MetadataProvider.Tvdb.ToString(),
out var seriesTvdbId); out var seriesTvdbId);
var episodeQuery = new EpisodeQuery(); var episodeQuery = new EpisodeQuery();

View File

@ -68,7 +68,7 @@ namespace MediaBrowser.Providers.Plugins.TheTvdb
"Episode {SeasonNumber}x{EpisodeNumber} not found for series {SeriesTvdbId}", "Episode {SeasonNumber}x{EpisodeNumber} not found for series {SeriesTvdbId}",
episodeInfo.ParentIndexNumber, episodeInfo.ParentIndexNumber,
episodeInfo.IndexNumber, episodeInfo.IndexNumber,
series.GetProviderId(MetadataProviders.Tvdb)); series.GetProviderId(MetadataProvider.Tvdb));
return imageResult; return imageResult;
} }
@ -85,7 +85,7 @@ namespace MediaBrowser.Providers.Plugins.TheTvdb
} }
catch (TvDbServerException e) catch (TvDbServerException e)
{ {
_logger.LogError(e, "Failed to retrieve episode images for series {TvDbId}", series.GetProviderId(MetadataProviders.Tvdb)); _logger.LogError(e, "Failed to retrieve episode images for series {TvDbId}", series.GetProviderId(MetadataProvider.Tvdb));
} }
} }

View File

@ -94,7 +94,7 @@ namespace MediaBrowser.Providers.Plugins.TheTvdb
QueriedById = true QueriedById = true
}; };
string seriesTvdbId = searchInfo.GetProviderId(MetadataProviders.Tvdb); string seriesTvdbId = searchInfo.GetProviderId(MetadataProvider.Tvdb);
string episodeTvdbId = null; string episodeTvdbId = null;
try try
{ {
@ -143,8 +143,8 @@ namespace MediaBrowser.Providers.Plugins.TheTvdb
result.ResetPeople(); result.ResetPeople();
var item = result.Item; var item = result.Item;
item.SetProviderId(MetadataProviders.Tvdb, episode.Id.ToString()); item.SetProviderId(MetadataProvider.Tvdb, episode.Id.ToString());
item.SetProviderId(MetadataProviders.Imdb, episode.ImdbId); item.SetProviderId(MetadataProvider.Imdb, episode.ImdbId);
if (string.Equals(id.SeriesDisplayOrder, "dvd", StringComparison.OrdinalIgnoreCase)) if (string.Equals(id.SeriesDisplayOrder, "dvd", StringComparison.OrdinalIgnoreCase))
{ {

View File

@ -72,7 +72,7 @@ namespace MediaBrowser.Providers.Plugins.TheTvdb
private async Task<RemoteImageInfo> GetImageFromSeriesData(Series series, string personName, CancellationToken cancellationToken) private async Task<RemoteImageInfo> GetImageFromSeriesData(Series series, string personName, CancellationToken cancellationToken)
{ {
var tvdbId = Convert.ToInt32(series.GetProviderId(MetadataProviders.Tvdb)); var tvdbId = Convert.ToInt32(series.GetProviderId(MetadataProvider.Tvdb));
try try
{ {

View File

@ -58,7 +58,7 @@ namespace MediaBrowser.Providers.Plugins.TheTvdb
return Array.Empty<RemoteImageInfo>(); return Array.Empty<RemoteImageInfo>();
} }
var tvdbId = Convert.ToInt32(series.GetProviderId(MetadataProviders.Tvdb)); var tvdbId = Convert.ToInt32(series.GetProviderId(MetadataProvider.Tvdb));
var seasonNumber = season.IndexNumber.Value; var seasonNumber = season.IndexNumber.Value;
var language = item.GetPreferredMetadataLanguage(); var language = item.GetPreferredMetadataLanguage();
var remoteImages = new List<RemoteImageInfo>(); var remoteImages = new List<RemoteImageInfo>();

View File

@ -58,7 +58,7 @@ namespace MediaBrowser.Providers.Plugins.TheTvdb
var language = item.GetPreferredMetadataLanguage(); var language = item.GetPreferredMetadataLanguage();
var remoteImages = new List<RemoteImageInfo>(); var remoteImages = new List<RemoteImageInfo>();
var keyTypes = new[] { KeyType.Poster, KeyType.Series, KeyType.Fanart }; var keyTypes = new[] { KeyType.Poster, KeyType.Series, KeyType.Fanart };
var tvdbId = Convert.ToInt32(item.GetProviderId(MetadataProviders.Tvdb)); var tvdbId = Convert.ToInt32(item.GetProviderId(MetadataProvider.Tvdb));
foreach (KeyType keyType in keyTypes) foreach (KeyType keyType in keyTypes)
{ {
var imageQuery = new ImagesQuery var imageQuery = new ImagesQuery

View File

@ -95,22 +95,22 @@ namespace MediaBrowser.Providers.Plugins.TheTvdb
{ {
var series = result.Item; var series = result.Item;
if (seriesProviderIds.TryGetValue(MetadataProviders.Tvdb.ToString(), out var tvdbId) && !string.IsNullOrEmpty(tvdbId)) if (seriesProviderIds.TryGetValue(MetadataProvider.Tvdb.ToString(), out var tvdbId) && !string.IsNullOrEmpty(tvdbId))
{ {
series.SetProviderId(MetadataProviders.Tvdb, tvdbId); series.SetProviderId(MetadataProvider.Tvdb, tvdbId);
} }
if (seriesProviderIds.TryGetValue(MetadataProviders.Imdb.ToString(), out var imdbId) && !string.IsNullOrEmpty(imdbId)) if (seriesProviderIds.TryGetValue(MetadataProvider.Imdb.ToString(), out var imdbId) && !string.IsNullOrEmpty(imdbId))
{ {
series.SetProviderId(MetadataProviders.Imdb, imdbId); series.SetProviderId(MetadataProvider.Imdb, imdbId);
tvdbId = await GetSeriesByRemoteId(imdbId, MetadataProviders.Imdb.ToString(), metadataLanguage, tvdbId = await GetSeriesByRemoteId(imdbId, MetadataProvider.Imdb.ToString(), metadataLanguage,
cancellationToken).ConfigureAwait(false); cancellationToken).ConfigureAwait(false);
} }
if (seriesProviderIds.TryGetValue(MetadataProviders.Zap2It.ToString(), out var zap2It) && !string.IsNullOrEmpty(zap2It)) if (seriesProviderIds.TryGetValue(MetadataProvider.Zap2It.ToString(), out var zap2It) && !string.IsNullOrEmpty(zap2It))
{ {
series.SetProviderId(MetadataProviders.Zap2It, zap2It); series.SetProviderId(MetadataProvider.Zap2It, zap2It);
tvdbId = await GetSeriesByRemoteId(zap2It, MetadataProviders.Zap2It.ToString(), metadataLanguage, tvdbId = await GetSeriesByRemoteId(zap2It, MetadataProvider.Zap2It.ToString(), metadataLanguage,
cancellationToken).ConfigureAwait(false); cancellationToken).ConfigureAwait(false);
} }
@ -150,7 +150,7 @@ namespace MediaBrowser.Providers.Plugins.TheTvdb
try try
{ {
if (string.Equals(idType, MetadataProviders.Zap2It.ToString(), StringComparison.OrdinalIgnoreCase)) if (string.Equals(idType, MetadataProvider.Zap2It.ToString(), StringComparison.OrdinalIgnoreCase))
{ {
result = await _tvdbClientManager.GetSeriesByZap2ItIdAsync(id, language, cancellationToken) result = await _tvdbClientManager.GetSeriesByZap2ItIdAsync(id, language, cancellationToken)
.ConfigureAwait(false); .ConfigureAwait(false);
@ -176,9 +176,9 @@ namespace MediaBrowser.Providers.Plugins.TheTvdb
/// <returns>True, if the dictionary contains a valid TV provider ID, otherwise false.</returns> /// <returns>True, if the dictionary contains a valid TV provider ID, otherwise false.</returns>
internal static bool IsValidSeries(Dictionary<string, string> seriesProviderIds) internal static bool IsValidSeries(Dictionary<string, string> seriesProviderIds)
{ {
return seriesProviderIds.ContainsKey(MetadataProviders.Tvdb.ToString()) || return seriesProviderIds.ContainsKey(MetadataProvider.Tvdb.ToString()) ||
seriesProviderIds.ContainsKey(MetadataProviders.Imdb.ToString()) || seriesProviderIds.ContainsKey(MetadataProvider.Imdb.ToString()) ||
seriesProviderIds.ContainsKey(MetadataProviders.Zap2It.ToString()); seriesProviderIds.ContainsKey(MetadataProvider.Zap2It.ToString());
} }
/// <summary> /// <summary>
@ -255,15 +255,15 @@ namespace MediaBrowser.Providers.Plugins.TheTvdb
var seriesSesult = var seriesSesult =
await _tvdbClientManager.GetSeriesByIdAsync(seriesSearchResult.Id, language, cancellationToken) await _tvdbClientManager.GetSeriesByIdAsync(seriesSearchResult.Id, language, cancellationToken)
.ConfigureAwait(false); .ConfigureAwait(false);
remoteSearchResult.SetProviderId(MetadataProviders.Imdb, seriesSesult.Data.ImdbId); remoteSearchResult.SetProviderId(MetadataProvider.Imdb, seriesSesult.Data.ImdbId);
remoteSearchResult.SetProviderId(MetadataProviders.Zap2It, seriesSesult.Data.Zap2itId); remoteSearchResult.SetProviderId(MetadataProvider.Zap2It, seriesSesult.Data.Zap2itId);
} }
catch (TvDbServerException e) catch (TvDbServerException e)
{ {
_logger.LogError(e, "Unable to retrieve series with id {TvdbId}", seriesSearchResult.Id); _logger.LogError(e, "Unable to retrieve series with id {TvdbId}", seriesSearchResult.Id);
} }
remoteSearchResult.SetProviderId(MetadataProviders.Tvdb, seriesSearchResult.Id.ToString()); remoteSearchResult.SetProviderId(MetadataProvider.Tvdb, seriesSearchResult.Id.ToString());
list.Add(new Tuple<List<string>, RemoteSearchResult>(tvdbTitles, remoteSearchResult)); list.Add(new Tuple<List<string>, RemoteSearchResult>(tvdbTitles, remoteSearchResult));
} }
@ -325,15 +325,15 @@ namespace MediaBrowser.Providers.Plugins.TheTvdb
private void MapSeriesToResult(MetadataResult<Series> result, TvDbSharper.Dto.Series tvdbSeries, string metadataLanguage) private void MapSeriesToResult(MetadataResult<Series> result, TvDbSharper.Dto.Series tvdbSeries, string metadataLanguage)
{ {
Series series = result.Item; Series series = result.Item;
series.SetProviderId(MetadataProviders.Tvdb, tvdbSeries.Id.ToString()); series.SetProviderId(MetadataProvider.Tvdb, tvdbSeries.Id.ToString());
series.Name = tvdbSeries.SeriesName; series.Name = tvdbSeries.SeriesName;
series.Overview = (tvdbSeries.Overview ?? string.Empty).Trim(); series.Overview = (tvdbSeries.Overview ?? string.Empty).Trim();
result.ResultLanguage = metadataLanguage; result.ResultLanguage = metadataLanguage;
series.AirDays = TVUtils.GetAirDays(tvdbSeries.AirsDayOfWeek); series.AirDays = TVUtils.GetAirDays(tvdbSeries.AirsDayOfWeek);
series.AirTime = tvdbSeries.AirsTime; series.AirTime = tvdbSeries.AirsTime;
series.CommunityRating = (float?)tvdbSeries.SiteRating; series.CommunityRating = (float?)tvdbSeries.SiteRating;
series.SetProviderId(MetadataProviders.Imdb, tvdbSeries.ImdbId); series.SetProviderId(MetadataProvider.Imdb, tvdbSeries.ImdbId);
series.SetProviderId(MetadataProviders.Zap2It, tvdbSeries.Zap2itId); series.SetProviderId(MetadataProvider.Zap2It, tvdbSeries.Zap2itId);
if (Enum.TryParse(tvdbSeries.Status, true, out SeriesStatus seriesStatus)) if (Enum.TryParse(tvdbSeries.Status, true, out SeriesStatus seriesStatus))
{ {
series.Status = seriesStatus; series.Status = seriesStatus;
@ -411,7 +411,7 @@ namespace MediaBrowser.Providers.Plugins.TheTvdb
public async Task Identify(SeriesInfo info) public async Task Identify(SeriesInfo info)
{ {
if (!string.IsNullOrWhiteSpace(info.GetProviderId(MetadataProviders.Tvdb))) if (!string.IsNullOrWhiteSpace(info.GetProviderId(MetadataProvider.Tvdb)))
{ {
return; return;
} }
@ -423,8 +423,8 @@ namespace MediaBrowser.Providers.Plugins.TheTvdb
if (entry != null) if (entry != null)
{ {
var id = entry.GetProviderId(MetadataProviders.Tvdb); var id = entry.GetProviderId(MetadataProvider.Tvdb);
info.SetProviderId(MetadataProviders.Tvdb, id); info.SetProviderId(MetadataProvider.Tvdb, id);
} }
} }

View File

@ -11,7 +11,7 @@ namespace MediaBrowser.Providers.Plugins.Tmdb.BoxSets
public string Name => TmdbUtils.ProviderName; public string Name => TmdbUtils.ProviderName;
/// <inheritdoc /> /// <inheritdoc />
public string Key => MetadataProviders.TmdbCollection.ToString(); public string Key => MetadataProvider.TmdbCollection.ToString();
/// <inheritdoc /> /// <inheritdoc />
public string UrlFormatString => TmdbUtils.BaseTmdbUrl + "collection/{0}"; public string UrlFormatString => TmdbUtils.BaseTmdbUrl + "collection/{0}";

View File

@ -45,7 +45,7 @@ namespace MediaBrowser.Providers.Plugins.Tmdb.BoxSets
public async Task<IEnumerable<RemoteImageInfo>> GetImages(BaseItem item, CancellationToken cancellationToken) public async Task<IEnumerable<RemoteImageInfo>> GetImages(BaseItem item, CancellationToken cancellationToken)
{ {
var tmdbId = item.GetProviderId(MetadataProviders.Tmdb); var tmdbId = item.GetProviderId(MetadataProvider.Tmdb);
if (!string.IsNullOrEmpty(tmdbId)) if (!string.IsNullOrEmpty(tmdbId))
{ {

View File

@ -60,7 +60,7 @@ namespace MediaBrowser.Providers.Plugins.Tmdb.BoxSets
public async Task<IEnumerable<RemoteSearchResult>> GetSearchResults(BoxSetInfo searchInfo, CancellationToken cancellationToken) public async Task<IEnumerable<RemoteSearchResult>> GetSearchResults(BoxSetInfo searchInfo, CancellationToken cancellationToken)
{ {
var tmdbId = searchInfo.GetProviderId(MetadataProviders.Tmdb); var tmdbId = searchInfo.GetProviderId(MetadataProvider.Tmdb);
if (!string.IsNullOrEmpty(tmdbId)) if (!string.IsNullOrEmpty(tmdbId))
{ {
@ -82,7 +82,7 @@ namespace MediaBrowser.Providers.Plugins.Tmdb.BoxSets
ImageUrl = images.Count == 0 ? null : (tmdbImageUrl + images[0].File_Path) ImageUrl = images.Count == 0 ? null : (tmdbImageUrl + images[0].File_Path)
}; };
result.SetProviderId(MetadataProviders.Tmdb, info.Id.ToString(_usCulture)); result.SetProviderId(MetadataProvider.Tmdb, info.Id.ToString(_usCulture));
return new[] { result }; return new[] { result };
} }
@ -92,7 +92,7 @@ namespace MediaBrowser.Providers.Plugins.Tmdb.BoxSets
public async Task<MetadataResult<BoxSet>> GetMetadata(BoxSetInfo id, CancellationToken cancellationToken) public async Task<MetadataResult<BoxSet>> GetMetadata(BoxSetInfo id, CancellationToken cancellationToken)
{ {
var tmdbId = id.GetProviderId(MetadataProviders.Tmdb); var tmdbId = id.GetProviderId(MetadataProvider.Tmdb);
// We don't already have an Id, need to fetch it // We don't already have an Id, need to fetch it
if (string.IsNullOrEmpty(tmdbId)) if (string.IsNullOrEmpty(tmdbId))
@ -103,7 +103,7 @@ namespace MediaBrowser.Providers.Plugins.Tmdb.BoxSets
if (searchResult != null) if (searchResult != null)
{ {
tmdbId = searchResult.GetProviderId(MetadataProviders.Tmdb); tmdbId = searchResult.GetProviderId(MetadataProvider.Tmdb);
} }
} }
@ -150,7 +150,7 @@ namespace MediaBrowser.Providers.Plugins.Tmdb.BoxSets
Overview = obj.Overview Overview = obj.Overview
}; };
item.SetProviderId(MetadataProviders.Tmdb, obj.Id.ToString(_usCulture)); item.SetProviderId(MetadataProvider.Tmdb, obj.Id.ToString(_usCulture));
return item; return item;
} }

View File

@ -38,8 +38,8 @@ namespace MediaBrowser.Providers.Plugins.Tmdb.Movies
public async Task<MetadataResult<T>> GetMetadata(ItemLookupInfo itemId, CancellationToken cancellationToken) public async Task<MetadataResult<T>> GetMetadata(ItemLookupInfo itemId, CancellationToken cancellationToken)
{ {
var tmdbId = itemId.GetProviderId(MetadataProviders.Tmdb); var tmdbId = itemId.GetProviderId(MetadataProvider.Tmdb);
var imdbId = itemId.GetProviderId(MetadataProviders.Imdb); var imdbId = itemId.GetProviderId(MetadataProvider.Imdb);
// Don't search for music video id's because it is very easy to misidentify. // Don't search for music video id's because it is very easy to misidentify.
if (string.IsNullOrEmpty(tmdbId) && string.IsNullOrEmpty(imdbId) && typeof(T) != typeof(MusicVideo)) if (string.IsNullOrEmpty(tmdbId) && string.IsNullOrEmpty(imdbId) && typeof(T) != typeof(MusicVideo))
@ -50,7 +50,7 @@ namespace MediaBrowser.Providers.Plugins.Tmdb.Movies
if (searchResult != null) if (searchResult != null)
{ {
tmdbId = searchResult.GetProviderId(MetadataProviders.Tmdb); tmdbId = searchResult.GetProviderId(MetadataProvider.Tmdb);
} }
} }
@ -146,12 +146,12 @@ namespace MediaBrowser.Providers.Plugins.Tmdb.Movies
.ToArray(); .ToArray();
} }
movie.SetProviderId(MetadataProviders.Tmdb, movieData.Id.ToString(_usCulture)); movie.SetProviderId(MetadataProvider.Tmdb, movieData.Id.ToString(_usCulture));
movie.SetProviderId(MetadataProviders.Imdb, movieData.Imdb_Id); movie.SetProviderId(MetadataProvider.Imdb, movieData.Imdb_Id);
if (movieData.Belongs_To_Collection != null) if (movieData.Belongs_To_Collection != null)
{ {
movie.SetProviderId(MetadataProviders.TmdbCollection, movie.SetProviderId(MetadataProvider.TmdbCollection,
movieData.Belongs_To_Collection.Id.ToString(CultureInfo.InvariantCulture)); movieData.Belongs_To_Collection.Id.ToString(CultureInfo.InvariantCulture));
if (movie is Movie movieItem) if (movie is Movie movieItem)
@ -240,7 +240,7 @@ namespace MediaBrowser.Providers.Plugins.Tmdb.Movies
if (actor.Id > 0) if (actor.Id > 0)
{ {
personInfo.SetProviderId(MetadataProviders.Tmdb, actor.Id.ToString(CultureInfo.InvariantCulture)); personInfo.SetProviderId(MetadataProvider.Tmdb, actor.Id.ToString(CultureInfo.InvariantCulture));
} }
resultItem.AddPerson(personInfo); resultItem.AddPerson(personInfo);
@ -282,7 +282,7 @@ namespace MediaBrowser.Providers.Plugins.Tmdb.Movies
if (person.Id > 0) if (person.Id > 0)
{ {
personInfo.SetProviderId(MetadataProviders.Tmdb, person.Id.ToString(CultureInfo.InvariantCulture)); personInfo.SetProviderId(MetadataProvider.Tmdb, person.Id.ToString(CultureInfo.InvariantCulture));
} }
resultItem.AddPerson(personInfo); resultItem.AddPerson(personInfo);

View File

@ -158,11 +158,11 @@ namespace MediaBrowser.Providers.Plugins.Tmdb.Movies
/// <returns>Task{MovieImages}.</returns> /// <returns>Task{MovieImages}.</returns>
private async Task<Images> FetchImages(BaseItem item, string language, IJsonSerializer jsonSerializer, CancellationToken cancellationToken) private async Task<Images> FetchImages(BaseItem item, string language, IJsonSerializer jsonSerializer, CancellationToken cancellationToken)
{ {
var tmdbId = item.GetProviderId(MetadataProviders.Tmdb); var tmdbId = item.GetProviderId(MetadataProvider.Tmdb);
if (string.IsNullOrWhiteSpace(tmdbId)) if (string.IsNullOrWhiteSpace(tmdbId))
{ {
var imdbId = item.GetProviderId(MetadataProviders.Imdb); var imdbId = item.GetProviderId(MetadataProvider.Imdb);
if (!string.IsNullOrWhiteSpace(imdbId)) if (!string.IsNullOrWhiteSpace(imdbId))
{ {
var movieInfo = await TmdbMovieProvider.Current.FetchMainResult(imdbId, false, language, cancellationToken).ConfigureAwait(false); var movieInfo = await TmdbMovieProvider.Current.FetchMainResult(imdbId, false, language, cancellationToken).ConfigureAwait(false);

View File

@ -12,7 +12,7 @@ namespace MediaBrowser.Providers.Plugins.Tmdb.Movies
public string Name => TmdbUtils.ProviderName; public string Name => TmdbUtils.ProviderName;
/// <inheritdoc /> /// <inheritdoc />
public string Key => MetadataProviders.Tmdb.ToString(); public string Key => MetadataProvider.Tmdb.ToString();
/// <inheritdoc /> /// <inheritdoc />
public string UrlFormatString => TmdbUtils.BaseTmdbUrl + "movie/{0}"; public string UrlFormatString => TmdbUtils.BaseTmdbUrl + "movie/{0}";

View File

@ -67,7 +67,7 @@ namespace MediaBrowser.Providers.Plugins.Tmdb.Movies
public async Task<IEnumerable<RemoteSearchResult>> GetMovieSearchResults(ItemLookupInfo searchInfo, CancellationToken cancellationToken) public async Task<IEnumerable<RemoteSearchResult>> GetMovieSearchResults(ItemLookupInfo searchInfo, CancellationToken cancellationToken)
{ {
var tmdbId = searchInfo.GetProviderId(MetadataProviders.Tmdb); var tmdbId = searchInfo.GetProviderId(MetadataProvider.Tmdb);
if (!string.IsNullOrEmpty(tmdbId)) if (!string.IsNullOrEmpty(tmdbId))
{ {
@ -100,11 +100,11 @@ namespace MediaBrowser.Providers.Plugins.Tmdb.Movies
} }
} }
remoteResult.SetProviderId(MetadataProviders.Tmdb, obj.Id.ToString(_usCulture)); remoteResult.SetProviderId(MetadataProvider.Tmdb, obj.Id.ToString(_usCulture));
if (!string.IsNullOrWhiteSpace(obj.Imdb_Id)) if (!string.IsNullOrWhiteSpace(obj.Imdb_Id))
{ {
remoteResult.SetProviderId(MetadataProviders.Imdb, obj.Imdb_Id); remoteResult.SetProviderId(MetadataProvider.Imdb, obj.Imdb_Id);
} }
return new[] { remoteResult }; return new[] { remoteResult };

View File

@ -199,7 +199,7 @@ namespace MediaBrowser.Providers.Plugins.Tmdb.Movies
} }
} }
remoteResult.SetProviderId(MetadataProviders.Tmdb, i.Id.ToString(_usCulture)); remoteResult.SetProviderId(MetadataProvider.Tmdb, i.Id.ToString(_usCulture));
return remoteResult; return remoteResult;
@ -252,7 +252,7 @@ namespace MediaBrowser.Providers.Plugins.Tmdb.Movies
} }
} }
remoteResult.SetProviderId(MetadataProviders.Tmdb, i.Id.ToString(_usCulture)); remoteResult.SetProviderId(MetadataProvider.Tmdb, i.Id.ToString(_usCulture));
return remoteResult; return remoteResult;

View File

@ -10,7 +10,7 @@ namespace MediaBrowser.Providers.Plugins.Tmdb.People
public string Name => TmdbUtils.ProviderName; public string Name => TmdbUtils.ProviderName;
/// <inheritdoc /> /// <inheritdoc />
public string Key => MetadataProviders.Tmdb.ToString(); public string Key => MetadataProvider.Tmdb.ToString();
/// <inheritdoc /> /// <inheritdoc />
public string UrlFormatString => TmdbUtils.BaseTmdbUrl + "person/{0}"; public string UrlFormatString => TmdbUtils.BaseTmdbUrl + "person/{0}";

View File

@ -49,7 +49,7 @@ namespace MediaBrowser.Providers.Plugins.Tmdb.People
public async Task<IEnumerable<RemoteImageInfo>> GetImages(BaseItem item, CancellationToken cancellationToken) public async Task<IEnumerable<RemoteImageInfo>> GetImages(BaseItem item, CancellationToken cancellationToken)
{ {
var person = (Person)item; var person = (Person)item;
var id = person.GetProviderId(MetadataProviders.Tmdb); var id = person.GetProviderId(MetadataProvider.Tmdb);
if (!string.IsNullOrEmpty(id)) if (!string.IsNullOrEmpty(id))
{ {

View File

@ -56,7 +56,7 @@ namespace MediaBrowser.Providers.Plugins.Tmdb.People
public async Task<IEnumerable<RemoteSearchResult>> GetSearchResults(PersonLookupInfo searchInfo, CancellationToken cancellationToken) public async Task<IEnumerable<RemoteSearchResult>> GetSearchResults(PersonLookupInfo searchInfo, CancellationToken cancellationToken)
{ {
var tmdbId = searchInfo.GetProviderId(MetadataProviders.Tmdb); var tmdbId = searchInfo.GetProviderId(MetadataProvider.Tmdb);
var tmdbSettings = await TmdbMovieProvider.Current.GetTmdbSettings(cancellationToken).ConfigureAwait(false); var tmdbSettings = await TmdbMovieProvider.Current.GetTmdbSettings(cancellationToken).ConfigureAwait(false);
@ -80,8 +80,8 @@ namespace MediaBrowser.Providers.Plugins.Tmdb.People
ImageUrl = images.Count == 0 ? null : (tmdbImageUrl + images[0].File_Path) ImageUrl = images.Count == 0 ? null : (tmdbImageUrl + images[0].File_Path)
}; };
result.SetProviderId(MetadataProviders.Tmdb, info.Id.ToString(_usCulture)); result.SetProviderId(MetadataProvider.Tmdb, info.Id.ToString(_usCulture));
result.SetProviderId(MetadataProviders.Imdb, info.Imdb_Id); result.SetProviderId(MetadataProvider.Imdb, info.Imdb_Id);
return new[] { result }; return new[] { result };
} }
@ -123,14 +123,14 @@ namespace MediaBrowser.Providers.Plugins.Tmdb.People
ImageUrl = string.IsNullOrEmpty(i.Profile_Path) ? null : baseImageUrl + i.Profile_Path ImageUrl = string.IsNullOrEmpty(i.Profile_Path) ? null : baseImageUrl + i.Profile_Path
}; };
result.SetProviderId(MetadataProviders.Tmdb, i.Id.ToString(_usCulture)); result.SetProviderId(MetadataProvider.Tmdb, i.Id.ToString(_usCulture));
return result; return result;
} }
public async Task<MetadataResult<Person>> GetMetadata(PersonLookupInfo id, CancellationToken cancellationToken) public async Task<MetadataResult<Person>> GetMetadata(PersonLookupInfo id, CancellationToken cancellationToken)
{ {
var tmdbId = id.GetProviderId(MetadataProviders.Tmdb); var tmdbId = id.GetProviderId(MetadataProvider.Tmdb);
// We don't already have an Id, need to fetch it // We don't already have an Id, need to fetch it
if (string.IsNullOrEmpty(tmdbId)) if (string.IsNullOrEmpty(tmdbId))
@ -185,11 +185,11 @@ namespace MediaBrowser.Providers.Plugins.Tmdb.People
item.EndDate = date.ToUniversalTime(); item.EndDate = date.ToUniversalTime();
} }
item.SetProviderId(MetadataProviders.Tmdb, info.Id.ToString(_usCulture)); item.SetProviderId(MetadataProvider.Tmdb, info.Id.ToString(_usCulture));
if (!string.IsNullOrEmpty(info.Imdb_Id)) if (!string.IsNullOrEmpty(info.Imdb_Id))
{ {
item.SetProviderId(MetadataProviders.Imdb, info.Imdb_Id); item.SetProviderId(MetadataProvider.Imdb, info.Imdb_Id);
} }
result.HasMetadata = true; result.HasMetadata = true;
@ -211,7 +211,7 @@ namespace MediaBrowser.Providers.Plugins.Tmdb.People
{ {
var results = await GetSearchResults(info, cancellationToken).ConfigureAwait(false); var results = await GetSearchResults(info, cancellationToken).ConfigureAwait(false);
return results.Select(i => i.GetProviderId(MetadataProviders.Tmdb)).FirstOrDefault(); return results.Select(i => i.GetProviderId(MetadataProvider.Tmdb)).FirstOrDefault();
} }
internal async Task EnsurePersonInfo(string id, CancellationToken cancellationToken) internal async Task EnsurePersonInfo(string id, CancellationToken cancellationToken)

View File

@ -41,7 +41,7 @@ namespace MediaBrowser.Providers.Plugins.Tmdb.TV
var episode = (Controller.Entities.TV.Episode)item; var episode = (Controller.Entities.TV.Episode)item;
var series = episode.Series; var series = episode.Series;
var seriesId = series != null ? series.GetProviderId(MetadataProviders.Tmdb) : null; var seriesId = series != null ? series.GetProviderId(MetadataProvider.Tmdb) : null;
var list = new List<RemoteImageInfo>(); var list = new List<RemoteImageInfo>();

View File

@ -71,7 +71,7 @@ namespace MediaBrowser.Providers.Plugins.Tmdb.TV
return result; return result;
} }
info.SeriesProviderIds.TryGetValue(MetadataProviders.Tmdb.ToString(), out string seriesTmdbId); info.SeriesProviderIds.TryGetValue(MetadataProvider.Tmdb.ToString(), out string seriesTmdbId);
if (string.IsNullOrEmpty(seriesTmdbId)) if (string.IsNullOrEmpty(seriesTmdbId))
{ {
@ -109,7 +109,7 @@ namespace MediaBrowser.Providers.Plugins.Tmdb.TV
if (response.External_Ids.Tvdb_Id > 0) if (response.External_Ids.Tvdb_Id > 0)
{ {
item.SetProviderId(MetadataProviders.Tvdb, response.External_Ids.Tvdb_Id.ToString(CultureInfo.InvariantCulture)); item.SetProviderId(MetadataProvider.Tvdb, response.External_Ids.Tvdb_Id.ToString(CultureInfo.InvariantCulture));
} }
item.PremiereDate = response.Air_Date; item.PremiereDate = response.Air_Date;

View File

@ -48,7 +48,7 @@ namespace MediaBrowser.Providers.Plugins.Tmdb.TV
var season = (Season)item; var season = (Season)item;
var series = season.Series; var series = season.Series;
var seriesId = series?.GetProviderId(MetadataProviders.Tmdb); var seriesId = series?.GetProviderId(MetadataProvider.Tmdb);
if (string.IsNullOrEmpty(seriesId)) if (string.IsNullOrEmpty(seriesId))
{ {

View File

@ -48,7 +48,7 @@ namespace MediaBrowser.Providers.Plugins.Tmdb.TV
{ {
var result = new MetadataResult<Season>(); var result = new MetadataResult<Season>();
info.SeriesProviderIds.TryGetValue(MetadataProviders.Tmdb.ToString(), out string seriesTmdbId); info.SeriesProviderIds.TryGetValue(MetadataProvider.Tmdb.ToString(), out string seriesTmdbId);
var seasonNumber = info.IndexNumber; var seasonNumber = info.IndexNumber;
@ -73,7 +73,7 @@ namespace MediaBrowser.Providers.Plugins.Tmdb.TV
if (seasonInfo.External_Ids.Tvdb_Id > 0) if (seasonInfo.External_Ids.Tvdb_Id > 0)
{ {
result.Item.SetProviderId(MetadataProviders.Tvdb, seasonInfo.External_Ids.Tvdb_Id.ToString(CultureInfo.InvariantCulture)); result.Item.SetProviderId(MetadataProvider.Tvdb, seasonInfo.External_Ids.Tvdb_Id.ToString(CultureInfo.InvariantCulture));
} }
var credits = seasonInfo.Credits; var credits = seasonInfo.Credits;

View File

@ -10,7 +10,7 @@ namespace MediaBrowser.Providers.Plugins.Tmdb.TV
public string Name => TmdbUtils.ProviderName; public string Name => TmdbUtils.ProviderName;
/// <inheritdoc /> /// <inheritdoc />
public string Key => MetadataProviders.Tmdb.ToString(); public string Key => MetadataProvider.Tmdb.ToString();
/// <inheritdoc /> /// <inheritdoc />
public string UrlFormatString => TmdbUtils.BaseTmdbUrl + "tv/{0}"; public string UrlFormatString => TmdbUtils.BaseTmdbUrl + "tv/{0}";

View File

@ -151,7 +151,7 @@ namespace MediaBrowser.Providers.Plugins.Tmdb.TV
private async Task<Images> FetchImages(BaseItem item, string language, IJsonSerializer jsonSerializer, private async Task<Images> FetchImages(BaseItem item, string language, IJsonSerializer jsonSerializer,
CancellationToken cancellationToken) CancellationToken cancellationToken)
{ {
var tmdbId = item.GetProviderId(MetadataProviders.Tmdb); var tmdbId = item.GetProviderId(MetadataProvider.Tmdb);
if (string.IsNullOrEmpty(tmdbId)) if (string.IsNullOrEmpty(tmdbId))
{ {

View File

@ -63,7 +63,7 @@ namespace MediaBrowser.Providers.Plugins.Tmdb.TV
public async Task<IEnumerable<RemoteSearchResult>> GetSearchResults(SeriesInfo searchInfo, CancellationToken cancellationToken) public async Task<IEnumerable<RemoteSearchResult>> GetSearchResults(SeriesInfo searchInfo, CancellationToken cancellationToken)
{ {
var tmdbId = searchInfo.GetProviderId(MetadataProviders.Tmdb); var tmdbId = searchInfo.GetProviderId(MetadataProvider.Tmdb);
if (!string.IsNullOrEmpty(tmdbId)) if (!string.IsNullOrEmpty(tmdbId))
{ {
@ -85,18 +85,18 @@ namespace MediaBrowser.Providers.Plugins.Tmdb.TV
ImageUrl = string.IsNullOrWhiteSpace(obj.Poster_Path) ? null : tmdbImageUrl + obj.Poster_Path ImageUrl = string.IsNullOrWhiteSpace(obj.Poster_Path) ? null : tmdbImageUrl + obj.Poster_Path
}; };
remoteResult.SetProviderId(MetadataProviders.Tmdb, obj.Id.ToString(_usCulture)); remoteResult.SetProviderId(MetadataProvider.Tmdb, obj.Id.ToString(_usCulture));
remoteResult.SetProviderId(MetadataProviders.Imdb, obj.External_Ids.Imdb_Id); remoteResult.SetProviderId(MetadataProvider.Imdb, obj.External_Ids.Imdb_Id);
if (obj.External_Ids.Tvdb_Id > 0) if (obj.External_Ids.Tvdb_Id > 0)
{ {
remoteResult.SetProviderId(MetadataProviders.Tvdb, obj.External_Ids.Tvdb_Id.ToString(_usCulture)); remoteResult.SetProviderId(MetadataProvider.Tvdb, obj.External_Ids.Tvdb_Id.ToString(_usCulture));
} }
return new[] { remoteResult }; return new[] { remoteResult };
} }
var imdbId = searchInfo.GetProviderId(MetadataProviders.Imdb); var imdbId = searchInfo.GetProviderId(MetadataProvider.Imdb);
if (!string.IsNullOrEmpty(imdbId)) if (!string.IsNullOrEmpty(imdbId))
{ {
@ -108,7 +108,7 @@ namespace MediaBrowser.Providers.Plugins.Tmdb.TV
} }
} }
var tvdbId = searchInfo.GetProviderId(MetadataProviders.Tvdb); var tvdbId = searchInfo.GetProviderId(MetadataProvider.Tvdb);
if (!string.IsNullOrEmpty(tvdbId)) if (!string.IsNullOrEmpty(tvdbId))
{ {
@ -128,11 +128,11 @@ namespace MediaBrowser.Providers.Plugins.Tmdb.TV
var result = new MetadataResult<Series>(); var result = new MetadataResult<Series>();
result.QueriedById = true; result.QueriedById = true;
var tmdbId = info.GetProviderId(MetadataProviders.Tmdb); var tmdbId = info.GetProviderId(MetadataProvider.Tmdb);
if (string.IsNullOrEmpty(tmdbId)) if (string.IsNullOrEmpty(tmdbId))
{ {
var imdbId = info.GetProviderId(MetadataProviders.Imdb); var imdbId = info.GetProviderId(MetadataProvider.Imdb);
if (!string.IsNullOrEmpty(imdbId)) if (!string.IsNullOrEmpty(imdbId))
{ {
@ -140,14 +140,14 @@ namespace MediaBrowser.Providers.Plugins.Tmdb.TV
if (searchResult != null) if (searchResult != null)
{ {
tmdbId = searchResult.GetProviderId(MetadataProviders.Tmdb); tmdbId = searchResult.GetProviderId(MetadataProvider.Tmdb);
} }
} }
} }
if (string.IsNullOrEmpty(tmdbId)) if (string.IsNullOrEmpty(tmdbId))
{ {
var tvdbId = info.GetProviderId(MetadataProviders.Tvdb); var tvdbId = info.GetProviderId(MetadataProvider.Tvdb);
if (!string.IsNullOrEmpty(tvdbId)) if (!string.IsNullOrEmpty(tvdbId))
{ {
@ -155,7 +155,7 @@ namespace MediaBrowser.Providers.Plugins.Tmdb.TV
if (searchResult != null) if (searchResult != null)
{ {
tmdbId = searchResult.GetProviderId(MetadataProviders.Tmdb); tmdbId = searchResult.GetProviderId(MetadataProvider.Tmdb);
} }
} }
} }
@ -169,7 +169,7 @@ namespace MediaBrowser.Providers.Plugins.Tmdb.TV
if (searchResult != null) if (searchResult != null)
{ {
tmdbId = searchResult.GetProviderId(MetadataProviders.Tmdb); tmdbId = searchResult.GetProviderId(MetadataProvider.Tmdb);
} }
} }
@ -219,7 +219,7 @@ namespace MediaBrowser.Providers.Plugins.Tmdb.TV
series.Name = seriesInfo.Name; series.Name = seriesInfo.Name;
series.OriginalTitle = seriesInfo.Original_Name; series.OriginalTitle = seriesInfo.Original_Name;
series.SetProviderId(MetadataProviders.Tmdb, seriesInfo.Id.ToString(_usCulture)); series.SetProviderId(MetadataProvider.Tmdb, seriesInfo.Id.ToString(_usCulture));
string voteAvg = seriesInfo.Vote_Average.ToString(CultureInfo.InvariantCulture); string voteAvg = seriesInfo.Vote_Average.ToString(CultureInfo.InvariantCulture);
@ -261,17 +261,17 @@ namespace MediaBrowser.Providers.Plugins.Tmdb.TV
{ {
if (!string.IsNullOrWhiteSpace(ids.Imdb_Id)) if (!string.IsNullOrWhiteSpace(ids.Imdb_Id))
{ {
series.SetProviderId(MetadataProviders.Imdb, ids.Imdb_Id); series.SetProviderId(MetadataProvider.Imdb, ids.Imdb_Id);
} }
if (ids.Tvrage_Id > 0) if (ids.Tvrage_Id > 0)
{ {
series.SetProviderId(MetadataProviders.TvRage, ids.Tvrage_Id.ToString(_usCulture)); series.SetProviderId(MetadataProvider.TvRage, ids.Tvrage_Id.ToString(_usCulture));
} }
if (ids.Tvdb_Id > 0) if (ids.Tvdb_Id > 0)
{ {
series.SetProviderId(MetadataProviders.Tvdb, ids.Tvdb_Id.ToString(_usCulture)); series.SetProviderId(MetadataProvider.Tvdb, ids.Tvdb_Id.ToString(_usCulture));
} }
} }
@ -331,7 +331,7 @@ namespace MediaBrowser.Providers.Plugins.Tmdb.TV
if (actor.Id > 0) if (actor.Id > 0)
{ {
personInfo.SetProviderId(MetadataProviders.Tmdb, actor.Id.ToString(CultureInfo.InvariantCulture)); personInfo.SetProviderId(MetadataProvider.Tmdb, actor.Id.ToString(CultureInfo.InvariantCulture));
} }
seriesResult.AddPerson(personInfo); seriesResult.AddPerson(personInfo);
@ -540,7 +540,7 @@ namespace MediaBrowser.Providers.Plugins.Tmdb.TV
ImageUrl = string.IsNullOrWhiteSpace(tv.Poster_Path) ? null : tmdbImageUrl + tv.Poster_Path ImageUrl = string.IsNullOrWhiteSpace(tv.Poster_Path) ? null : tmdbImageUrl + tv.Poster_Path
}; };
remoteResult.SetProviderId(MetadataProviders.Tmdb, tv.Id.ToString(_usCulture)); remoteResult.SetProviderId(MetadataProvider.Tmdb, tv.Id.ToString(_usCulture));
return remoteResult; return remoteResult;
} }

View File

@ -46,7 +46,7 @@ namespace MediaBrowser.Providers.TV
public async Task<bool> Run(Series series, bool addNewItems, CancellationToken cancellationToken) public async Task<bool> Run(Series series, bool addNewItems, CancellationToken cancellationToken)
{ {
var tvdbId = series.GetProviderId(MetadataProviders.Tvdb); var tvdbId = series.GetProviderId(MetadataProvider.Tvdb);
if (string.IsNullOrEmpty(tvdbId)) if (string.IsNullOrEmpty(tvdbId))
{ {
return false; return false;

View File

@ -11,7 +11,7 @@ namespace MediaBrowser.Providers.TV
public string Name => "Zap2It"; public string Name => "Zap2It";
/// <inheritdoc /> /// <inheritdoc />
public string Key => MetadataProviders.Zap2It.ToString(); public string Key => MetadataProvider.Zap2It.ToString();
/// <inheritdoc /> /// <inheritdoc />
public string UrlFormatString => "http://tvlistings.zap2it.com/overview.html?programSeriesId={0}"; public string UrlFormatString => "http://tvlistings.zap2it.com/overview.html?programSeriesId={0}";
@ -26,7 +26,7 @@ namespace MediaBrowser.Providers.TV
public string Name => "TheTVDB"; public string Name => "TheTVDB";
/// <inheritdoc /> /// <inheritdoc />
public string Key => MetadataProviders.Tvdb.ToString(); public string Key => MetadataProvider.Tvdb.ToString();
/// <inheritdoc /> /// <inheritdoc />
public string UrlFormatString => TvdbUtils.TvdbBaseUrl + "?tab=series&id={0}"; public string UrlFormatString => TvdbUtils.TvdbBaseUrl + "?tab=series&id={0}";
@ -42,7 +42,7 @@ namespace MediaBrowser.Providers.TV
public string Name => "TheTVDB"; public string Name => "TheTVDB";
/// <inheritdoc /> /// <inheritdoc />
public string Key => MetadataProviders.Tvdb.ToString(); public string Key => MetadataProvider.Tvdb.ToString();
/// <inheritdoc /> /// <inheritdoc />
public string UrlFormatString => null; public string UrlFormatString => null;
@ -57,7 +57,7 @@ namespace MediaBrowser.Providers.TV
public string Name => "TheTVDB"; public string Name => "TheTVDB";
/// <inheritdoc /> /// <inheritdoc />
public string Key => MetadataProviders.Tvdb.ToString(); public string Key => MetadataProvider.Tvdb.ToString();
/// <inheritdoc /> /// <inheritdoc />
public string UrlFormatString => TvdbUtils.TvdbBaseUrl + "?tab=episode&id={0}"; public string UrlFormatString => TvdbUtils.TvdbBaseUrl + "?tab=episode&id={0}";

View File

@ -212,7 +212,7 @@ namespace MediaBrowser.XbmcMetadata.Parsers
var m = Regex.Match(xml, "tt([0-9]{7,8})", RegexOptions.IgnoreCase); var m = Regex.Match(xml, "tt([0-9]{7,8})", RegexOptions.IgnoreCase);
if (m.Success) if (m.Success)
{ {
item.SetProviderId(MetadataProviders.Imdb, m.Value); item.SetProviderId(MetadataProvider.Imdb, m.Value);
} }
// Support Tmdb // Support Tmdb
@ -225,7 +225,7 @@ namespace MediaBrowser.XbmcMetadata.Parsers
var tmdbId = xml.Substring(index + srch.Length).TrimEnd('/').Split('-')[0]; var tmdbId = xml.Substring(index + srch.Length).TrimEnd('/').Split('-')[0];
if (!string.IsNullOrWhiteSpace(tmdbId) && int.TryParse(tmdbId, NumberStyles.Integer, CultureInfo.InvariantCulture, out var value)) if (!string.IsNullOrWhiteSpace(tmdbId) && int.TryParse(tmdbId, NumberStyles.Integer, CultureInfo.InvariantCulture, out var value))
{ {
item.SetProviderId(MetadataProviders.Tmdb, value.ToString(UsCulture)); item.SetProviderId(MetadataProvider.Tmdb, value.ToString(UsCulture));
} }
} }
@ -240,7 +240,7 @@ namespace MediaBrowser.XbmcMetadata.Parsers
var tvdbId = xml.Substring(index + srch.Length).TrimEnd('/'); var tvdbId = xml.Substring(index + srch.Length).TrimEnd('/');
if (!string.IsNullOrWhiteSpace(tvdbId) && int.TryParse(tvdbId, NumberStyles.Integer, CultureInfo.InvariantCulture, out var value)) if (!string.IsNullOrWhiteSpace(tvdbId) && int.TryParse(tvdbId, NumberStyles.Integer, CultureInfo.InvariantCulture, out var value))
{ {
item.SetProviderId(MetadataProviders.Tvdb, value.ToString(UsCulture)); item.SetProviderId(MetadataProvider.Tvdb, value.ToString(UsCulture));
} }
} }
} }

View File

@ -49,12 +49,12 @@ namespace MediaBrowser.XbmcMetadata.Parsers
if (!string.IsNullOrWhiteSpace(imdbId)) if (!string.IsNullOrWhiteSpace(imdbId))
{ {
item.SetProviderId(MetadataProviders.Imdb, imdbId); item.SetProviderId(MetadataProvider.Imdb, imdbId);
} }
if (!string.IsNullOrWhiteSpace(tmdbId)) if (!string.IsNullOrWhiteSpace(tmdbId))
{ {
item.SetProviderId(MetadataProviders.Tmdb, tmdbId); item.SetProviderId(MetadataProvider.Tmdb, tmdbId);
} }
break; break;
@ -67,7 +67,7 @@ namespace MediaBrowser.XbmcMetadata.Parsers
var tmdbcolid = reader.GetAttribute("tmdbcolid"); var tmdbcolid = reader.GetAttribute("tmdbcolid");
if (!string.IsNullOrWhiteSpace(tmdbcolid) && movie != null) if (!string.IsNullOrWhiteSpace(tmdbcolid) && movie != null)
{ {
movie.SetProviderId(MetadataProviders.TmdbCollection, tmdbcolid); movie.SetProviderId(MetadataProvider.TmdbCollection, tmdbcolid);
} }
var val = reader.ReadInnerXml(); var val = reader.ReadInnerXml();

View File

@ -51,17 +51,17 @@ namespace MediaBrowser.XbmcMetadata.Parsers
if (!string.IsNullOrWhiteSpace(imdbId)) if (!string.IsNullOrWhiteSpace(imdbId))
{ {
item.SetProviderId(MetadataProviders.Imdb, imdbId); item.SetProviderId(MetadataProvider.Imdb, imdbId);
} }
if (!string.IsNullOrWhiteSpace(tmdbId)) if (!string.IsNullOrWhiteSpace(tmdbId))
{ {
item.SetProviderId(MetadataProviders.Tmdb, tmdbId); item.SetProviderId(MetadataProvider.Tmdb, tmdbId);
} }
if (!string.IsNullOrWhiteSpace(tvdbId)) if (!string.IsNullOrWhiteSpace(tvdbId))
{ {
item.SetProviderId(MetadataProviders.Tvdb, tvdbId); item.SetProviderId(MetadataProvider.Tvdb, tvdbId);
} }
break; break;

View File

@ -543,15 +543,15 @@ namespace MediaBrowser.XbmcMetadata.Savers
writer.WriteElementString("aspectratio", hasAspectRatio.AspectRatio); writer.WriteElementString("aspectratio", hasAspectRatio.AspectRatio);
} }
var tmdbCollection = item.GetProviderId(MetadataProviders.TmdbCollection); var tmdbCollection = item.GetProviderId(MetadataProvider.TmdbCollection);
if (!string.IsNullOrEmpty(tmdbCollection)) if (!string.IsNullOrEmpty(tmdbCollection))
{ {
writer.WriteElementString("collectionnumber", tmdbCollection); writer.WriteElementString("collectionnumber", tmdbCollection);
writtenProviderIds.Add(MetadataProviders.TmdbCollection.ToString()); writtenProviderIds.Add(MetadataProvider.TmdbCollection.ToString());
} }
var imdb = item.GetProviderId(MetadataProviders.Imdb); var imdb = item.GetProviderId(MetadataProvider.Imdb);
if (!string.IsNullOrEmpty(imdb)) if (!string.IsNullOrEmpty(imdb))
{ {
if (item is Series) if (item is Series)
@ -563,25 +563,25 @@ namespace MediaBrowser.XbmcMetadata.Savers
writer.WriteElementString("imdbid", imdb); writer.WriteElementString("imdbid", imdb);
} }
writtenProviderIds.Add(MetadataProviders.Imdb.ToString()); writtenProviderIds.Add(MetadataProvider.Imdb.ToString());
} }
// Series xml saver already saves this // Series xml saver already saves this
if (!(item is Series)) if (!(item is Series))
{ {
var tvdb = item.GetProviderId(MetadataProviders.Tvdb); var tvdb = item.GetProviderId(MetadataProvider.Tvdb);
if (!string.IsNullOrEmpty(tvdb)) if (!string.IsNullOrEmpty(tvdb))
{ {
writer.WriteElementString("tvdbid", tvdb); writer.WriteElementString("tvdbid", tvdb);
writtenProviderIds.Add(MetadataProviders.Tvdb.ToString()); writtenProviderIds.Add(MetadataProvider.Tvdb.ToString());
} }
} }
var tmdb = item.GetProviderId(MetadataProviders.Tmdb); var tmdb = item.GetProviderId(MetadataProvider.Tmdb);
if (!string.IsNullOrEmpty(tmdb)) if (!string.IsNullOrEmpty(tmdb))
{ {
writer.WriteElementString("tmdbid", tmdb); writer.WriteElementString("tmdbid", tmdb);
writtenProviderIds.Add(MetadataProviders.Tmdb.ToString()); writtenProviderIds.Add(MetadataProvider.Tmdb.ToString());
} }
if (!string.IsNullOrEmpty(item.PreferredMetadataLanguage)) if (!string.IsNullOrEmpty(item.PreferredMetadataLanguage))
@ -686,67 +686,67 @@ namespace MediaBrowser.XbmcMetadata.Savers
} }
} }
var externalId = item.GetProviderId(MetadataProviders.AudioDbArtist); var externalId = item.GetProviderId(MetadataProvider.AudioDbArtist);
if (!string.IsNullOrEmpty(externalId)) if (!string.IsNullOrEmpty(externalId))
{ {
writer.WriteElementString("audiodbartistid", externalId); writer.WriteElementString("audiodbartistid", externalId);
writtenProviderIds.Add(MetadataProviders.AudioDbArtist.ToString()); writtenProviderIds.Add(MetadataProvider.AudioDbArtist.ToString());
} }
externalId = item.GetProviderId(MetadataProviders.AudioDbAlbum); externalId = item.GetProviderId(MetadataProvider.AudioDbAlbum);
if (!string.IsNullOrEmpty(externalId)) if (!string.IsNullOrEmpty(externalId))
{ {
writer.WriteElementString("audiodbalbumid", externalId); writer.WriteElementString("audiodbalbumid", externalId);
writtenProviderIds.Add(MetadataProviders.AudioDbAlbum.ToString()); writtenProviderIds.Add(MetadataProvider.AudioDbAlbum.ToString());
} }
externalId = item.GetProviderId(MetadataProviders.Zap2It); externalId = item.GetProviderId(MetadataProvider.Zap2It);
if (!string.IsNullOrEmpty(externalId)) if (!string.IsNullOrEmpty(externalId))
{ {
writer.WriteElementString("zap2itid", externalId); writer.WriteElementString("zap2itid", externalId);
writtenProviderIds.Add(MetadataProviders.Zap2It.ToString()); writtenProviderIds.Add(MetadataProvider.Zap2It.ToString());
} }
externalId = item.GetProviderId(MetadataProviders.MusicBrainzAlbum); externalId = item.GetProviderId(MetadataProvider.MusicBrainzAlbum);
if (!string.IsNullOrEmpty(externalId)) if (!string.IsNullOrEmpty(externalId))
{ {
writer.WriteElementString("musicbrainzalbumid", externalId); writer.WriteElementString("musicbrainzalbumid", externalId);
writtenProviderIds.Add(MetadataProviders.MusicBrainzAlbum.ToString()); writtenProviderIds.Add(MetadataProvider.MusicBrainzAlbum.ToString());
} }
externalId = item.GetProviderId(MetadataProviders.MusicBrainzAlbumArtist); externalId = item.GetProviderId(MetadataProvider.MusicBrainzAlbumArtist);
if (!string.IsNullOrEmpty(externalId)) if (!string.IsNullOrEmpty(externalId))
{ {
writer.WriteElementString("musicbrainzalbumartistid", externalId); writer.WriteElementString("musicbrainzalbumartistid", externalId);
writtenProviderIds.Add(MetadataProviders.MusicBrainzAlbumArtist.ToString()); writtenProviderIds.Add(MetadataProvider.MusicBrainzAlbumArtist.ToString());
} }
externalId = item.GetProviderId(MetadataProviders.MusicBrainzArtist); externalId = item.GetProviderId(MetadataProvider.MusicBrainzArtist);
if (!string.IsNullOrEmpty(externalId)) if (!string.IsNullOrEmpty(externalId))
{ {
writer.WriteElementString("musicbrainzartistid", externalId); writer.WriteElementString("musicbrainzartistid", externalId);
writtenProviderIds.Add(MetadataProviders.MusicBrainzArtist.ToString()); writtenProviderIds.Add(MetadataProvider.MusicBrainzArtist.ToString());
} }
externalId = item.GetProviderId(MetadataProviders.MusicBrainzReleaseGroup); externalId = item.GetProviderId(MetadataProvider.MusicBrainzReleaseGroup);
if (!string.IsNullOrEmpty(externalId)) if (!string.IsNullOrEmpty(externalId))
{ {
writer.WriteElementString("musicbrainzreleasegroupid", externalId); writer.WriteElementString("musicbrainzreleasegroupid", externalId);
writtenProviderIds.Add(MetadataProviders.MusicBrainzReleaseGroup.ToString()); writtenProviderIds.Add(MetadataProvider.MusicBrainzReleaseGroup.ToString());
} }
externalId = item.GetProviderId(MetadataProviders.TvRage); externalId = item.GetProviderId(MetadataProvider.TvRage);
if (!string.IsNullOrEmpty(externalId)) if (!string.IsNullOrEmpty(externalId))
{ {
writer.WriteElementString("tvrageid", externalId); writer.WriteElementString("tvrageid", externalId);
writtenProviderIds.Add(MetadataProviders.TvRage.ToString()); writtenProviderIds.Add(MetadataProvider.TvRage.ToString());
} }
if (item.ProviderIds != null) if (item.ProviderIds != null)

View File

@ -93,7 +93,7 @@ namespace MediaBrowser.XbmcMetadata.Savers
/// <inheritdoc /> /// <inheritdoc />
protected override void WriteCustomElements(BaseItem item, XmlWriter writer) protected override void WriteCustomElements(BaseItem item, XmlWriter writer)
{ {
var imdb = item.GetProviderId(MetadataProviders.Imdb); var imdb = item.GetProviderId(MetadataProvider.Imdb);
if (!string.IsNullOrEmpty(imdb)) if (!string.IsNullOrEmpty(imdb))
{ {

View File

@ -54,7 +54,7 @@ namespace MediaBrowser.XbmcMetadata.Savers
{ {
var series = (Series)item; var series = (Series)item;
var tvdb = item.GetProviderId(MetadataProviders.Tvdb); var tvdb = item.GetProviderId(MetadataProvider.Tvdb);
if (!string.IsNullOrEmpty(tvdb)) if (!string.IsNullOrEmpty(tvdb))
{ {