normalize strm file contents
This commit is contained in:
parent
5fa007d04e
commit
0a0303ca64
|
@ -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;
|
||||
|
||||
var changed = false;
|
||||
|
||||
if (!config.EnableCaseSensitiveItemIds)
|
||||
{
|
||||
config.EnableCaseSensitiveItemIds = true;
|
||||
changed = true;
|
||||
}
|
||||
|
||||
private void DisableMetadataService(Type type, ServerConfiguration config, string service)
|
||||
if (!config.SkipDeserializationForBasicTypes)
|
||||
{
|
||||
var options = GetMetadataOptions(type, config);
|
||||
|
||||
if (!options.DisabledMetadataSavers.Contains(service, StringComparer.OrdinalIgnoreCase))
|
||||
{
|
||||
var list = options.DisabledMetadataSavers.ToList();
|
||||
|
||||
list.Add(service);
|
||||
|
||||
options.DisabledMetadataSavers = list.ToArray(list.Count);
|
||||
}
|
||||
config.SkipDeserializationForBasicTypes = true;
|
||||
changed = true;
|
||||
}
|
||||
|
||||
private MetadataOptions GetMetadataOptions(Type type, ServerConfiguration config)
|
||||
if (!config.EnableSimpleArtistDetection)
|
||||
{
|
||||
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.EnableSimpleArtistDetection = true;
|
||||
changed = true;
|
||||
}
|
||||
|
||||
return options;
|
||||
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);
|
||||
|
|
|
@ -134,8 +134,6 @@ namespace MediaBrowser.Api
|
|||
|
||||
public void Post(AutoSetMetadataOptions request)
|
||||
{
|
||||
_configurationManager.DisableMetadataService("Emby Xml");
|
||||
_configurationManager.SaveConfiguration();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
|
@ -63,7 +63,7 @@ namespace MediaBrowser.Api
|
|||
public void Post(ReportStartupWizardComplete request)
|
||||
{
|
||||
_config.Configuration.IsStartupWizardCompleted = true;
|
||||
SetWizardFinishValues(_config.Configuration);
|
||||
_config.SetOptimalValues();
|
||||
_config.SaveConfiguration();
|
||||
}
|
||||
|
||||
|
@ -87,16 +87,6 @@ namespace MediaBrowser.Api
|
|||
return result;
|
||||
}
|
||||
|
||||
private void SetWizardFinishValues(ServerConfiguration config)
|
||||
{
|
||||
config.EnableCaseSensitiveItemIds = true;
|
||||
config.SkipDeserializationForBasicTypes = true;
|
||||
config.EnableSimpleArtistDetection = true;
|
||||
config.EnableNormalizedItemByNameIds = true;
|
||||
config.DisableLiveTvChannelUserDataName = true;
|
||||
config.EnableNewOmdbSupport = true;
|
||||
}
|
||||
|
||||
public void Post(UpdateStartupConfiguration request)
|
||||
{
|
||||
_config.Configuration.UICulture = request.UICulture;
|
||||
|
|
|
@ -20,10 +20,6 @@ namespace MediaBrowser.Controller.Configuration
|
|||
/// <value>The configuration.</value>
|
||||
ServerConfiguration Configuration { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Sets the preferred metadata service.
|
||||
/// </summary>
|
||||
/// <param name="service">The service.</param>
|
||||
void DisableMetadataService(string service);
|
||||
bool SetOptimalValues();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -189,6 +189,8 @@ namespace MediaBrowser.Model.Configuration
|
|||
public PathSubstitution[] PathSubstitutions { get; set; }
|
||||
public bool EnableSimpleArtistDetection { get; set; }
|
||||
|
||||
public bool EnableLocalizedGuids { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="ServerConfiguration" /> class.
|
||||
/// </summary>
|
||||
|
@ -200,6 +202,7 @@ namespace MediaBrowser.Model.Configuration
|
|||
PathSubstitutions = new PathSubstitution[] { };
|
||||
EnableSimpleArtistDetection = true;
|
||||
|
||||
EnableLocalizedGuids = true;
|
||||
DisplaySpecialsWithinSeasons = true;
|
||||
EnableExternalContentInSuggestions = true;
|
||||
|
||||
|
|
|
@ -1,9 +0,0 @@
|
|||
using System;
|
||||
|
||||
namespace MediaBrowser.Model.Dlna
|
||||
{
|
||||
public class PlaybackException : Exception
|
||||
{
|
||||
public PlaybackErrorCode ErrorCode { get; set;}
|
||||
}
|
||||
}
|
|
@ -1,5 +1,6 @@
|
|||
using System.Collections.Generic;
|
||||
using MediaBrowser.Model.Entities;
|
||||
using System.Globalization;
|
||||
|
||||
namespace MediaBrowser.Model.Globalization
|
||||
{
|
||||
|
@ -54,5 +55,7 @@ namespace MediaBrowser.Model.Globalization
|
|||
string RemoveDiacritics(string text);
|
||||
|
||||
string NormalizeFormKD(string text);
|
||||
|
||||
bool HasUnicodeCategory(string value, UnicodeCategory category);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -98,7 +98,6 @@
|
|||
<Compile Include="Dlna\ResponseProfile.cs" />
|
||||
<Compile Include="Dlna\StreamInfoSorter.cs" />
|
||||
<Compile Include="Dlna\PlaybackErrorCode.cs" />
|
||||
<Compile Include="Dlna\PlaybackException.cs" />
|
||||
<Compile Include="Dlna\ResolutionConfiguration.cs" />
|
||||
<Compile Include="Dlna\ResolutionNormalizer.cs" />
|
||||
<Compile Include="Dlna\ResolutionOptions.cs" />
|
||||
|
|
|
@ -163,7 +163,11 @@ namespace MediaBrowser.Providers.MediaInfo
|
|||
|
||||
private void FetchShortcutInfo(Video video)
|
||||
{
|
||||
video.ShortcutPath = _fileSystem.ReadAllText(video.Path);
|
||||
video.ShortcutPath = _fileSystem.ReadAllText(video.Path)
|
||||
.Replace("\t", string.Empty)
|
||||
.Replace("\r", string.Empty)
|
||||
.Replace("\n", string.Empty)
|
||||
.Trim();
|
||||
}
|
||||
|
||||
public Task<ItemUpdateType> FetchAudioInfo<T>(T item, CancellationToken cancellationToken)
|
||||
|
|
Loading…
Reference in New Issue
Block a user