aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Pulverenti <luke.pulverenti@gmail.com>2017-06-18 03:11:55 -0400
committerLuke Pulverenti <luke.pulverenti@gmail.com>2017-06-18 03:11:55 -0400
commitce47f6338950853110ecc1d6bbd312b532b2ed8a (patch)
tree9fc42f1d9cc0f962a3a0424bb70298ba7855340f
parent0e7cbb04651bd9b65668ca1635a4625640639560 (diff)
3.2.20.5
-rw-r--r--Emby.Common.Implementations/TextEncoding/TextEncoding.cs18
-rw-r--r--Emby.Server.Implementations/Dto/DtoService.cs6
-rw-r--r--Emby.Server.Implementations/ServerManager/WebSocketConnection.cs2
-rw-r--r--MediaBrowser.MediaEncoding/Subtitles/SubtitleEncoder.cs4
-rw-r--r--MediaBrowser.Model/Text/ITextEncoding.cs4
-rw-r--r--SharedVersion.cs2
6 files changed, 18 insertions, 18 deletions
diff --git a/Emby.Common.Implementations/TextEncoding/TextEncoding.cs b/Emby.Common.Implementations/TextEncoding/TextEncoding.cs
index a5caae391..021caec75 100644
--- a/Emby.Common.Implementations/TextEncoding/TextEncoding.cs
+++ b/Emby.Common.Implementations/TextEncoding/TextEncoding.cs
@@ -68,7 +68,7 @@ namespace Emby.Common.Implementations.TextEncoding
}
private bool _langDetectInitialized;
- public string GetDetectedEncodingName(byte[] bytes, string language)
+ public string GetDetectedEncodingName(byte[] bytes, string language, bool enableLanguageDetection)
{
var encoding = GetInitialEncoding(bytes);
@@ -77,14 +77,14 @@ namespace Emby.Common.Implementations.TextEncoding
return "utf-8";
}
- if (!_langDetectInitialized)
+ if (string.IsNullOrWhiteSpace(language) && enableLanguageDetection)
{
- _langDetectInitialized = true;
- LanguageDetector.Initialize(_json);
- }
+ if (!_langDetectInitialized)
+ {
+ _langDetectInitialized = true;
+ LanguageDetector.Initialize(_json);
+ }
- if (string.IsNullOrWhiteSpace(language))
- {
language = DetectLanguage(bytes);
if (!string.IsNullOrWhiteSpace(language))
@@ -167,9 +167,9 @@ namespace Emby.Common.Implementations.TextEncoding
}
}
- public Encoding GetDetectedEncoding(byte[] bytes, string language)
+ public Encoding GetDetectedEncoding(byte[] bytes, string language, bool enableLanguageDetection)
{
- var charset = GetDetectedEncodingName(bytes, language);
+ var charset = GetDetectedEncodingName(bytes, language, enableLanguageDetection);
return GetEncodingFromCharset(charset);
}
diff --git a/Emby.Server.Implementations/Dto/DtoService.cs b/Emby.Server.Implementations/Dto/DtoService.cs
index ae988f938..7352073bd 100644
--- a/Emby.Server.Implementations/Dto/DtoService.cs
+++ b/Emby.Server.Implementations/Dto/DtoService.cs
@@ -778,16 +778,16 @@ namespace Emby.Server.Implementations.Dto
.Select(i => new NameIdPair
{
Name = i,
- Id = GetStudioId(i, item)
+ Id = GetGenreId(i, item)
})
.ToArray();
}
- private string GetStudioId(string name, BaseItem owner)
+ private string GetGenreId(string name, BaseItem owner)
{
if (owner is IHasMusicGenres)
{
- return _libraryManager.GetGameGenreId(name).ToString("N");
+ return _libraryManager.GetMusicGenreId(name).ToString("N");
}
if (owner is Game || owner is GameSystem)
diff --git a/Emby.Server.Implementations/ServerManager/WebSocketConnection.cs b/Emby.Server.Implementations/ServerManager/WebSocketConnection.cs
index e4392d7e6..4d5192fea 100644
--- a/Emby.Server.Implementations/ServerManager/WebSocketConnection.cs
+++ b/Emby.Server.Implementations/ServerManager/WebSocketConnection.cs
@@ -136,7 +136,7 @@ namespace Emby.Server.Implementations.ServerManager
return;
}
- var charset = _textEncoding.GetDetectedEncodingName(bytes, null);
+ var charset = _textEncoding.GetDetectedEncodingName(bytes, null, false);
if (string.Equals(charset, "utf-8", StringComparison.OrdinalIgnoreCase))
{
diff --git a/MediaBrowser.MediaEncoding/Subtitles/SubtitleEncoder.cs b/MediaBrowser.MediaEncoding/Subtitles/SubtitleEncoder.cs
index f8f95684d..247c5274f 100644
--- a/MediaBrowser.MediaEncoding/Subtitles/SubtitleEncoder.cs
+++ b/MediaBrowser.MediaEncoding/Subtitles/SubtitleEncoder.cs
@@ -198,7 +198,7 @@ namespace MediaBrowser.MediaEncoding.Subtitles
{
var bytes = await GetBytes(path, protocol, cancellationToken).ConfigureAwait(false);
- var charset = _textEncoding.GetDetectedEncodingName(bytes, language);
+ var charset = _textEncoding.GetDetectedEncodingName(bytes, language, true);
_logger.Debug("charset {0} detected for {1}", charset ?? "null", path);
if (!string.IsNullOrEmpty(charset))
@@ -705,7 +705,7 @@ namespace MediaBrowser.MediaEncoding.Subtitles
{
var bytes = await GetBytes(path, protocol, cancellationToken).ConfigureAwait(false);
- var charset = _textEncoding.GetDetectedEncodingName(bytes, language);
+ var charset = _textEncoding.GetDetectedEncodingName(bytes, language, true);
_logger.Debug("charset {0} detected for {1}", charset ?? "null", path);
diff --git a/MediaBrowser.Model/Text/ITextEncoding.cs b/MediaBrowser.Model/Text/ITextEncoding.cs
index 7424f00f5..96dca0c04 100644
--- a/MediaBrowser.Model/Text/ITextEncoding.cs
+++ b/MediaBrowser.Model/Text/ITextEncoding.cs
@@ -7,8 +7,8 @@ namespace MediaBrowser.Model.Text
{
Encoding GetASCIIEncoding();
- string GetDetectedEncodingName(byte[] bytes, string language);
- Encoding GetDetectedEncoding(byte[] bytes, string language);
+ string GetDetectedEncodingName(byte[] bytes, string language, bool enableLanguageDetection);
+ Encoding GetDetectedEncoding(byte[] bytes, string language, bool enableLanguageDetection);
Encoding GetEncodingFromCharset(string charset);
}
}
diff --git a/SharedVersion.cs b/SharedVersion.cs
index adeff3508..939f3f388 100644
--- a/SharedVersion.cs
+++ b/SharedVersion.cs
@@ -1,3 +1,3 @@
using System.Reflection;
-[assembly: AssemblyVersion("3.2.20.4")]
+[assembly: AssemblyVersion("3.2.20.5")]