diff options
| author | Luke Pulverenti <luke.pulverenti@gmail.com> | 2017-04-18 01:53:39 -0400 |
|---|---|---|
| committer | Luke Pulverenti <luke.pulverenti@gmail.com> | 2017-04-18 01:53:39 -0400 |
| commit | 4d7d8961b44aadd1d1c8f84bedd5d5ff9508d876 (patch) | |
| tree | 2d6390aa6429d6ef37191235f2140611262186da /Emby.Server.Implementations | |
| parent | 6a66aef608a0caa567f603edbd9a4e3466fda469 (diff) | |
update encoding detection
Diffstat (limited to 'Emby.Server.Implementations')
4 files changed, 2 insertions, 52 deletions
diff --git a/Emby.Server.Implementations/Data/SqliteItemRepository.cs b/Emby.Server.Implementations/Data/SqliteItemRepository.cs index c5ba6c892..51f91acf3 100644 --- a/Emby.Server.Implementations/Data/SqliteItemRepository.cs +++ b/Emby.Server.Implementations/Data/SqliteItemRepository.cs @@ -1990,24 +1990,6 @@ namespace Emby.Server.Implementations.Data } index++; - if (string.IsNullOrWhiteSpace(item.Tagline)) - { - var movie = item as Movie; - if (movie != null && movie.Taglines.Count > 0) - { - movie.Tagline = movie.Taglines[0]; - } - } - - if (type == typeof(Person) && item.ProductionLocations.Count == 0) - { - var person = (Person)item; - if (!string.IsNullOrWhiteSpace(person.PlaceOfBirth)) - { - item.ProductionLocations = new List<string> { person.PlaceOfBirth }; - } - } - return item; } diff --git a/Emby.Server.Implementations/Emby.Server.Implementations.csproj b/Emby.Server.Implementations/Emby.Server.Implementations.csproj index 4b1418007..d4766e1ec 100644 --- a/Emby.Server.Implementations/Emby.Server.Implementations.csproj +++ b/Emby.Server.Implementations/Emby.Server.Implementations.csproj @@ -311,10 +311,6 @@ <HintPath>..\packages\SQLitePCLRaw.core.1.1.2\lib\portable-net45+netcore45+wpa81+MonoAndroid10+MonoTouch10+Xamarin.iOS10\SQLitePCLRaw.core.dll</HintPath> <Private>True</Private> </Reference> - <Reference Include="UniversalDetector, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL"> - <HintPath>..\packages\UniversalDetector.1.0.1\lib\portable-net45+sl4+wp71+win8+wpa81\UniversalDetector.dll</HintPath> - <Private>True</Private> - </Reference> </ItemGroup> <ItemGroup> <EmbeddedResource Include="Localization\Core\ar.json" /> diff --git a/Emby.Server.Implementations/ServerManager/WebSocketConnection.cs b/Emby.Server.Implementations/ServerManager/WebSocketConnection.cs index 4608a13e6..ac20fe7b3 100644 --- a/Emby.Server.Implementations/ServerManager/WebSocketConnection.cs +++ b/Emby.Server.Implementations/ServerManager/WebSocketConnection.cs @@ -13,7 +13,6 @@ using MediaBrowser.Common.IO; using MediaBrowser.Model.IO; using MediaBrowser.Model.Services; using MediaBrowser.Model.Text; -using UniversalDetector; namespace Emby.Server.Implementations.ServerManager { @@ -137,7 +136,8 @@ namespace Emby.Server.Implementations.ServerManager { return; } - var charset = DetectCharset(bytes); + + var charset = _textEncoding.GetDetectedEncodingName(bytes, null); if (string.Equals(charset, "utf-8", StringComparison.OrdinalIgnoreCase)) { @@ -148,33 +148,6 @@ namespace Emby.Server.Implementations.ServerManager OnReceiveInternal(_textEncoding.GetASCIIEncoding().GetString(bytes, 0, bytes.Length)); } } - private string DetectCharset(byte[] bytes) - { - try - { - using (var ms = _memoryStreamProvider.CreateNew(bytes)) - { - var detector = new CharsetDetector(); - detector.Feed(ms); - detector.DataEnd(); - - var charset = detector.Charset; - - if (!string.IsNullOrWhiteSpace(charset)) - { - //_logger.Debug("UniversalDetector detected charset {0}", charset); - } - - return charset; - } - } - catch (IOException ex) - { - _logger.ErrorException("Error attempting to determine web socket message charset", ex); - } - - return null; - } private void OnReceiveInternal(string message) { diff --git a/Emby.Server.Implementations/packages.config b/Emby.Server.Implementations/packages.config index ac4e885c7..e4c75e1e9 100644 --- a/Emby.Server.Implementations/packages.config +++ b/Emby.Server.Implementations/packages.config @@ -4,5 +4,4 @@ <package id="MediaBrowser.Naming" version="1.0.5" targetFramework="portable45-net45+win8" /> <package id="SQLitePCL.pretty" version="1.1.0" targetFramework="portable45-net45+win8" /> <package id="SQLitePCLRaw.core" version="1.1.2" targetFramework="portable45-net45+win8" /> - <package id="UniversalDetector" version="1.0.1" targetFramework="portable45-net45+win8" /> </packages>
\ No newline at end of file |
