|
|
@ -195,52 +195,55 @@ namespace Emby.Server.Implementations.Configuration
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void DisableMetadataService(string service)
|
|
|
|
public bool SetOptimalValues()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
DisableMetadataService(typeof(Movie), Configuration, service);
|
|
|
|
var config = Configuration;
|
|
|
|
DisableMetadataService(typeof(Episode), Configuration, service);
|
|
|
|
|
|
|
|
DisableMetadataService(typeof(Series), Configuration, service);
|
|
|
|
|
|
|
|
DisableMetadataService(typeof(Season), Configuration, service);
|
|
|
|
|
|
|
|
DisableMetadataService(typeof(MusicArtist), Configuration, service);
|
|
|
|
|
|
|
|
DisableMetadataService(typeof(MusicAlbum), Configuration, service);
|
|
|
|
|
|
|
|
DisableMetadataService(typeof(MusicVideo), Configuration, service);
|
|
|
|
|
|
|
|
DisableMetadataService(typeof(Video), Configuration, service);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private void DisableMetadataService(Type type, ServerConfiguration config, string service)
|
|
|
|
var changed = false;
|
|
|
|
{
|
|
|
|
|
|
|
|
var options = GetMetadataOptions(type, config);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!options.DisabledMetadataSavers.Contains(service, StringComparer.OrdinalIgnoreCase))
|
|
|
|
if (!config.EnableCaseSensitiveItemIds)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
var list = options.DisabledMetadataSavers.ToList();
|
|
|
|
config.EnableCaseSensitiveItemIds = true;
|
|
|
|
|
|
|
|
changed = true;
|
|
|
|
list.Add(service);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
options.DisabledMetadataSavers = list.ToArray(list.Count);
|
|
|
|
if (!config.SkipDeserializationForBasicTypes)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
config.SkipDeserializationForBasicTypes = true;
|
|
|
|
|
|
|
|
changed = true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private MetadataOptions GetMetadataOptions(Type type, ServerConfiguration config)
|
|
|
|
if (!config.EnableSimpleArtistDetection)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
var options = config.MetadataOptions
|
|
|
|
config.EnableSimpleArtistDetection = true;
|
|
|
|
.FirstOrDefault(i => string.Equals(i.ItemType, type.Name, StringComparison.OrdinalIgnoreCase));
|
|
|
|
changed = true;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (options == null)
|
|
|
|
if (!config.EnableNormalizedItemByNameIds)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
var list = config.MetadataOptions.ToList();
|
|
|
|
config.EnableNormalizedItemByNameIds = true;
|
|
|
|
|
|
|
|
changed = true;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
options = new MetadataOptions
|
|
|
|
if (!config.DisableLiveTvChannelUserDataName)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
ItemType = type.Name
|
|
|
|
config.DisableLiveTvChannelUserDataName = true;
|
|
|
|
};
|
|
|
|
changed = true;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
list.Add(options);
|
|
|
|
if (!config.EnableNewOmdbSupport)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
config.EnableNewOmdbSupport = true;
|
|
|
|
|
|
|
|
changed = true;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
config.MetadataOptions = list.ToArray(list.Count);
|
|
|
|
if (!config.EnableLocalizedGuids)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
config.EnableLocalizedGuids = true;
|
|
|
|
|
|
|
|
changed = true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return options;
|
|
|
|
return changed;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|