Merge pull request #12295 from Bond-009/trysetproviderid
Add TrySetProviderId extension
This commit is contained in:
commit
095d4d4d15
|
@ -68,11 +68,7 @@ namespace Emby.Server.Implementations.Library.Resolvers.Movies
|
||||||
var justName = Path.GetFileName(item.Path.AsSpan());
|
var justName = Path.GetFileName(item.Path.AsSpan());
|
||||||
|
|
||||||
var id = justName.GetAttributeValue("tmdbid");
|
var id = justName.GetAttributeValue("tmdbid");
|
||||||
|
item.TrySetProviderId(MetadataProvider.Tmdb, id);
|
||||||
if (!string.IsNullOrEmpty(id))
|
|
||||||
{
|
|
||||||
item.SetProviderId(MetadataProvider.Tmdb, id);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -373,22 +373,14 @@ namespace Emby.Server.Implementations.Library.Resolvers.Movies
|
||||||
{
|
{
|
||||||
// Check for TMDb id
|
// Check for TMDb id
|
||||||
var tmdbid = justName.GetAttributeValue("tmdbid");
|
var tmdbid = justName.GetAttributeValue("tmdbid");
|
||||||
|
item.TrySetProviderId(MetadataProvider.Tmdb, tmdbid);
|
||||||
if (!string.IsNullOrWhiteSpace(tmdbid))
|
|
||||||
{
|
|
||||||
item.SetProviderId(MetadataProvider.Tmdb, tmdbid);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!string.IsNullOrEmpty(item.Path))
|
if (!string.IsNullOrEmpty(item.Path))
|
||||||
{
|
{
|
||||||
// Check for IMDb id - we use full media path, as we can assume that this will match in any use case (whether id in parent dir or in file name)
|
// Check for IMDb id - we use full media path, as we can assume that this will match in any use case (whether id in parent dir or in file name)
|
||||||
var imdbid = item.Path.AsSpan().GetAttributeValue("imdbid");
|
var imdbid = item.Path.AsSpan().GetAttributeValue("imdbid");
|
||||||
|
item.TrySetProviderId(MetadataProvider.Imdb, imdbid);
|
||||||
if (!string.IsNullOrWhiteSpace(imdbid))
|
|
||||||
{
|
|
||||||
item.SetProviderId(MetadataProvider.Imdb, imdbid);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -186,46 +186,25 @@ namespace Emby.Server.Implementations.Library.Resolvers.TV
|
||||||
var justName = Path.GetFileName(path.AsSpan());
|
var justName = Path.GetFileName(path.AsSpan());
|
||||||
|
|
||||||
var imdbId = justName.GetAttributeValue("imdbid");
|
var imdbId = justName.GetAttributeValue("imdbid");
|
||||||
if (!string.IsNullOrEmpty(imdbId))
|
item.TrySetProviderId(MetadataProvider.Imdb, imdbId);
|
||||||
{
|
|
||||||
item.SetProviderId(MetadataProvider.Imdb, imdbId);
|
|
||||||
}
|
|
||||||
|
|
||||||
var tvdbId = justName.GetAttributeValue("tvdbid");
|
var tvdbId = justName.GetAttributeValue("tvdbid");
|
||||||
if (!string.IsNullOrEmpty(tvdbId))
|
item.TrySetProviderId(MetadataProvider.Tvdb, tvdbId);
|
||||||
{
|
|
||||||
item.SetProviderId(MetadataProvider.Tvdb, tvdbId);
|
|
||||||
}
|
|
||||||
|
|
||||||
var tvmazeId = justName.GetAttributeValue("tvmazeid");
|
var tvmazeId = justName.GetAttributeValue("tvmazeid");
|
||||||
if (!string.IsNullOrEmpty(tvmazeId))
|
item.TrySetProviderId(MetadataProvider.TvMaze, tvmazeId);
|
||||||
{
|
|
||||||
item.SetProviderId(MetadataProvider.TvMaze, tvmazeId);
|
|
||||||
}
|
|
||||||
|
|
||||||
var tmdbId = justName.GetAttributeValue("tmdbid");
|
var tmdbId = justName.GetAttributeValue("tmdbid");
|
||||||
if (!string.IsNullOrEmpty(tmdbId))
|
item.TrySetProviderId(MetadataProvider.Tmdb, tmdbId);
|
||||||
{
|
|
||||||
item.SetProviderId(MetadataProvider.Tmdb, tmdbId);
|
|
||||||
}
|
|
||||||
|
|
||||||
var anidbId = justName.GetAttributeValue("anidbid");
|
var anidbId = justName.GetAttributeValue("anidbid");
|
||||||
if (!string.IsNullOrEmpty(anidbId))
|
item.TrySetProviderId("AniDB", anidbId);
|
||||||
{
|
|
||||||
item.SetProviderId("AniDB", anidbId);
|
|
||||||
}
|
|
||||||
|
|
||||||
var aniListId = justName.GetAttributeValue("anilistid");
|
var aniListId = justName.GetAttributeValue("anilistid");
|
||||||
if (!string.IsNullOrEmpty(aniListId))
|
item.TrySetProviderId("AniList", aniListId);
|
||||||
{
|
|
||||||
item.SetProviderId("AniList", aniListId);
|
|
||||||
}
|
|
||||||
|
|
||||||
var aniSearchId = justName.GetAttributeValue("anisearchid");
|
var aniSearchId = justName.GetAttributeValue("anisearchid");
|
||||||
if (!string.IsNullOrEmpty(aniSearchId))
|
item.TrySetProviderId("AniSearch", aniSearchId);
|
||||||
{
|
|
||||||
item.SetProviderId("AniSearch", aniSearchId);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -365,10 +365,7 @@ namespace MediaBrowser.LocalMetadata.Parsers
|
||||||
break;
|
break;
|
||||||
case "CollectionNumber":
|
case "CollectionNumber":
|
||||||
var tmdbCollection = reader.ReadNormalizedString();
|
var tmdbCollection = reader.ReadNormalizedString();
|
||||||
if (!string.IsNullOrEmpty(tmdbCollection))
|
item.TrySetProviderId(MetadataProvider.TmdbCollection, tmdbCollection);
|
||||||
{
|
|
||||||
item.SetProviderId(MetadataProvider.TmdbCollection, tmdbCollection);
|
|
||||||
}
|
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -502,10 +499,7 @@ namespace MediaBrowser.LocalMetadata.Parsers
|
||||||
if (_validProviderIds!.TryGetValue(readerName, out string? providerIdValue))
|
if (_validProviderIds!.TryGetValue(readerName, out string? providerIdValue))
|
||||||
{
|
{
|
||||||
var id = reader.ReadElementContentAsString();
|
var id = reader.ReadElementContentAsString();
|
||||||
if (!string.IsNullOrWhiteSpace(id))
|
item.TrySetProviderId(providerIdValue, id);
|
||||||
{
|
|
||||||
item.SetProviderId(providerIdValue, id);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
@ -1321,38 +1321,23 @@ namespace MediaBrowser.MediaEncoding.Probing
|
||||||
// These support multiple values, but for now we only store the first.
|
// These support multiple values, but for now we only store the first.
|
||||||
var mb = GetMultipleMusicBrainzId(tags.GetValueOrDefault("MusicBrainz Album Artist Id"))
|
var mb = GetMultipleMusicBrainzId(tags.GetValueOrDefault("MusicBrainz Album Artist Id"))
|
||||||
?? GetMultipleMusicBrainzId(tags.GetValueOrDefault("MUSICBRAINZ_ALBUMARTISTID"));
|
?? GetMultipleMusicBrainzId(tags.GetValueOrDefault("MUSICBRAINZ_ALBUMARTISTID"));
|
||||||
if (!string.IsNullOrEmpty(mb))
|
audio.TrySetProviderId(MetadataProvider.MusicBrainzAlbumArtist, mb);
|
||||||
{
|
|
||||||
audio.SetProviderId(MetadataProvider.MusicBrainzAlbumArtist, mb);
|
|
||||||
}
|
|
||||||
|
|
||||||
mb = GetMultipleMusicBrainzId(tags.GetValueOrDefault("MusicBrainz Artist Id"))
|
mb = GetMultipleMusicBrainzId(tags.GetValueOrDefault("MusicBrainz Artist Id"))
|
||||||
?? GetMultipleMusicBrainzId(tags.GetValueOrDefault("MUSICBRAINZ_ARTISTID"));
|
?? GetMultipleMusicBrainzId(tags.GetValueOrDefault("MUSICBRAINZ_ARTISTID"));
|
||||||
if (!string.IsNullOrEmpty(mb))
|
audio.TrySetProviderId(MetadataProvider.MusicBrainzArtist, mb);
|
||||||
{
|
|
||||||
audio.SetProviderId(MetadataProvider.MusicBrainzArtist, mb);
|
|
||||||
}
|
|
||||||
|
|
||||||
mb = GetMultipleMusicBrainzId(tags.GetValueOrDefault("MusicBrainz Album Id"))
|
mb = GetMultipleMusicBrainzId(tags.GetValueOrDefault("MusicBrainz Album Id"))
|
||||||
?? GetMultipleMusicBrainzId(tags.GetValueOrDefault("MUSICBRAINZ_ALBUMID"));
|
?? GetMultipleMusicBrainzId(tags.GetValueOrDefault("MUSICBRAINZ_ALBUMID"));
|
||||||
if (!string.IsNullOrEmpty(mb))
|
audio.TrySetProviderId(MetadataProvider.MusicBrainzAlbum, mb);
|
||||||
{
|
|
||||||
audio.SetProviderId(MetadataProvider.MusicBrainzAlbum, mb);
|
|
||||||
}
|
|
||||||
|
|
||||||
mb = GetMultipleMusicBrainzId(tags.GetValueOrDefault("MusicBrainz Release Group Id"))
|
mb = GetMultipleMusicBrainzId(tags.GetValueOrDefault("MusicBrainz Release Group Id"))
|
||||||
?? GetMultipleMusicBrainzId(tags.GetValueOrDefault("MUSICBRAINZ_RELEASEGROUPID"));
|
?? GetMultipleMusicBrainzId(tags.GetValueOrDefault("MUSICBRAINZ_RELEASEGROUPID"));
|
||||||
if (!string.IsNullOrEmpty(mb))
|
audio.TrySetProviderId(MetadataProvider.MusicBrainzReleaseGroup, mb);
|
||||||
{
|
|
||||||
audio.SetProviderId(MetadataProvider.MusicBrainzReleaseGroup, mb);
|
|
||||||
}
|
|
||||||
|
|
||||||
mb = GetMultipleMusicBrainzId(tags.GetValueOrDefault("MusicBrainz Release Track Id"))
|
mb = GetMultipleMusicBrainzId(tags.GetValueOrDefault("MusicBrainz Release Track Id"))
|
||||||
?? GetMultipleMusicBrainzId(tags.GetValueOrDefault("MUSICBRAINZ_RELEASETRACKID"));
|
?? GetMultipleMusicBrainzId(tags.GetValueOrDefault("MUSICBRAINZ_RELEASETRACKID"));
|
||||||
if (!string.IsNullOrEmpty(mb))
|
audio.TrySetProviderId(MetadataProvider.MusicBrainzTrack, mb);
|
||||||
{
|
|
||||||
audio.SetProviderId(MetadataProvider.MusicBrainzTrack, mb);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private string GetMultipleMusicBrainzId(string value)
|
private string GetMultipleMusicBrainzId(string value)
|
||||||
|
|
|
@ -3,177 +3,214 @@ using System.Collections.Generic;
|
||||||
using System.Diagnostics.CodeAnalysis;
|
using System.Diagnostics.CodeAnalysis;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
|
||||||
namespace MediaBrowser.Model.Entities
|
namespace MediaBrowser.Model.Entities;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Class ProviderIdsExtensions.
|
||||||
|
/// </summary>
|
||||||
|
public static class ProviderIdsExtensions
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Class ProviderIdsExtensions.
|
/// Case insensitive dictionary of <see cref="MetadataProvider"/> string representation.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static class ProviderIdsExtensions
|
private static readonly Dictionary<string, string> _metadataProviderEnumDictionary =
|
||||||
|
Enum.GetValues<MetadataProvider>()
|
||||||
|
.ToDictionary(
|
||||||
|
enumValue => enumValue.ToString(),
|
||||||
|
enumValue => enumValue.ToString(),
|
||||||
|
StringComparer.OrdinalIgnoreCase);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Checks if this instance has an id for the given provider.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="instance">The instance.</param>
|
||||||
|
/// <param name="name">The of the provider name.</param>
|
||||||
|
/// <returns><c>true</c> if a provider id with the given name was found; otherwise <c>false</c>.</returns>
|
||||||
|
public static bool HasProviderId(this IHasProviderIds instance, string name)
|
||||||
|
=> instance.TryGetProviderId(name, out _);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Checks if this instance has an id for the given provider.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="instance">The instance.</param>
|
||||||
|
/// <param name="provider">The provider.</param>
|
||||||
|
/// <returns><c>true</c> if a provider id with the given name was found; otherwise <c>false</c>.</returns>
|
||||||
|
public static bool HasProviderId(this IHasProviderIds instance, MetadataProvider provider)
|
||||||
|
=> instance.HasProviderId(provider.ToString());
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets a provider id.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="instance">The instance.</param>
|
||||||
|
/// <param name="name">The name.</param>
|
||||||
|
/// <param name="id">The provider id.</param>
|
||||||
|
/// <returns><c>true</c> if a provider id with the given name was found; otherwise <c>false</c>.</returns>
|
||||||
|
public static bool TryGetProviderId(this IHasProviderIds instance, string name, [NotNullWhen(true)] out string? id)
|
||||||
{
|
{
|
||||||
/// <summary>
|
ArgumentNullException.ThrowIfNull(instance);
|
||||||
/// Case insensitive dictionary of <see cref="MetadataProvider"/> string representation.
|
|
||||||
/// </summary>
|
|
||||||
private static readonly Dictionary<string, string> _metadataProviderEnumDictionary =
|
|
||||||
Enum.GetValues<MetadataProvider>()
|
|
||||||
.ToDictionary(
|
|
||||||
enumValue => enumValue.ToString(),
|
|
||||||
enumValue => enumValue.ToString(),
|
|
||||||
StringComparer.OrdinalIgnoreCase);
|
|
||||||
|
|
||||||
/// <summary>
|
if (instance.ProviderIds is null)
|
||||||
/// Checks if this instance has an id for the given provider.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="instance">The instance.</param>
|
|
||||||
/// <param name="name">The of the provider name.</param>
|
|
||||||
/// <returns><c>true</c> if a provider id with the given name was found; otherwise <c>false</c>.</returns>
|
|
||||||
public static bool HasProviderId(this IHasProviderIds instance, string name)
|
|
||||||
{
|
{
|
||||||
ArgumentNullException.ThrowIfNull(instance);
|
id = null;
|
||||||
|
return false;
|
||||||
return instance.TryGetProviderId(name, out _);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
var foundProviderId = instance.ProviderIds.TryGetValue(name, out id);
|
||||||
/// Checks if this instance has an id for the given provider.
|
// This occurs when searching with Identify (and possibly in other places)
|
||||||
/// </summary>
|
if (string.IsNullOrEmpty(id))
|
||||||
/// <param name="instance">The instance.</param>
|
|
||||||
/// <param name="provider">The provider.</param>
|
|
||||||
/// <returns><c>true</c> if a provider id with the given name was found; otherwise <c>false</c>.</returns>
|
|
||||||
public static bool HasProviderId(this IHasProviderIds instance, MetadataProvider provider)
|
|
||||||
{
|
{
|
||||||
return instance.HasProviderId(provider.ToString());
|
id = null;
|
||||||
|
foundProviderId = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
return foundProviderId;
|
||||||
/// Gets a provider id.
|
}
|
||||||
/// </summary>
|
|
||||||
/// <param name="instance">The instance.</param>
|
/// <summary>
|
||||||
/// <param name="name">The name.</param>
|
/// Gets a provider id.
|
||||||
/// <param name="id">The provider id.</param>
|
/// </summary>
|
||||||
/// <returns><c>true</c> if a provider id with the given name was found; otherwise <c>false</c>.</returns>
|
/// <param name="instance">The instance.</param>
|
||||||
public static bool TryGetProviderId(this IHasProviderIds instance, string name, [NotNullWhen(true)] out string? id)
|
/// <param name="provider">The provider.</param>
|
||||||
|
/// <param name="id">The provider id.</param>
|
||||||
|
/// <returns><c>true</c> if a provider id with the given name was found; otherwise <c>false</c>.</returns>
|
||||||
|
public static bool TryGetProviderId(this IHasProviderIds instance, MetadataProvider provider, [NotNullWhen(true)] out string? id)
|
||||||
|
{
|
||||||
|
return instance.TryGetProviderId(provider.ToString(), out id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets a provider id.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="instance">The instance.</param>
|
||||||
|
/// <param name="name">The name.</param>
|
||||||
|
/// <returns>System.String.</returns>
|
||||||
|
public static string? GetProviderId(this IHasProviderIds instance, string name)
|
||||||
|
{
|
||||||
|
instance.TryGetProviderId(name, out string? id);
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets a provider id.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="instance">The instance.</param>
|
||||||
|
/// <param name="provider">The provider.</param>
|
||||||
|
/// <returns>System.String.</returns>
|
||||||
|
public static string? GetProviderId(this IHasProviderIds instance, MetadataProvider provider)
|
||||||
|
{
|
||||||
|
return instance.GetProviderId(provider.ToString());
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Sets a provider id.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="instance">The instance.</param>
|
||||||
|
/// <param name="name">The name, this should not contain a '=' character.</param>
|
||||||
|
/// <param name="value">The value.</param>
|
||||||
|
/// <remarks>Due to how deserialization from the database works the name can not contain '='.</remarks>
|
||||||
|
/// <returns><c>true</c> if the provider id got set successfully; otherwise, <c>false</c>.</returns>
|
||||||
|
public static bool TrySetProviderId(this IHasProviderIds instance, string? name, string? value)
|
||||||
|
{
|
||||||
|
ArgumentNullException.ThrowIfNull(instance);
|
||||||
|
|
||||||
|
// When name contains a '=' it can't be deserialized from the database
|
||||||
|
if (string.IsNullOrWhiteSpace(name)
|
||||||
|
|| string.IsNullOrWhiteSpace(value)
|
||||||
|
|| name.Contains('=', StringComparison.Ordinal))
|
||||||
{
|
{
|
||||||
ArgumentNullException.ThrowIfNull(instance);
|
return false;
|
||||||
|
|
||||||
if (instance.ProviderIds is null)
|
|
||||||
{
|
|
||||||
id = null;
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
var foundProviderId = instance.ProviderIds.TryGetValue(name, out id);
|
|
||||||
// This occurs when searching with Identify (and possibly in other places)
|
|
||||||
if (string.IsNullOrEmpty(id))
|
|
||||||
{
|
|
||||||
id = null;
|
|
||||||
foundProviderId = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
return foundProviderId;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
// Ensure it exists
|
||||||
/// Gets a provider id.
|
instance.ProviderIds ??= new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase);
|
||||||
/// </summary>
|
|
||||||
/// <param name="instance">The instance.</param>
|
// Match on internal MetadataProvider enum string values before adding arbitrary providers
|
||||||
/// <param name="provider">The provider.</param>
|
if (_metadataProviderEnumDictionary.TryGetValue(name, out var enumValue))
|
||||||
/// <param name="id">The provider id.</param>
|
|
||||||
/// <returns><c>true</c> if a provider id with the given name was found; otherwise <c>false</c>.</returns>
|
|
||||||
public static bool TryGetProviderId(this IHasProviderIds instance, MetadataProvider provider, [NotNullWhen(true)] out string? id)
|
|
||||||
{
|
{
|
||||||
return instance.TryGetProviderId(provider.ToString(), out id);
|
instance.ProviderIds[enumValue] = value;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
instance.ProviderIds[name] = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
return true;
|
||||||
/// Gets a provider id.
|
}
|
||||||
/// </summary>
|
|
||||||
/// <param name="instance">The instance.</param>
|
/// <summary>
|
||||||
/// <param name="name">The name.</param>
|
/// Sets a provider id.
|
||||||
/// <returns>System.String.</returns>
|
/// </summary>
|
||||||
public static string? GetProviderId(this IHasProviderIds instance, string name)
|
/// <param name="instance">The instance.</param>
|
||||||
|
/// <param name="provider">The provider.</param>
|
||||||
|
/// <param name="value">The value.</param>
|
||||||
|
/// <returns><c>true</c> if the provider id got set successfully; otherwise, <c>false</c>.</returns>
|
||||||
|
public static bool TrySetProviderId(this IHasProviderIds instance, MetadataProvider provider, string? value)
|
||||||
|
=> instance.TrySetProviderId(provider.ToString(), value);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Sets a provider id.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="instance">The instance.</param>
|
||||||
|
/// <param name="name">The name, this should not contain a '=' character.</param>
|
||||||
|
/// <param name="value">The value.</param>
|
||||||
|
/// <remarks>Due to how deserialization from the database works the name can not contain '='.</remarks>
|
||||||
|
public static void SetProviderId(this IHasProviderIds instance, string name, string value)
|
||||||
|
{
|
||||||
|
ArgumentNullException.ThrowIfNull(instance);
|
||||||
|
ArgumentException.ThrowIfNullOrWhiteSpace(name);
|
||||||
|
ArgumentException.ThrowIfNullOrWhiteSpace(value);
|
||||||
|
|
||||||
|
// When name contains a '=' it can't be deserialized from the database
|
||||||
|
if (name.Contains('=', StringComparison.Ordinal))
|
||||||
{
|
{
|
||||||
instance.TryGetProviderId(name, out string? id);
|
throw new ArgumentException("Provider id name cannot contain '='", nameof(name));
|
||||||
return id;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
// Ensure it exists
|
||||||
/// Gets a provider id.
|
instance.ProviderIds ??= new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase);
|
||||||
/// </summary>
|
|
||||||
/// <param name="instance">The instance.</param>
|
// Match on internal MetadataProvider enum string values before adding arbitrary providers
|
||||||
/// <param name="provider">The provider.</param>
|
if (_metadataProviderEnumDictionary.TryGetValue(name, out var enumValue))
|
||||||
/// <returns>System.String.</returns>
|
|
||||||
public static string? GetProviderId(this IHasProviderIds instance, MetadataProvider provider)
|
|
||||||
{
|
{
|
||||||
return instance.GetProviderId(provider.ToString());
|
instance.ProviderIds[enumValue] = value;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
/// <summary>
|
|
||||||
/// Sets a provider id.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="instance">The instance.</param>
|
|
||||||
/// <param name="name">The name, this should not contain a '=' character.</param>
|
|
||||||
/// <param name="value">The value.</param>
|
|
||||||
/// <remarks>Due to how deserialization from the database works the name can not contain '='.</remarks>
|
|
||||||
public static void SetProviderId(this IHasProviderIds instance, string name, string value)
|
|
||||||
{
|
{
|
||||||
ArgumentNullException.ThrowIfNull(instance);
|
instance.ProviderIds[name] = value;
|
||||||
ArgumentException.ThrowIfNullOrEmpty(name);
|
|
||||||
ArgumentException.ThrowIfNullOrEmpty(value);
|
|
||||||
|
|
||||||
// When name contains a '=' it can't be deserialized from the database
|
|
||||||
if (name.Contains('=', StringComparison.Ordinal))
|
|
||||||
{
|
|
||||||
throw new ArgumentException("Provider id name cannot contain '='", nameof(name));
|
|
||||||
}
|
|
||||||
|
|
||||||
// Ensure it exists
|
|
||||||
instance.ProviderIds ??= new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase);
|
|
||||||
|
|
||||||
// Match on internal MetadataProvider enum string values before adding arbitrary providers
|
|
||||||
if (_metadataProviderEnumDictionary.TryGetValue(name, out var enumValue))
|
|
||||||
{
|
|
||||||
instance.ProviderIds[enumValue] = value;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
instance.ProviderIds[name] = value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Sets a provider id.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="instance">The instance.</param>
|
|
||||||
/// <param name="provider">The provider.</param>
|
|
||||||
/// <param name="value">The value.</param>
|
|
||||||
public static void SetProviderId(this IHasProviderIds instance, MetadataProvider provider, string value)
|
|
||||||
{
|
|
||||||
instance.SetProviderId(provider.ToString(), value);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Removes a provider id.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="instance">The instance.</param>
|
|
||||||
/// <param name="name">The name.</param>
|
|
||||||
public static void RemoveProviderId(this IHasProviderIds instance, string name)
|
|
||||||
{
|
|
||||||
ArgumentNullException.ThrowIfNull(instance);
|
|
||||||
ArgumentException.ThrowIfNullOrEmpty(name);
|
|
||||||
|
|
||||||
instance.ProviderIds?.Remove(name);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Removes a provider id.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="instance">The instance.</param>
|
|
||||||
/// <param name="provider">The provider.</param>
|
|
||||||
public static void RemoveProviderId(this IHasProviderIds instance, MetadataProvider provider)
|
|
||||||
{
|
|
||||||
ArgumentNullException.ThrowIfNull(instance);
|
|
||||||
|
|
||||||
instance.ProviderIds?.Remove(provider.ToString());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Sets a provider id.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="instance">The instance.</param>
|
||||||
|
/// <param name="provider">The provider.</param>
|
||||||
|
/// <param name="value">The value.</param>
|
||||||
|
public static void SetProviderId(this IHasProviderIds instance, MetadataProvider provider, string value)
|
||||||
|
=> instance.SetProviderId(provider.ToString(), value);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Removes a provider id.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="instance">The instance.</param>
|
||||||
|
/// <param name="name">The name.</param>
|
||||||
|
public static void RemoveProviderId(this IHasProviderIds instance, string name)
|
||||||
|
{
|
||||||
|
ArgumentNullException.ThrowIfNull(instance);
|
||||||
|
ArgumentException.ThrowIfNullOrEmpty(name);
|
||||||
|
|
||||||
|
instance.ProviderIds?.Remove(name);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Removes a provider id.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="instance">The instance.</param>
|
||||||
|
/// <param name="provider">The provider.</param>
|
||||||
|
public static void RemoveProviderId(this IHasProviderIds instance, MetadataProvider provider)
|
||||||
|
{
|
||||||
|
ArgumentNullException.ThrowIfNull(instance);
|
||||||
|
|
||||||
|
instance.ProviderIds?.Remove(provider.ToString());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -325,39 +325,32 @@ namespace MediaBrowser.Providers.MediaInfo
|
||||||
audio.NormalizationGain = (float)tags.ReplayGainTrackGain;
|
audio.NormalizationGain = (float)tags.ReplayGainTrackGain;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((options.ReplaceAllMetadata || !audio.TryGetProviderId(MetadataProvider.MusicBrainzArtist, out _))
|
if (options.ReplaceAllMetadata || !audio.HasProviderId(MetadataProvider.MusicBrainzArtist))
|
||||||
&& !string.IsNullOrEmpty(tags.MusicBrainzArtistId))
|
|
||||||
{
|
{
|
||||||
audio.SetProviderId(MetadataProvider.MusicBrainzArtist, tags.MusicBrainzArtistId);
|
audio.TrySetProviderId(MetadataProvider.MusicBrainzArtist, tags.MusicBrainzArtistId);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((options.ReplaceAllMetadata || !audio.TryGetProviderId(MetadataProvider.MusicBrainzAlbumArtist, out _))
|
if (options.ReplaceAllMetadata || !audio.HasProviderId(MetadataProvider.MusicBrainzAlbumArtist))
|
||||||
&& !string.IsNullOrEmpty(tags.MusicBrainzReleaseArtistId))
|
|
||||||
{
|
{
|
||||||
audio.SetProviderId(MetadataProvider.MusicBrainzAlbumArtist, tags.MusicBrainzReleaseArtistId);
|
audio.TrySetProviderId(MetadataProvider.MusicBrainzAlbumArtist, tags.MusicBrainzReleaseArtistId);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((options.ReplaceAllMetadata || !audio.TryGetProviderId(MetadataProvider.MusicBrainzAlbum, out _))
|
if (options.ReplaceAllMetadata || !audio.HasProviderId(MetadataProvider.MusicBrainzAlbum))
|
||||||
&& !string.IsNullOrEmpty(tags.MusicBrainzReleaseId))
|
|
||||||
{
|
{
|
||||||
audio.SetProviderId(MetadataProvider.MusicBrainzAlbum, tags.MusicBrainzReleaseId);
|
audio.TrySetProviderId(MetadataProvider.MusicBrainzAlbum, tags.MusicBrainzReleaseId);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((options.ReplaceAllMetadata || !audio.TryGetProviderId(MetadataProvider.MusicBrainzReleaseGroup, out _))
|
if (options.ReplaceAllMetadata || !audio.HasProviderId(MetadataProvider.MusicBrainzReleaseGroup))
|
||||||
&& !string.IsNullOrEmpty(tags.MusicBrainzReleaseGroupId))
|
|
||||||
{
|
{
|
||||||
audio.SetProviderId(MetadataProvider.MusicBrainzReleaseGroup, tags.MusicBrainzReleaseGroupId);
|
audio.TrySetProviderId(MetadataProvider.MusicBrainzReleaseGroup, tags.MusicBrainzReleaseGroupId);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (options.ReplaceAllMetadata || !audio.TryGetProviderId(MetadataProvider.MusicBrainzTrack, out _))
|
if (options.ReplaceAllMetadata || !audio.HasProviderId(MetadataProvider.MusicBrainzTrack))
|
||||||
{
|
{
|
||||||
// Fallback to ffprobe as TagLib incorrectly provides recording MBID in `tags.MusicBrainzTrackId`.
|
// Fallback to ffprobe as TagLib incorrectly provides recording MBID in `tags.MusicBrainzTrackId`.
|
||||||
// See https://github.com/mono/taglib-sharp/issues/304
|
// See https://github.com/mono/taglib-sharp/issues/304
|
||||||
var trackMbId = mediaInfo.GetProviderId(MetadataProvider.MusicBrainzTrack);
|
var trackMbId = mediaInfo.GetProviderId(MetadataProvider.MusicBrainzTrack);
|
||||||
if (trackMbId is not null)
|
audio.TrySetProviderId(MetadataProvider.MusicBrainzTrack, trackMbId);
|
||||||
{
|
|
||||||
audio.SetProviderId(MetadataProvider.MusicBrainzTrack, trackMbId);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Save extracted lyrics if they exist,
|
// Save extracted lyrics if they exist,
|
||||||
|
|
|
@ -220,10 +220,7 @@ namespace MediaBrowser.Providers.Plugins.Omdb
|
||||||
item.HomePageUrl = result.Website;
|
item.HomePageUrl = result.Website;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!string.IsNullOrWhiteSpace(result.imdbID))
|
item.TrySetProviderId(MetadataProvider.Imdb, result.imdbID);
|
||||||
{
|
|
||||||
item.SetProviderId(MetadataProvider.Imdb, result.imdbID);
|
|
||||||
}
|
|
||||||
|
|
||||||
ParseAdditionalMetadata(itemResult, result, isEnglishRequested);
|
ParseAdditionalMetadata(itemResult, result, isEnglishRequested);
|
||||||
|
|
||||||
|
|
|
@ -81,11 +81,7 @@ namespace MediaBrowser.Providers.Plugins.Tmdb.Movies
|
||||||
}
|
}
|
||||||
|
|
||||||
remoteResult.SetProviderId(MetadataProvider.Tmdb, movie.Id.ToString(CultureInfo.InvariantCulture));
|
remoteResult.SetProviderId(MetadataProvider.Tmdb, movie.Id.ToString(CultureInfo.InvariantCulture));
|
||||||
|
remoteResult.TrySetProviderId(MetadataProvider.Imdb, movie.ImdbId);
|
||||||
if (!string.IsNullOrWhiteSpace(movie.ImdbId))
|
|
||||||
{
|
|
||||||
remoteResult.SetProviderId(MetadataProvider.Imdb, movie.ImdbId);
|
|
||||||
}
|
|
||||||
|
|
||||||
return new[] { remoteResult };
|
return new[] { remoteResult };
|
||||||
}
|
}
|
||||||
|
|
|
@ -56,10 +56,7 @@ namespace MediaBrowser.Providers.Plugins.Tmdb.People
|
||||||
}
|
}
|
||||||
|
|
||||||
result.SetProviderId(MetadataProvider.Tmdb, personResult.Id.ToString(CultureInfo.InvariantCulture));
|
result.SetProviderId(MetadataProvider.Tmdb, personResult.Id.ToString(CultureInfo.InvariantCulture));
|
||||||
if (!string.IsNullOrEmpty(personResult.ExternalIds.ImdbId))
|
result.TrySetProviderId(MetadataProvider.Imdb, personResult.ExternalIds.ImdbId);
|
||||||
{
|
|
||||||
result.SetProviderId(MetadataProvider.Imdb, personResult.ExternalIds.ImdbId);
|
|
||||||
}
|
|
||||||
|
|
||||||
return new[] { result };
|
return new[] { result };
|
||||||
}
|
}
|
||||||
|
@ -129,11 +126,7 @@ namespace MediaBrowser.Providers.Plugins.Tmdb.People
|
||||||
}
|
}
|
||||||
|
|
||||||
item.SetProviderId(MetadataProvider.Tmdb, person.Id.ToString(CultureInfo.InvariantCulture));
|
item.SetProviderId(MetadataProvider.Tmdb, person.Id.ToString(CultureInfo.InvariantCulture));
|
||||||
|
item.TrySetProviderId(MetadataProvider.Imdb, person.ImdbId);
|
||||||
if (!string.IsNullOrEmpty(person.ImdbId))
|
|
||||||
{
|
|
||||||
item.SetProviderId(MetadataProvider.Imdb, person.ImdbId);
|
|
||||||
}
|
|
||||||
|
|
||||||
result.HasMetadata = true;
|
result.HasMetadata = true;
|
||||||
result.Item = item;
|
result.Item = item;
|
||||||
|
|
|
@ -187,20 +187,9 @@ namespace MediaBrowser.Providers.Plugins.Tmdb.TV
|
||||||
};
|
};
|
||||||
|
|
||||||
var externalIds = episodeResult.ExternalIds;
|
var externalIds = episodeResult.ExternalIds;
|
||||||
if (!string.IsNullOrEmpty(externalIds?.TvdbId))
|
item.TrySetProviderId(MetadataProvider.Tvdb, externalIds?.TvdbId);
|
||||||
{
|
item.TrySetProviderId(MetadataProvider.Imdb, externalIds?.ImdbId);
|
||||||
item.SetProviderId(MetadataProvider.Tvdb, externalIds.TvdbId);
|
item.TrySetProviderId(MetadataProvider.TvRage, externalIds?.TvrageId);
|
||||||
}
|
|
||||||
|
|
||||||
if (!string.IsNullOrEmpty(externalIds?.ImdbId))
|
|
||||||
{
|
|
||||||
item.SetProviderId(MetadataProvider.Imdb, externalIds.ImdbId);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!string.IsNullOrEmpty(externalIds?.TvrageId))
|
|
||||||
{
|
|
||||||
item.SetProviderId(MetadataProvider.TvRage, externalIds.TvrageId);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (episodeResult.Videos?.Results is not null)
|
if (episodeResult.Videos?.Results is not null)
|
||||||
{
|
{
|
||||||
|
|
|
@ -73,10 +73,7 @@ namespace MediaBrowser.Providers.Plugins.Tmdb.TV
|
||||||
result.Item.Name = seasonResult.Name;
|
result.Item.Name = seasonResult.Name;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!string.IsNullOrEmpty(seasonResult.ExternalIds?.TvdbId))
|
result.Item.TrySetProviderId(MetadataProvider.Tvdb, seasonResult.ExternalIds.TvdbId);
|
||||||
{
|
|
||||||
result.Item.SetProviderId(MetadataProvider.Tvdb, seasonResult.ExternalIds.TvdbId);
|
|
||||||
}
|
|
||||||
|
|
||||||
// TODO why was this disabled?
|
// TODO why was this disabled?
|
||||||
var credits = seasonResult.Credits;
|
var credits = seasonResult.Credits;
|
||||||
|
|
|
@ -135,15 +135,9 @@ namespace MediaBrowser.Providers.Plugins.Tmdb.TV
|
||||||
remoteResult.SetProviderId(MetadataProvider.Tmdb, series.Id.ToString(CultureInfo.InvariantCulture));
|
remoteResult.SetProviderId(MetadataProvider.Tmdb, series.Id.ToString(CultureInfo.InvariantCulture));
|
||||||
if (series.ExternalIds is not null)
|
if (series.ExternalIds is not null)
|
||||||
{
|
{
|
||||||
if (!string.IsNullOrEmpty(series.ExternalIds.ImdbId))
|
remoteResult.TrySetProviderId(MetadataProvider.Imdb, series.ExternalIds.ImdbId);
|
||||||
{
|
|
||||||
remoteResult.SetProviderId(MetadataProvider.Imdb, series.ExternalIds.ImdbId);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!string.IsNullOrEmpty(series.ExternalIds.TvdbId))
|
remoteResult.TrySetProviderId(MetadataProvider.Tvdb, series.ExternalIds.TvdbId);
|
||||||
{
|
|
||||||
remoteResult.SetProviderId(MetadataProvider.Tvdb, series.ExternalIds.TvdbId);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
remoteResult.PremiereDate = series.FirstAirDate?.ToUniversalTime();
|
remoteResult.PremiereDate = series.FirstAirDate?.ToUniversalTime();
|
||||||
|
@ -289,20 +283,9 @@ namespace MediaBrowser.Providers.Plugins.Tmdb.TV
|
||||||
var ids = seriesResult.ExternalIds;
|
var ids = seriesResult.ExternalIds;
|
||||||
if (ids is not null)
|
if (ids is not null)
|
||||||
{
|
{
|
||||||
if (!string.IsNullOrWhiteSpace(ids.ImdbId))
|
series.TrySetProviderId(MetadataProvider.Imdb, ids.ImdbId);
|
||||||
{
|
series.TrySetProviderId(MetadataProvider.TvRage, ids.TvrageId);
|
||||||
series.SetProviderId(MetadataProvider.Imdb, ids.ImdbId);
|
series.TrySetProviderId(MetadataProvider.Tvdb, ids.TvdbId);
|
||||||
}
|
|
||||||
|
|
||||||
if (!string.IsNullOrEmpty(ids.TvrageId))
|
|
||||||
{
|
|
||||||
series.SetProviderId(MetadataProvider.TvRage, ids.TvrageId);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!string.IsNullOrEmpty(ids.TvdbId))
|
|
||||||
{
|
|
||||||
series.SetProviderId(MetadataProvider.Tvdb, ids.TvdbId);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var contentRatings = seriesResult.ContentRatings.Results ?? new List<ContentRating>();
|
var contentRatings = seriesResult.ContentRatings.Results ?? new List<ContentRating>();
|
||||||
|
|
|
@ -572,10 +572,7 @@ namespace MediaBrowser.XbmcMetadata.Parsers
|
||||||
|
|
||||||
var provider = reader.GetAttribute("type");
|
var provider = reader.GetAttribute("type");
|
||||||
var providerId = reader.ReadElementContentAsString();
|
var providerId = reader.ReadElementContentAsString();
|
||||||
if (!string.IsNullOrWhiteSpace(provider) && !string.IsNullOrWhiteSpace(providerId))
|
item.TrySetProviderId(provider, providerId);
|
||||||
{
|
|
||||||
item.SetProviderId(provider, providerId);
|
|
||||||
}
|
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case "thumb":
|
case "thumb":
|
||||||
|
@ -604,10 +601,7 @@ namespace MediaBrowser.XbmcMetadata.Parsers
|
||||||
if (_validProviderIds.TryGetValue(readerName, out string? providerIdValue))
|
if (_validProviderIds.TryGetValue(readerName, out string? providerIdValue))
|
||||||
{
|
{
|
||||||
var id = reader.ReadElementContentAsString();
|
var id = reader.ReadElementContentAsString();
|
||||||
if (!string.IsNullOrWhiteSpace(providerIdValue) && !string.IsNullOrWhiteSpace(id))
|
item.TrySetProviderId(providerIdValue, id);
|
||||||
{
|
|
||||||
item.SetProviderId(providerIdValue, id);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
@ -65,15 +65,8 @@ namespace MediaBrowser.XbmcMetadata.Parsers
|
||||||
tmdbId = contentId;
|
tmdbId = contentId;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!string.IsNullOrWhiteSpace(imdbId))
|
item.TrySetProviderId(MetadataProvider.Imdb, imdbId);
|
||||||
{
|
item.TrySetProviderId(MetadataProvider.Tmdb, tmdbId);
|
||||||
item.SetProviderId(MetadataProvider.Imdb, imdbId);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!string.IsNullOrWhiteSpace(tmdbId))
|
|
||||||
{
|
|
||||||
item.SetProviderId(MetadataProvider.Tmdb, tmdbId);
|
|
||||||
}
|
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -83,10 +76,7 @@ namespace MediaBrowser.XbmcMetadata.Parsers
|
||||||
var movie = item as Movie;
|
var movie = item as Movie;
|
||||||
|
|
||||||
var tmdbcolid = reader.GetAttribute("tmdbcolid");
|
var tmdbcolid = reader.GetAttribute("tmdbcolid");
|
||||||
if (!string.IsNullOrWhiteSpace(tmdbcolid) && movie is not null)
|
movie?.TrySetProviderId(MetadataProvider.TmdbCollection, tmdbcolid);
|
||||||
{
|
|
||||||
movie.SetProviderId(MetadataProvider.TmdbCollection, tmdbcolid);
|
|
||||||
}
|
|
||||||
|
|
||||||
var val = reader.ReadInnerXml();
|
var val = reader.ReadInnerXml();
|
||||||
|
|
||||||
|
|
|
@ -48,29 +48,16 @@ namespace MediaBrowser.XbmcMetadata.Parsers
|
||||||
{
|
{
|
||||||
case "id":
|
case "id":
|
||||||
{
|
{
|
||||||
string? imdbId = reader.GetAttribute("IMDB");
|
item.TrySetProviderId(MetadataProvider.Imdb, reader.GetAttribute("IMDB"));
|
||||||
string? tmdbId = reader.GetAttribute("TMDB");
|
item.TrySetProviderId(MetadataProvider.Tmdb, reader.GetAttribute("TMDB"));
|
||||||
string? tvdbId = reader.GetAttribute("TVDB");
|
|
||||||
|
|
||||||
|
string? tvdbId = reader.GetAttribute("TVDB");
|
||||||
if (string.IsNullOrWhiteSpace(tvdbId))
|
if (string.IsNullOrWhiteSpace(tvdbId))
|
||||||
{
|
{
|
||||||
tvdbId = reader.ReadElementContentAsString();
|
tvdbId = reader.ReadElementContentAsString();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!string.IsNullOrWhiteSpace(imdbId))
|
item.TrySetProviderId(MetadataProvider.Tvdb, tvdbId);
|
||||||
{
|
|
||||||
item.SetProviderId(MetadataProvider.Imdb, imdbId);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!string.IsNullOrWhiteSpace(tmdbId))
|
|
||||||
{
|
|
||||||
item.SetProviderId(MetadataProvider.Tmdb, tmdbId);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!string.IsNullOrWhiteSpace(tvdbId))
|
|
||||||
{
|
|
||||||
item.SetProviderId(MetadataProvider.Tvdb, tvdbId);
|
|
||||||
}
|
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -479,10 +479,7 @@ public class GuideManager : IGuideManager
|
||||||
DateModified = DateTime.UtcNow
|
DateModified = DateTime.UtcNow
|
||||||
};
|
};
|
||||||
|
|
||||||
if (!string.IsNullOrEmpty(info.Etag))
|
item.TrySetProviderId(EtagKey, info.Etag);
|
||||||
{
|
|
||||||
item.SetProviderId(EtagKey, info.Etag);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!string.Equals(info.ShowId, item.ShowId, StringComparison.OrdinalIgnoreCase))
|
if (!string.Equals(info.ShowId, item.ShowId, StringComparison.OrdinalIgnoreCase))
|
||||||
|
|
Loading…
Reference in New Issue
Block a user