mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-07-16 11:13:32 +01:00
normalize strm file contents
This commit is contained in:
@@ -195,52 +195,55 @@ namespace Emby.Server.Implementations.Configuration
|
||||
}
|
||||
}
|
||||
|
||||
public void DisableMetadataService(string service)
|
||||
public bool SetOptimalValues()
|
||||
{
|
||||
DisableMetadataService(typeof(Movie), Configuration, service);
|
||||
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);
|
||||
}
|
||||
var config = Configuration;
|
||||
|
||||
private void DisableMetadataService(Type type, ServerConfiguration config, string service)
|
||||
{
|
||||
var options = GetMetadataOptions(type, config);
|
||||
var changed = false;
|
||||
|
||||
if (!options.DisabledMetadataSavers.Contains(service, StringComparer.OrdinalIgnoreCase))
|
||||
if (!config.EnableCaseSensitiveItemIds)
|
||||
{
|
||||
var list = options.DisabledMetadataSavers.ToList();
|
||||
|
||||
list.Add(service);
|
||||
|
||||
options.DisabledMetadataSavers = list.ToArray(list.Count);
|
||||
}
|
||||
}
|
||||
|
||||
private MetadataOptions GetMetadataOptions(Type type, ServerConfiguration config)
|
||||
{
|
||||
var options = config.MetadataOptions
|
||||
.FirstOrDefault(i => string.Equals(i.ItemType, type.Name, StringComparison.OrdinalIgnoreCase));
|
||||
|
||||
if (options == null)
|
||||
{
|
||||
var list = config.MetadataOptions.ToList();
|
||||
|
||||
options = new MetadataOptions
|
||||
{
|
||||
ItemType = type.Name
|
||||
};
|
||||
|
||||
list.Add(options);
|
||||
|
||||
config.MetadataOptions = list.ToArray(list.Count);
|
||||
config.EnableCaseSensitiveItemIds = true;
|
||||
changed = true;
|
||||
}
|
||||
|
||||
return options;
|
||||
if (!config.SkipDeserializationForBasicTypes)
|
||||
{
|
||||
config.SkipDeserializationForBasicTypes = true;
|
||||
changed = true;
|
||||
}
|
||||
|
||||
if (!config.EnableSimpleArtistDetection)
|
||||
{
|
||||
config.EnableSimpleArtistDetection = true;
|
||||
changed = true;
|
||||
}
|
||||
|
||||
if (!config.EnableNormalizedItemByNameIds)
|
||||
{
|
||||
config.EnableNormalizedItemByNameIds = true;
|
||||
changed = true;
|
||||
}
|
||||
|
||||
if (!config.DisableLiveTvChannelUserDataName)
|
||||
{
|
||||
config.DisableLiveTvChannelUserDataName = true;
|
||||
changed = true;
|
||||
}
|
||||
|
||||
if (!config.EnableNewOmdbSupport)
|
||||
{
|
||||
config.EnableNewOmdbSupport = true;
|
||||
changed = true;
|
||||
}
|
||||
|
||||
if (!config.EnableLocalizedGuids)
|
||||
{
|
||||
config.EnableLocalizedGuids = true;
|
||||
changed = true;
|
||||
}
|
||||
|
||||
return changed;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5298,7 +5298,8 @@ where AncestorIdText not null and ItemValues.Value not null and ItemValues.Type
|
||||
OfficialRatings = query.OfficialRatings,
|
||||
GenreIds = query.GenreIds,
|
||||
Genres = query.Genres,
|
||||
Years = query.Years
|
||||
Years = query.Years,
|
||||
NameContains = query.NameContains
|
||||
};
|
||||
|
||||
var outerWhereClauses = GetWhereClauses(outerQuery, null);
|
||||
|
||||
@@ -506,7 +506,7 @@ namespace Emby.Server.Implementations.Library
|
||||
throw new ArgumentNullException("type");
|
||||
}
|
||||
|
||||
if (key.StartsWith(ConfigurationManager.ApplicationPaths.ProgramDataPath))
|
||||
if (ConfigurationManager.Configuration.EnableLocalizedGuids && key.StartsWith(ConfigurationManager.ApplicationPaths.ProgramDataPath))
|
||||
{
|
||||
// Try to normalize paths located underneath program-data in an attempt to make them more portable
|
||||
key = key.Substring(ConfigurationManager.ApplicationPaths.ProgramDataPath.Length)
|
||||
|
||||
@@ -308,6 +308,19 @@ namespace Emby.Server.Implementations.Localization
|
||||
return value == null ? (int?)null : value.Value;
|
||||
}
|
||||
|
||||
public bool HasUnicodeCategory(string value, UnicodeCategory category)
|
||||
{
|
||||
foreach (var chr in value)
|
||||
{
|
||||
if (char.GetUnicodeCategory(chr) == category)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public string GetLocalizedString(string phrase)
|
||||
{
|
||||
return GetLocalizedString(phrase, _configurationManager.Configuration.UICulture);
|
||||
|
||||
Reference in New Issue
Block a user