aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Emby.Dlna/Didl/DidlBuilder.cs8
-rw-r--r--Emby.Server.Implementations/Emby.Server.Implementations.csproj246
-rw-r--r--Emby.Server.Implementations/HttpServer/GetSwaggerResource.cs (renamed from MediaBrowser.Server.Implementations/HttpServer/GetSwaggerResource.cs)4
-rw-r--r--Emby.Server.Implementations/HttpServer/SocketSharp/HttpUtility.cs (renamed from MediaBrowser.Server.Implementations/HttpServer/SocketSharp/HttpUtility.cs)24
-rw-r--r--Emby.Server.Implementations/HttpServer/SwaggerService.cs (renamed from MediaBrowser.Server.Implementations/HttpServer/SwaggerService.cs)9
-rw-r--r--Emby.Server.Implementations/Localization/Core/ar.json (renamed from MediaBrowser.Server.Implementations/Localization/Core/ar.json)0
-rw-r--r--Emby.Server.Implementations/Localization/Core/bg-BG.json (renamed from MediaBrowser.Server.Implementations/Localization/Core/bg-BG.json)0
-rw-r--r--Emby.Server.Implementations/Localization/Core/ca.json (renamed from MediaBrowser.Server.Implementations/Localization/Core/ca.json)0
-rw-r--r--Emby.Server.Implementations/Localization/Core/core.json (renamed from MediaBrowser.Server.Implementations/Localization/Core/core.json)0
-rw-r--r--Emby.Server.Implementations/Localization/Core/cs.json (renamed from MediaBrowser.Server.Implementations/Localization/Core/cs.json)0
-rw-r--r--Emby.Server.Implementations/Localization/Core/da.json (renamed from MediaBrowser.Server.Implementations/Localization/Core/da.json)0
-rw-r--r--Emby.Server.Implementations/Localization/Core/de.json (renamed from MediaBrowser.Server.Implementations/Localization/Core/de.json)0
-rw-r--r--Emby.Server.Implementations/Localization/Core/el.json (renamed from MediaBrowser.Server.Implementations/Localization/Core/el.json)0
-rw-r--r--Emby.Server.Implementations/Localization/Core/en-GB.json (renamed from MediaBrowser.Server.Implementations/Localization/Core/en-GB.json)0
-rw-r--r--Emby.Server.Implementations/Localization/Core/en-US.json (renamed from MediaBrowser.Server.Implementations/Localization/Core/en-US.json)0
-rw-r--r--Emby.Server.Implementations/Localization/Core/es-AR.json (renamed from MediaBrowser.Server.Implementations/Localization/Core/es-AR.json)0
-rw-r--r--Emby.Server.Implementations/Localization/Core/es-MX.json (renamed from MediaBrowser.Server.Implementations/Localization/Core/es-MX.json)0
-rw-r--r--Emby.Server.Implementations/Localization/Core/es.json (renamed from MediaBrowser.Server.Implementations/Localization/Core/es.json)0
-rw-r--r--Emby.Server.Implementations/Localization/Core/fi.json (renamed from MediaBrowser.Server.Implementations/Localization/Core/fi.json)0
-rw-r--r--Emby.Server.Implementations/Localization/Core/fr-CA.json (renamed from MediaBrowser.Server.Implementations/Localization/Core/fr-CA.json)0
-rw-r--r--Emby.Server.Implementations/Localization/Core/fr.json (renamed from MediaBrowser.Server.Implementations/Localization/Core/fr.json)0
-rw-r--r--Emby.Server.Implementations/Localization/Core/gsw.json (renamed from MediaBrowser.Server.Implementations/Localization/Core/gsw.json)0
-rw-r--r--Emby.Server.Implementations/Localization/Core/he.json (renamed from MediaBrowser.Server.Implementations/Localization/Core/he.json)0
-rw-r--r--Emby.Server.Implementations/Localization/Core/hr.json (renamed from MediaBrowser.Server.Implementations/Localization/Core/hr.json)0
-rw-r--r--Emby.Server.Implementations/Localization/Core/hu.json (renamed from MediaBrowser.Server.Implementations/Localization/Core/hu.json)0
-rw-r--r--Emby.Server.Implementations/Localization/Core/id.json (renamed from MediaBrowser.Server.Implementations/Localization/Core/id.json)0
-rw-r--r--Emby.Server.Implementations/Localization/Core/it.json (renamed from MediaBrowser.Server.Implementations/Localization/Core/it.json)0
-rw-r--r--Emby.Server.Implementations/Localization/Core/kk.json (renamed from MediaBrowser.Server.Implementations/Localization/Core/kk.json)0
-rw-r--r--Emby.Server.Implementations/Localization/Core/ko.json (renamed from MediaBrowser.Server.Implementations/Localization/Core/ko.json)0
-rw-r--r--Emby.Server.Implementations/Localization/Core/ms.json (renamed from MediaBrowser.Server.Implementations/Localization/Core/ms.json)0
-rw-r--r--Emby.Server.Implementations/Localization/Core/nb.json (renamed from MediaBrowser.Server.Implementations/Localization/Core/nb.json)0
-rw-r--r--Emby.Server.Implementations/Localization/Core/nl.json (renamed from MediaBrowser.Server.Implementations/Localization/Core/nl.json)0
-rw-r--r--Emby.Server.Implementations/Localization/Core/pl.json (renamed from MediaBrowser.Server.Implementations/Localization/Core/pl.json)0
-rw-r--r--Emby.Server.Implementations/Localization/Core/pt-BR.json (renamed from MediaBrowser.Server.Implementations/Localization/Core/pt-BR.json)0
-rw-r--r--Emby.Server.Implementations/Localization/Core/pt-PT.json (renamed from MediaBrowser.Server.Implementations/Localization/Core/pt-PT.json)0
-rw-r--r--Emby.Server.Implementations/Localization/Core/ro.json (renamed from MediaBrowser.Server.Implementations/Localization/Core/ro.json)0
-rw-r--r--Emby.Server.Implementations/Localization/Core/ru.json (renamed from MediaBrowser.Server.Implementations/Localization/Core/ru.json)0
-rw-r--r--Emby.Server.Implementations/Localization/Core/sl-SI.json (renamed from MediaBrowser.Server.Implementations/Localization/Core/sl-SI.json)0
-rw-r--r--Emby.Server.Implementations/Localization/Core/sv.json (renamed from MediaBrowser.Server.Implementations/Localization/Core/sv.json)0
-rw-r--r--Emby.Server.Implementations/Localization/Core/tr.json (renamed from MediaBrowser.Server.Implementations/Localization/Core/tr.json)0
-rw-r--r--Emby.Server.Implementations/Localization/Core/uk.json (renamed from MediaBrowser.Server.Implementations/Localization/Core/uk.json)0
-rw-r--r--Emby.Server.Implementations/Localization/Core/vi.json (renamed from MediaBrowser.Server.Implementations/Localization/Core/vi.json)0
-rw-r--r--Emby.Server.Implementations/Localization/Core/zh-CN.json (renamed from MediaBrowser.Server.Implementations/Localization/Core/zh-CN.json)0
-rw-r--r--Emby.Server.Implementations/Localization/Core/zh-HK.json (renamed from MediaBrowser.Server.Implementations/Localization/Core/zh-HK.json)0
-rw-r--r--Emby.Server.Implementations/Localization/Core/zh-TW.json (renamed from MediaBrowser.Server.Implementations/Localization/Core/zh-TW.json)0
-rw-r--r--Emby.Server.Implementations/Localization/LocalizationManager.cs (renamed from MediaBrowser.Server.Implementations/Localization/LocalizationManager.cs)63
-rw-r--r--Emby.Server.Implementations/Localization/Ratings/au.txt (renamed from MediaBrowser.Server.Implementations/Localization/Ratings/au.txt)0
-rw-r--r--Emby.Server.Implementations/Localization/Ratings/be.txt (renamed from MediaBrowser.Server.Implementations/Localization/Ratings/be.txt)0
-rw-r--r--Emby.Server.Implementations/Localization/Ratings/br.txt (renamed from MediaBrowser.Server.Implementations/Localization/Ratings/br.txt)0
-rw-r--r--Emby.Server.Implementations/Localization/Ratings/ca.txt (renamed from MediaBrowser.Server.Implementations/Localization/Ratings/ca.txt)0
-rw-r--r--Emby.Server.Implementations/Localization/Ratings/co.txt (renamed from MediaBrowser.Server.Implementations/Localization/Ratings/co.txt)0
-rw-r--r--Emby.Server.Implementations/Localization/Ratings/de.txt (renamed from MediaBrowser.Server.Implementations/Localization/Ratings/de.txt)0
-rw-r--r--Emby.Server.Implementations/Localization/Ratings/dk.txt (renamed from MediaBrowser.Server.Implementations/Localization/Ratings/dk.txt)0
-rw-r--r--Emby.Server.Implementations/Localization/Ratings/fr.txt (renamed from MediaBrowser.Server.Implementations/Localization/Ratings/fr.txt)0
-rw-r--r--Emby.Server.Implementations/Localization/Ratings/gb.txt (renamed from MediaBrowser.Server.Implementations/Localization/Ratings/gb.txt)0
-rw-r--r--Emby.Server.Implementations/Localization/Ratings/ie.txt (renamed from MediaBrowser.Server.Implementations/Localization/Ratings/ie.txt)0
-rw-r--r--Emby.Server.Implementations/Localization/Ratings/jp.txt (renamed from MediaBrowser.Server.Implementations/Localization/Ratings/jp.txt)0
-rw-r--r--Emby.Server.Implementations/Localization/Ratings/kz.txt (renamed from MediaBrowser.Server.Implementations/Localization/Ratings/kz.txt)0
-rw-r--r--Emby.Server.Implementations/Localization/Ratings/mx.txt (renamed from MediaBrowser.Server.Implementations/Localization/Ratings/mx.txt)0
-rw-r--r--Emby.Server.Implementations/Localization/Ratings/nl.txt (renamed from MediaBrowser.Server.Implementations/Localization/Ratings/nl.txt)0
-rw-r--r--Emby.Server.Implementations/Localization/Ratings/nz.txt (renamed from MediaBrowser.Server.Implementations/Localization/Ratings/nz.txt)0
-rw-r--r--Emby.Server.Implementations/Localization/Ratings/ru.txt (renamed from MediaBrowser.Server.Implementations/Localization/Ratings/ru.txt)0
-rw-r--r--Emby.Server.Implementations/Localization/Ratings/us.txt (renamed from MediaBrowser.Server.Implementations/Localization/Ratings/us.txt)0
-rw-r--r--Emby.Server.Implementations/Localization/countries.json (renamed from MediaBrowser.Server.Implementations/Localization/countries.json)0
-rw-r--r--Emby.Server.Implementations/Localization/iso6392.txt (renamed from MediaBrowser.Server.Implementations/Localization/iso6392.txt)0
-rw-r--r--MediaBrowser.Server.Implementations/HttpServer/HttpListenerHost.cs1
-rw-r--r--MediaBrowser.Server.Implementations/HttpServer/SocketSharp/WebSocketSharpRequest.cs1
-rw-r--r--MediaBrowser.Server.Implementations/MediaBrowser.Server.Implementations.csproj209
-rw-r--r--MediaBrowser.Server.Startup.Common/ApplicationHost.cs9
-rw-r--r--MediaBrowser.Server.Startup.Common/MediaBrowser.Server.Startup.Common.csproj1
-rw-r--r--MediaBrowser.Server.Startup.Common/TextLocalizer.cs25
71 files changed, 329 insertions, 271 deletions
diff --git a/Emby.Dlna/Didl/DidlBuilder.cs b/Emby.Dlna/Didl/DidlBuilder.cs
index 50668f555..ee5c8fecd 100644
--- a/Emby.Dlna/Didl/DidlBuilder.cs
+++ b/Emby.Dlna/Didl/DidlBuilder.cs
@@ -104,6 +104,8 @@ namespace Emby.Dlna.Didl
writer.WriteStartElement(string.Empty, "item", NS_DIDL);
+ AddGeneralProperties(item, null, context, writer, filter);
+
writer.WriteAttributeString("restricted", "1");
writer.WriteAttributeString("id", clientId);
@@ -122,8 +124,6 @@ namespace Emby.Dlna.Didl
//AddBookmarkInfo(item, user, element);
- AddGeneralProperties(item, null, context, writer, filter);
-
// refID?
// storeAttribute(itemNode, object, ClassProperties.REF_ID, false);
@@ -501,6 +501,8 @@ namespace Emby.Dlna.Didl
{
writer.WriteStartElement(string.Empty, "container", NS_DIDL);
+ AddGeneralProperties(folder, stubType, context, writer, filter);
+
writer.WriteAttributeString("restricted", "0");
writer.WriteAttributeString("searchable", "1");
writer.WriteAttributeString("childCount", childCount.ToString(_usCulture));
@@ -534,8 +536,6 @@ namespace Emby.Dlna.Didl
}
}
- AddCommonFields(folder, stubType, null, writer, filter);
-
AddCover(folder, context, stubType, writer);
writer.WriteEndElement();
diff --git a/Emby.Server.Implementations/Emby.Server.Implementations.csproj b/Emby.Server.Implementations/Emby.Server.Implementations.csproj
index 8d13d206a..33f29d64d 100644
--- a/Emby.Server.Implementations/Emby.Server.Implementations.csproj
+++ b/Emby.Server.Implementations/Emby.Server.Implementations.csproj
@@ -67,11 +67,14 @@
<Compile Include="FileOrganization\NameUtils.cs" />
<Compile Include="FileOrganization\OrganizerScheduledTask.cs" />
<Compile Include="FileOrganization\TvFolderOrganizer.cs" />
+ <Compile Include="HttpServer\GetSwaggerResource.cs" />
+ <Compile Include="HttpServer\SocketSharp\HttpUtility.cs" />
<Compile Include="HttpServer\IHttpListener.cs" />
<Compile Include="HttpServer\Security\AuthorizationContext.cs" />
<Compile Include="HttpServer\Security\AuthService.cs" />
<Compile Include="HttpServer\Security\SessionContext.cs" />
<Compile Include="HttpServer\StreamWriter.cs" />
+ <Compile Include="HttpServer\SwaggerService.cs" />
<Compile Include="Images\BaseDynamicImageProvider.cs" />
<Compile Include="Intros\DefaultIntroProvider.cs" />
<Compile Include="IO\FileRefresher.cs" />
@@ -144,6 +147,7 @@
<Compile Include="LiveTv\TunerHosts\M3UTunerHost.cs" />
<Compile Include="LiveTv\TunerHosts\MulticastStream.cs" />
<Compile Include="LiveTv\TunerHosts\QueueStream.cs" />
+ <Compile Include="Localization\LocalizationManager.cs" />
<Compile Include="Logging\PatternsLogger.cs" />
<Compile Include="MediaEncoder\EncodingManager.cs" />
<Compile Include="News\NewsEntryPoint.cs" />
@@ -230,7 +234,9 @@
<Compile Include="UserViews\CollectionFolderImageProvider.cs" />
<Compile Include="UserViews\DynamicImageProvider.cs" />
</ItemGroup>
- <ItemGroup />
+ <ItemGroup>
+ <EmbeddedResource Include="Localization\iso6392.txt" />
+ </ItemGroup>
<ItemGroup>
<ProjectReference Include="..\MediaBrowser.Common\MediaBrowser.Common.csproj">
<Project>{9142eefa-7570-41e1-bfcc-468bb571af2f}</Project>
@@ -266,8 +272,246 @@
</Reference>
</ItemGroup>
<ItemGroup>
+ <Content Include="..\thirdparty\servicestack\swagger-ui\fonts\droid-sans-v6-latin-700.svg">
+ <Link>swagger-ui\fonts\droid-sans-v6-latin-700.svg</Link>
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </Content>
+ <Content Include="..\thirdparty\servicestack\swagger-ui\fonts\droid-sans-v6-latin-regular.svg">
+ <Link>swagger-ui\fonts\droid-sans-v6-latin-regular.svg</Link>
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </Content>
+ <Content Include="..\thirdparty\servicestack\swagger-ui\images\explorer_icons.png">
+ <Link>swagger-ui\images\explorer_icons.png</Link>
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </Content>
+ <Content Include="..\thirdparty\servicestack\swagger-ui\images\logo_small.png">
+ <Link>swagger-ui\images\logo_small.png</Link>
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </Content>
+ <Content Include="..\thirdparty\servicestack\swagger-ui\images\pet_store_api.png">
+ <Link>swagger-ui\images\pet_store_api.png</Link>
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </Content>
+ <Content Include="..\thirdparty\servicestack\swagger-ui\images\throbber.gif">
+ <Link>swagger-ui\images\throbber.gif</Link>
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </Content>
+ <Content Include="..\thirdparty\servicestack\swagger-ui\images\wordnik_api.png">
+ <Link>swagger-ui\images\wordnik_api.png</Link>
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </Content>
+ <Content Include="..\thirdparty\servicestack\swagger-ui\index.html">
+ <Link>swagger-ui\index.html</Link>
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </Content>
+ <Content Include="..\thirdparty\servicestack\swagger-ui\lib\backbone-min.js">
+ <Link>swagger-ui\lib\backbone-min.js</Link>
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </Content>
+ <Content Include="..\thirdparty\servicestack\swagger-ui\lib\handlebars-2.0.0.js">
+ <Link>swagger-ui\lib\handlebars-2.0.0.js</Link>
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </Content>
+ <Content Include="..\thirdparty\servicestack\swagger-ui\lib\highlight.7.3.pack.js">
+ <Link>swagger-ui\lib\highlight.7.3.pack.js</Link>
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </Content>
+ <Content Include="..\thirdparty\servicestack\swagger-ui\lib\jquery-1.8.0.min.js">
+ <Link>swagger-ui\lib\jquery-1.8.0.min.js</Link>
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </Content>
+ <Content Include="..\thirdparty\servicestack\swagger-ui\lib\jquery.ba-bbq.min.js">
+ <Link>swagger-ui\lib\jquery.ba-bbq.min.js</Link>
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </Content>
+ <Content Include="..\thirdparty\servicestack\swagger-ui\lib\jquery.slideto.min.js">
+ <Link>swagger-ui\lib\jquery.slideto.min.js</Link>
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </Content>
+ <Content Include="..\thirdparty\servicestack\swagger-ui\lib\jquery.wiggle.min.js">
+ <Link>swagger-ui\lib\jquery.wiggle.min.js</Link>
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </Content>
+ <Content Include="..\thirdparty\servicestack\swagger-ui\lib\marked.js">
+ <Link>swagger-ui\lib\marked.js</Link>
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </Content>
+ <Content Include="..\thirdparty\servicestack\swagger-ui\lib\shred.bundle.js">
+ <Link>swagger-ui\lib\shred.bundle.js</Link>
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </Content>
+ <Content Include="..\thirdparty\servicestack\swagger-ui\lib\shred\content.js">
+ <Link>swagger-ui\lib\shred\content.js</Link>
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </Content>
+ <Content Include="..\thirdparty\servicestack\swagger-ui\lib\swagger-client.js">
+ <Link>swagger-ui\lib\swagger-client.js</Link>
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </Content>
+ <Content Include="..\thirdparty\servicestack\swagger-ui\lib\swagger-oauth.js">
+ <Link>swagger-ui\lib\swagger-oauth.js</Link>
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </Content>
+ <Content Include="..\thirdparty\servicestack\swagger-ui\lib\underscore-min.js">
+ <Link>swagger-ui\lib\underscore-min.js</Link>
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </Content>
+ <Content Include="..\thirdparty\servicestack\swagger-ui\o2c.html">
+ <Link>swagger-ui\o2c.html</Link>
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </Content>
+ <Content Include="..\thirdparty\servicestack\swagger-ui\patch.js">
+ <Link>swagger-ui\patch.js</Link>
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </Content>
+ <Content Include="..\thirdparty\servicestack\swagger-ui\swagger-ui.js">
+ <Link>swagger-ui\swagger-ui.js</Link>
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </Content>
+ <Content Include="..\thirdparty\servicestack\swagger-ui\swagger-ui.min.js">
+ <Link>swagger-ui\swagger-ui.min.js</Link>
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </Content>
+ <EmbeddedResource Include="Localization\Core\ar.json" />
+ <EmbeddedResource Include="Localization\Core\bg-BG.json" />
+ <EmbeddedResource Include="Localization\Core\ca.json" />
+ <EmbeddedResource Include="Localization\Core\core.json" />
+ <EmbeddedResource Include="Localization\Core\cs.json" />
+ <EmbeddedResource Include="Localization\Core\da.json" />
+ <EmbeddedResource Include="Localization\Core\de.json" />
+ <EmbeddedResource Include="Localization\Core\el.json" />
+ <EmbeddedResource Include="Localization\Core\en-GB.json" />
+ <EmbeddedResource Include="Localization\Core\en-US.json" />
+ <EmbeddedResource Include="Localization\Core\es-AR.json" />
+ <EmbeddedResource Include="Localization\Core\es-MX.json" />
+ <EmbeddedResource Include="Localization\Core\es.json" />
+ <EmbeddedResource Include="Localization\Core\fi.json" />
+ <EmbeddedResource Include="Localization\Core\fr-CA.json" />
+ <EmbeddedResource Include="Localization\Core\fr.json" />
+ <EmbeddedResource Include="Localization\Core\gsw.json" />
+ <EmbeddedResource Include="Localization\Core\he.json" />
+ <EmbeddedResource Include="Localization\Core\hr.json" />
+ <EmbeddedResource Include="Localization\Core\hu.json" />
+ <EmbeddedResource Include="Localization\Core\id.json" />
+ <EmbeddedResource Include="Localization\Core\it.json" />
+ <EmbeddedResource Include="Localization\Core\kk.json" />
+ <EmbeddedResource Include="Localization\Core\ko.json" />
+ <EmbeddedResource Include="Localization\Core\ms.json" />
+ <EmbeddedResource Include="Localization\Core\nb.json" />
+ <EmbeddedResource Include="Localization\Core\nl.json" />
+ <EmbeddedResource Include="Localization\Core\pl.json" />
+ <EmbeddedResource Include="Localization\Core\pt-BR.json" />
+ <EmbeddedResource Include="Localization\Core\pt-PT.json" />
+ <EmbeddedResource Include="Localization\Core\ro.json" />
+ <EmbeddedResource Include="Localization\Core\ru.json" />
+ <EmbeddedResource Include="Localization\Core\sl-SI.json" />
+ <EmbeddedResource Include="Localization\Core\sv.json" />
+ <EmbeddedResource Include="Localization\Core\tr.json" />
+ <EmbeddedResource Include="Localization\Core\uk.json" />
+ <EmbeddedResource Include="Localization\Core\vi.json" />
+ <EmbeddedResource Include="Localization\Core\zh-CN.json" />
+ <EmbeddedResource Include="Localization\Core\zh-HK.json" />
+ <EmbeddedResource Include="Localization\Core\zh-TW.json" />
+ <EmbeddedResource Include="Localization\countries.json" />
+ <Content Include="..\thirdparty\servicestack\swagger-ui\fonts\droid-sans-v6-latin-700.eot">
+ <Link>swagger-ui\fonts\droid-sans-v6-latin-700.eot</Link>
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </Content>
+ <Content Include="..\thirdparty\servicestack\swagger-ui\fonts\droid-sans-v6-latin-700.ttf">
+ <Link>swagger-ui\fonts\droid-sans-v6-latin-700.ttf</Link>
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </Content>
+ <Content Include="..\thirdparty\servicestack\swagger-ui\fonts\droid-sans-v6-latin-700.woff">
+ <Link>swagger-ui\fonts\droid-sans-v6-latin-700.woff</Link>
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </Content>
+ <Content Include="..\thirdparty\servicestack\swagger-ui\fonts\droid-sans-v6-latin-700.woff2">
+ <Link>swagger-ui\fonts\droid-sans-v6-latin-700.woff2</Link>
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </Content>
+ <Content Include="..\thirdparty\servicestack\swagger-ui\fonts\droid-sans-v6-latin-regular.eot">
+ <Link>swagger-ui\fonts\droid-sans-v6-latin-regular.eot</Link>
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </Content>
+ <Content Include="..\thirdparty\servicestack\swagger-ui\fonts\droid-sans-v6-latin-regular.ttf">
+ <Link>swagger-ui\fonts\droid-sans-v6-latin-regular.ttf</Link>
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </Content>
+ <Content Include="..\thirdparty\servicestack\swagger-ui\fonts\droid-sans-v6-latin-regular.woff">
+ <Link>swagger-ui\fonts\droid-sans-v6-latin-regular.woff</Link>
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </Content>
+ <Content Include="..\thirdparty\servicestack\swagger-ui\fonts\droid-sans-v6-latin-regular.woff2">
+ <Link>swagger-ui\fonts\droid-sans-v6-latin-regular.woff2</Link>
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </Content>
<None Include="packages.config" />
</ItemGroup>
+ <ItemGroup>
+ <EmbeddedResource Include="Localization\Ratings\au.txt" />
+ </ItemGroup>
+ <ItemGroup>
+ <EmbeddedResource Include="Localization\Ratings\be.txt" />
+ </ItemGroup>
+ <ItemGroup>
+ <EmbeddedResource Include="Localization\Ratings\br.txt" />
+ </ItemGroup>
+ <ItemGroup>
+ <EmbeddedResource Include="Localization\Ratings\ca.txt" />
+ </ItemGroup>
+ <ItemGroup>
+ <EmbeddedResource Include="Localization\Ratings\co.txt" />
+ </ItemGroup>
+ <ItemGroup>
+ <EmbeddedResource Include="Localization\Ratings\de.txt" />
+ </ItemGroup>
+ <ItemGroup>
+ <EmbeddedResource Include="Localization\Ratings\dk.txt" />
+ </ItemGroup>
+ <ItemGroup>
+ <EmbeddedResource Include="Localization\Ratings\fr.txt" />
+ </ItemGroup>
+ <ItemGroup>
+ <EmbeddedResource Include="Localization\Ratings\gb.txt" />
+ </ItemGroup>
+ <ItemGroup>
+ <EmbeddedResource Include="Localization\Ratings\ie.txt" />
+ </ItemGroup>
+ <ItemGroup>
+ <EmbeddedResource Include="Localization\Ratings\jp.txt" />
+ </ItemGroup>
+ <ItemGroup>
+ <EmbeddedResource Include="Localization\Ratings\kz.txt" />
+ </ItemGroup>
+ <ItemGroup>
+ <EmbeddedResource Include="Localization\Ratings\mx.txt" />
+ </ItemGroup>
+ <ItemGroup>
+ <EmbeddedResource Include="Localization\Ratings\nl.txt" />
+ </ItemGroup>
+ <ItemGroup>
+ <EmbeddedResource Include="Localization\Ratings\nz.txt" />
+ </ItemGroup>
+ <ItemGroup>
+ <EmbeddedResource Include="Localization\Ratings\ru.txt" />
+ </ItemGroup>
+ <ItemGroup>
+ <EmbeddedResource Include="Localization\Ratings\us.txt" />
+ </ItemGroup>
+ <ItemGroup>
+ <Content Include="..\thirdparty\servicestack\swagger-ui\css\reset.css">
+ <Link>swagger-ui\css\reset.css</Link>
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </Content>
+ <Content Include="..\thirdparty\servicestack\swagger-ui\css\screen.css">
+ <Link>swagger-ui\css\screen.css</Link>
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </Content>
+ <Content Include="..\thirdparty\servicestack\swagger-ui\css\typography.css">
+ <Link>swagger-ui\css\typography.css</Link>
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </Content>
+ </ItemGroup>
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\Portable\$(TargetFrameworkVersion)\Microsoft.Portable.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
diff --git a/MediaBrowser.Server.Implementations/HttpServer/GetSwaggerResource.cs b/Emby.Server.Implementations/HttpServer/GetSwaggerResource.cs
index 36a257f63..819ede1ab 100644
--- a/MediaBrowser.Server.Implementations/HttpServer/GetSwaggerResource.cs
+++ b/Emby.Server.Implementations/HttpServer/GetSwaggerResource.cs
@@ -1,6 +1,6 @@
-using ServiceStack;
+using MediaBrowser.Model.Services;
-namespace MediaBrowser.Server.Implementations.HttpServer
+namespace Emby.Server.Implementations.HttpServer
{
/// <summary>
/// Class GetDashboardResource
diff --git a/MediaBrowser.Server.Implementations/HttpServer/SocketSharp/HttpUtility.cs b/Emby.Server.Implementations/HttpServer/SocketSharp/HttpUtility.cs
index 49d6bceb4..4fbe0ed94 100644
--- a/MediaBrowser.Server.Implementations/HttpServer/SocketSharp/HttpUtility.cs
+++ b/Emby.Server.Implementations/HttpServer/SocketSharp/HttpUtility.cs
@@ -1,33 +1,13 @@
using System;
using System.Collections;
using System.Collections.Generic;
-using System.Collections.Specialized;
using System.Text;
using MediaBrowser.Model.Services;
-namespace MediaBrowser.Server.Implementations.HttpServer.SocketSharp
+namespace Emby.Server.Implementations.HttpServer.SocketSharp
{
public static class MyHttpUtility
{
- sealed class HttpQSCollection : NameValueCollection
- {
- public override string ToString()
- {
- int count = Count;
- if (count == 0)
- return "";
- StringBuilder sb = new StringBuilder();
- string[] keys = AllKeys;
- for (int i = 0; i < count; i++)
- {
- sb.AppendFormat("{0}={1}&", keys[i], this[keys[i]]);
- }
- if (sb.Length > 0)
- sb.Length--;
- return sb.ToString();
- }
- }
-
// Must be sorted
static readonly long[] entities = new long[] {
(long)'A' << 56 | (long)'E' << 48 | (long)'l' << 40 | (long)'i' << 32 | (long)'g' << 24,
@@ -607,7 +587,7 @@ namespace MediaBrowser.Server.Implementations.HttpServer.SocketSharp
byte[] buf = bytes.ToArray();
bytes = null;
- return e.GetString(buf);
+ return e.GetString(buf, 0, buf.Length);
}
diff --git a/MediaBrowser.Server.Implementations/HttpServer/SwaggerService.cs b/Emby.Server.Implementations/HttpServer/SwaggerService.cs
index 54ee5fbb2..3c181e425 100644
--- a/MediaBrowser.Server.Implementations/HttpServer/SwaggerService.cs
+++ b/Emby.Server.Implementations/HttpServer/SwaggerService.cs
@@ -1,17 +1,20 @@
using MediaBrowser.Controller;
using MediaBrowser.Controller.Net;
using System.IO;
+using MediaBrowser.Model.IO;
using MediaBrowser.Model.Services;
-namespace MediaBrowser.Server.Implementations.HttpServer
+namespace Emby.Server.Implementations.HttpServer
{
public class SwaggerService : IHasResultFactory, IService
{
private readonly IServerApplicationPaths _appPaths;
+ private readonly IFileSystem _fileSystem;
- public SwaggerService(IServerApplicationPaths appPaths)
+ public SwaggerService(IServerApplicationPaths appPaths, IFileSystem fileSystem)
{
_appPaths = appPaths;
+ _fileSystem = fileSystem;
}
/// <summary>
@@ -23,7 +26,7 @@ namespace MediaBrowser.Server.Implementations.HttpServer
{
var swaggerDirectory = Path.Combine(_appPaths.ApplicationResourcesPath, "swagger-ui");
- var requestedFile = Path.Combine(swaggerDirectory, request.ResourceName.Replace('/', Path.DirectorySeparatorChar));
+ var requestedFile = Path.Combine(swaggerDirectory, request.ResourceName.Replace('/', _fileSystem.DirectorySeparatorChar));
return ResultFactory.GetStaticFileResult(Request, requestedFile).Result;
}
diff --git a/MediaBrowser.Server.Implementations/Localization/Core/ar.json b/Emby.Server.Implementations/Localization/Core/ar.json
index 28977c4f9..28977c4f9 100644
--- a/MediaBrowser.Server.Implementations/Localization/Core/ar.json
+++ b/Emby.Server.Implementations/Localization/Core/ar.json
diff --git a/MediaBrowser.Server.Implementations/Localization/Core/bg-BG.json b/Emby.Server.Implementations/Localization/Core/bg-BG.json
index 22b99408d..22b99408d 100644
--- a/MediaBrowser.Server.Implementations/Localization/Core/bg-BG.json
+++ b/Emby.Server.Implementations/Localization/Core/bg-BG.json
diff --git a/MediaBrowser.Server.Implementations/Localization/Core/ca.json b/Emby.Server.Implementations/Localization/Core/ca.json
index 7ca8e1553..7ca8e1553 100644
--- a/MediaBrowser.Server.Implementations/Localization/Core/ca.json
+++ b/Emby.Server.Implementations/Localization/Core/ca.json
diff --git a/MediaBrowser.Server.Implementations/Localization/Core/core.json b/Emby.Server.Implementations/Localization/Core/core.json
index 976faa8cb..976faa8cb 100644
--- a/MediaBrowser.Server.Implementations/Localization/Core/core.json
+++ b/Emby.Server.Implementations/Localization/Core/core.json
diff --git a/MediaBrowser.Server.Implementations/Localization/Core/cs.json b/Emby.Server.Implementations/Localization/Core/cs.json
index e3055f5ba..e3055f5ba 100644
--- a/MediaBrowser.Server.Implementations/Localization/Core/cs.json
+++ b/Emby.Server.Implementations/Localization/Core/cs.json
diff --git a/MediaBrowser.Server.Implementations/Localization/Core/da.json b/Emby.Server.Implementations/Localization/Core/da.json
index d2a628a80..d2a628a80 100644
--- a/MediaBrowser.Server.Implementations/Localization/Core/da.json
+++ b/Emby.Server.Implementations/Localization/Core/da.json
diff --git a/MediaBrowser.Server.Implementations/Localization/Core/de.json b/Emby.Server.Implementations/Localization/Core/de.json
index 30e3d9215..30e3d9215 100644
--- a/MediaBrowser.Server.Implementations/Localization/Core/de.json
+++ b/Emby.Server.Implementations/Localization/Core/de.json
diff --git a/MediaBrowser.Server.Implementations/Localization/Core/el.json b/Emby.Server.Implementations/Localization/Core/el.json
index 9e2d321cc..9e2d321cc 100644
--- a/MediaBrowser.Server.Implementations/Localization/Core/el.json
+++ b/Emby.Server.Implementations/Localization/Core/el.json
diff --git a/MediaBrowser.Server.Implementations/Localization/Core/en-GB.json b/Emby.Server.Implementations/Localization/Core/en-GB.json
index 493c6c4e9..493c6c4e9 100644
--- a/MediaBrowser.Server.Implementations/Localization/Core/en-GB.json
+++ b/Emby.Server.Implementations/Localization/Core/en-GB.json
diff --git a/MediaBrowser.Server.Implementations/Localization/Core/en-US.json b/Emby.Server.Implementations/Localization/Core/en-US.json
index bc0dc236d..bc0dc236d 100644
--- a/MediaBrowser.Server.Implementations/Localization/Core/en-US.json
+++ b/Emby.Server.Implementations/Localization/Core/en-US.json
diff --git a/MediaBrowser.Server.Implementations/Localization/Core/es-AR.json b/Emby.Server.Implementations/Localization/Core/es-AR.json
index 0555aa9d9..0555aa9d9 100644
--- a/MediaBrowser.Server.Implementations/Localization/Core/es-AR.json
+++ b/Emby.Server.Implementations/Localization/Core/es-AR.json
diff --git a/MediaBrowser.Server.Implementations/Localization/Core/es-MX.json b/Emby.Server.Implementations/Localization/Core/es-MX.json
index 630c7a037..630c7a037 100644
--- a/MediaBrowser.Server.Implementations/Localization/Core/es-MX.json
+++ b/Emby.Server.Implementations/Localization/Core/es-MX.json
diff --git a/MediaBrowser.Server.Implementations/Localization/Core/es.json b/Emby.Server.Implementations/Localization/Core/es.json
index d1a56240d..d1a56240d 100644
--- a/MediaBrowser.Server.Implementations/Localization/Core/es.json
+++ b/Emby.Server.Implementations/Localization/Core/es.json
diff --git a/MediaBrowser.Server.Implementations/Localization/Core/fi.json b/Emby.Server.Implementations/Localization/Core/fi.json
index 20efa1406..20efa1406 100644
--- a/MediaBrowser.Server.Implementations/Localization/Core/fi.json
+++ b/Emby.Server.Implementations/Localization/Core/fi.json
diff --git a/MediaBrowser.Server.Implementations/Localization/Core/fr-CA.json b/Emby.Server.Implementations/Localization/Core/fr-CA.json
index 789817c84..789817c84 100644
--- a/MediaBrowser.Server.Implementations/Localization/Core/fr-CA.json
+++ b/Emby.Server.Implementations/Localization/Core/fr-CA.json
diff --git a/MediaBrowser.Server.Implementations/Localization/Core/fr.json b/Emby.Server.Implementations/Localization/Core/fr.json
index 25c722989..25c722989 100644
--- a/MediaBrowser.Server.Implementations/Localization/Core/fr.json
+++ b/Emby.Server.Implementations/Localization/Core/fr.json
diff --git a/MediaBrowser.Server.Implementations/Localization/Core/gsw.json b/Emby.Server.Implementations/Localization/Core/gsw.json
index 88af82b7e..88af82b7e 100644
--- a/MediaBrowser.Server.Implementations/Localization/Core/gsw.json
+++ b/Emby.Server.Implementations/Localization/Core/gsw.json
diff --git a/MediaBrowser.Server.Implementations/Localization/Core/he.json b/Emby.Server.Implementations/Localization/Core/he.json
index 137b45544..137b45544 100644
--- a/MediaBrowser.Server.Implementations/Localization/Core/he.json
+++ b/Emby.Server.Implementations/Localization/Core/he.json
diff --git a/MediaBrowser.Server.Implementations/Localization/Core/hr.json b/Emby.Server.Implementations/Localization/Core/hr.json
index 7a94dc32b..7a94dc32b 100644
--- a/MediaBrowser.Server.Implementations/Localization/Core/hr.json
+++ b/Emby.Server.Implementations/Localization/Core/hr.json
diff --git a/MediaBrowser.Server.Implementations/Localization/Core/hu.json b/Emby.Server.Implementations/Localization/Core/hu.json
index 2b9d28d8c..2b9d28d8c 100644
--- a/MediaBrowser.Server.Implementations/Localization/Core/hu.json
+++ b/Emby.Server.Implementations/Localization/Core/hu.json
diff --git a/MediaBrowser.Server.Implementations/Localization/Core/id.json b/Emby.Server.Implementations/Localization/Core/id.json
index 8d64b63c4..8d64b63c4 100644
--- a/MediaBrowser.Server.Implementations/Localization/Core/id.json
+++ b/Emby.Server.Implementations/Localization/Core/id.json
diff --git a/MediaBrowser.Server.Implementations/Localization/Core/it.json b/Emby.Server.Implementations/Localization/Core/it.json
index d2d697c3e..d2d697c3e 100644
--- a/MediaBrowser.Server.Implementations/Localization/Core/it.json
+++ b/Emby.Server.Implementations/Localization/Core/it.json
diff --git a/MediaBrowser.Server.Implementations/Localization/Core/kk.json b/Emby.Server.Implementations/Localization/Core/kk.json
index 93252c30b..93252c30b 100644
--- a/MediaBrowser.Server.Implementations/Localization/Core/kk.json
+++ b/Emby.Server.Implementations/Localization/Core/kk.json
diff --git a/MediaBrowser.Server.Implementations/Localization/Core/ko.json b/Emby.Server.Implementations/Localization/Core/ko.json
index 834ccc17b..834ccc17b 100644
--- a/MediaBrowser.Server.Implementations/Localization/Core/ko.json
+++ b/Emby.Server.Implementations/Localization/Core/ko.json
diff --git a/MediaBrowser.Server.Implementations/Localization/Core/ms.json b/Emby.Server.Implementations/Localization/Core/ms.json
index fe5eef894..fe5eef894 100644
--- a/MediaBrowser.Server.Implementations/Localization/Core/ms.json
+++ b/Emby.Server.Implementations/Localization/Core/ms.json
diff --git a/MediaBrowser.Server.Implementations/Localization/Core/nb.json b/Emby.Server.Implementations/Localization/Core/nb.json
index 315d49b5f..315d49b5f 100644
--- a/MediaBrowser.Server.Implementations/Localization/Core/nb.json
+++ b/Emby.Server.Implementations/Localization/Core/nb.json
diff --git a/MediaBrowser.Server.Implementations/Localization/Core/nl.json b/Emby.Server.Implementations/Localization/Core/nl.json
index 2818fbf6a..2818fbf6a 100644
--- a/MediaBrowser.Server.Implementations/Localization/Core/nl.json
+++ b/Emby.Server.Implementations/Localization/Core/nl.json
diff --git a/MediaBrowser.Server.Implementations/Localization/Core/pl.json b/Emby.Server.Implementations/Localization/Core/pl.json
index cdaa87c4d..cdaa87c4d 100644
--- a/MediaBrowser.Server.Implementations/Localization/Core/pl.json
+++ b/Emby.Server.Implementations/Localization/Core/pl.json
diff --git a/MediaBrowser.Server.Implementations/Localization/Core/pt-BR.json b/Emby.Server.Implementations/Localization/Core/pt-BR.json
index 67f204b2e..67f204b2e 100644
--- a/MediaBrowser.Server.Implementations/Localization/Core/pt-BR.json
+++ b/Emby.Server.Implementations/Localization/Core/pt-BR.json
diff --git a/MediaBrowser.Server.Implementations/Localization/Core/pt-PT.json b/Emby.Server.Implementations/Localization/Core/pt-PT.json
index f12939b10..f12939b10 100644
--- a/MediaBrowser.Server.Implementations/Localization/Core/pt-PT.json
+++ b/Emby.Server.Implementations/Localization/Core/pt-PT.json
diff --git a/MediaBrowser.Server.Implementations/Localization/Core/ro.json b/Emby.Server.Implementations/Localization/Core/ro.json
index c58df27d5..c58df27d5 100644
--- a/MediaBrowser.Server.Implementations/Localization/Core/ro.json
+++ b/Emby.Server.Implementations/Localization/Core/ro.json
diff --git a/MediaBrowser.Server.Implementations/Localization/Core/ru.json b/Emby.Server.Implementations/Localization/Core/ru.json
index 62fe3b496..62fe3b496 100644
--- a/MediaBrowser.Server.Implementations/Localization/Core/ru.json
+++ b/Emby.Server.Implementations/Localization/Core/ru.json
diff --git a/MediaBrowser.Server.Implementations/Localization/Core/sl-SI.json b/Emby.Server.Implementations/Localization/Core/sl-SI.json
index 0631e3fa8..0631e3fa8 100644
--- a/MediaBrowser.Server.Implementations/Localization/Core/sl-SI.json
+++ b/Emby.Server.Implementations/Localization/Core/sl-SI.json
diff --git a/MediaBrowser.Server.Implementations/Localization/Core/sv.json b/Emby.Server.Implementations/Localization/Core/sv.json
index 4a6565aff..4a6565aff 100644
--- a/MediaBrowser.Server.Implementations/Localization/Core/sv.json
+++ b/Emby.Server.Implementations/Localization/Core/sv.json
diff --git a/MediaBrowser.Server.Implementations/Localization/Core/tr.json b/Emby.Server.Implementations/Localization/Core/tr.json
index a691e9d02..a691e9d02 100644
--- a/MediaBrowser.Server.Implementations/Localization/Core/tr.json
+++ b/Emby.Server.Implementations/Localization/Core/tr.json
diff --git a/MediaBrowser.Server.Implementations/Localization/Core/uk.json b/Emby.Server.Implementations/Localization/Core/uk.json
index 0dc6afe8a..0dc6afe8a 100644
--- a/MediaBrowser.Server.Implementations/Localization/Core/uk.json
+++ b/Emby.Server.Implementations/Localization/Core/uk.json
diff --git a/MediaBrowser.Server.Implementations/Localization/Core/vi.json b/Emby.Server.Implementations/Localization/Core/vi.json
index 6ea1d1d3f..6ea1d1d3f 100644
--- a/MediaBrowser.Server.Implementations/Localization/Core/vi.json
+++ b/Emby.Server.Implementations/Localization/Core/vi.json
diff --git a/MediaBrowser.Server.Implementations/Localization/Core/zh-CN.json b/Emby.Server.Implementations/Localization/Core/zh-CN.json
index 580832a9e..580832a9e 100644
--- a/MediaBrowser.Server.Implementations/Localization/Core/zh-CN.json
+++ b/Emby.Server.Implementations/Localization/Core/zh-CN.json
diff --git a/MediaBrowser.Server.Implementations/Localization/Core/zh-HK.json b/Emby.Server.Implementations/Localization/Core/zh-HK.json
index a70e7a003..a70e7a003 100644
--- a/MediaBrowser.Server.Implementations/Localization/Core/zh-HK.json
+++ b/Emby.Server.Implementations/Localization/Core/zh-HK.json
diff --git a/MediaBrowser.Server.Implementations/Localization/Core/zh-TW.json b/Emby.Server.Implementations/Localization/Core/zh-TW.json
index b711aab1f..b711aab1f 100644
--- a/MediaBrowser.Server.Implementations/Localization/Core/zh-TW.json
+++ b/Emby.Server.Implementations/Localization/Core/zh-TW.json
diff --git a/MediaBrowser.Server.Implementations/Localization/LocalizationManager.cs b/Emby.Server.Implementations/Localization/LocalizationManager.cs
index e4db98b3f..120f445c2 100644
--- a/MediaBrowser.Server.Implementations/Localization/LocalizationManager.cs
+++ b/Emby.Server.Implementations/Localization/LocalizationManager.cs
@@ -9,14 +9,11 @@ using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Linq;
-using System.Reflection;
-using System.Text;
-using MediaBrowser.Common.IO;
-using MediaBrowser.Controller.IO;
using MediaBrowser.Model.IO;
using MediaBrowser.Model.Logging;
+using MediaBrowser.Model.Reflection;
-namespace MediaBrowser.Server.Implementations.Localization
+namespace Emby.Server.Implementations.Localization
{
/// <summary>
/// Class LocalizationManager
@@ -39,6 +36,8 @@ namespace MediaBrowser.Server.Implementations.Localization
private readonly IFileSystem _fileSystem;
private readonly IJsonSerializer _jsonSerializer;
private readonly ILogger _logger;
+ private readonly IAssemblyInfo _assemblyInfo;
+ private readonly ITextLocalizer _textLocalizer;
/// <summary>
/// Initializes a new instance of the <see cref="LocalizationManager" /> class.
@@ -46,12 +45,14 @@ namespace MediaBrowser.Server.Implementations.Localization
/// <param name="configurationManager">The configuration manager.</param>
/// <param name="fileSystem">The file system.</param>
/// <param name="jsonSerializer">The json serializer.</param>
- public LocalizationManager(IServerConfigurationManager configurationManager, IFileSystem fileSystem, IJsonSerializer jsonSerializer, ILogger logger)
+ public LocalizationManager(IServerConfigurationManager configurationManager, IFileSystem fileSystem, IJsonSerializer jsonSerializer, ILogger logger, IAssemblyInfo assemblyInfo, ITextLocalizer textLocalizer)
{
_configurationManager = configurationManager;
_fileSystem = fileSystem;
_jsonSerializer = jsonSerializer;
_logger = logger;
+ _assemblyInfo = assemblyInfo;
+ _textLocalizer = textLocalizer;
ExtractAll();
}
@@ -65,20 +66,20 @@ namespace MediaBrowser.Server.Implementations.Localization
_fileSystem.CreateDirectory(localizationPath);
- var existingFiles = Directory.EnumerateFiles(localizationPath, "ratings-*.txt", SearchOption.TopDirectoryOnly)
+ var existingFiles = GetRatingsFiles(localizationPath)
.Select(Path.GetFileName)
.ToList();
// Extract from the assembly
- foreach (var resource in type.Assembly
- .GetManifestResourceNames()
+ foreach (var resource in _assemblyInfo
+ .GetManifestResourceNames(type)
.Where(i => i.StartsWith(resourcePath)))
{
var filename = "ratings-" + resource.Substring(resourcePath.Length);
if (!existingFiles.Contains(filename))
{
- using (var stream = type.Assembly.GetManifestResourceStream(resource))
+ using (var stream = _assemblyInfo.GetManifestResourceStream(type, resource))
{
var target = Path.Combine(localizationPath, filename);
_logger.Info("Extracting ratings to {0}", target);
@@ -90,13 +91,21 @@ namespace MediaBrowser.Server.Implementations.Localization
}
}
}
-
- foreach (var file in Directory.EnumerateFiles(localizationPath, "ratings-*.txt", SearchOption.TopDirectoryOnly))
+
+ foreach (var file in GetRatingsFiles(localizationPath))
{
LoadRatings(file);
}
}
+ private List<string> GetRatingsFiles(string directory)
+ {
+ return _fileSystem.GetFilePaths(directory, false)
+ .Where(i => string.Equals(Path.GetExtension(i), ".txt", StringComparison.OrdinalIgnoreCase))
+ .Where(i => Path.GetFileName(i).StartsWith("ratings-", StringComparison.OrdinalIgnoreCase))
+ .ToList();
+ }
+
/// <summary>
/// Gets the localization path.
/// </summary>
@@ -111,16 +120,12 @@ namespace MediaBrowser.Server.Implementations.Localization
public string RemoveDiacritics(string text)
{
- return String.Concat(
- text.Normalize(NormalizationForm.FormD)
- .Where(ch => CharUnicodeInfo.GetUnicodeCategory(ch) !=
- UnicodeCategory.NonSpacingMark)
- ).Normalize(NormalizationForm.FormC);
+ return _textLocalizer.RemoveDiacritics(text);
}
public string NormalizeFormKD(string text)
{
- return text.Normalize(NormalizationForm.FormKD);
+ return _textLocalizer.NormalizeFormKD(text);
}
/// <summary>
@@ -134,7 +139,7 @@ namespace MediaBrowser.Server.Implementations.Localization
var list = new List<CultureDto>();
- using (var stream = type.Assembly.GetManifestResourceStream(path))
+ using (var stream = _assemblyInfo.GetManifestResourceStream(type, path))
{
using (var reader = new StreamReader(stream))
{
@@ -176,7 +181,7 @@ namespace MediaBrowser.Server.Implementations.Localization
var type = GetType();
var path = type.Namespace + ".countries.json";
- using (var stream = type.Assembly.GetManifestResourceStream(path))
+ using (var stream = _assemblyInfo.GetManifestResourceStream(type, path))
{
return _jsonSerializer.DeserializeFromStream<List<CountryInfo>>(stream);
}
@@ -234,7 +239,7 @@ namespace MediaBrowser.Server.Implementations.Localization
/// <returns>Dictionary{System.StringParentalRating}.</returns>
private void LoadRatings(string file)
{
- var dict = File.ReadAllLines(file).Select(i =>
+ var dict = _fileSystem.ReadAllLines(file).Select(i =>
{
if (!string.IsNullOrWhiteSpace(i))
{
@@ -337,18 +342,17 @@ namespace MediaBrowser.Server.Implementations.Localization
{
var dictionary = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase);
- var assembly = GetType().Assembly;
var namespaceName = GetType().Namespace + "." + prefix;
- CopyInto(dictionary, namespaceName + "." + baseFilename, assembly);
- CopyInto(dictionary, namespaceName + "." + GetResourceFilename(culture), assembly);
+ CopyInto(dictionary, namespaceName + "." + baseFilename);
+ CopyInto(dictionary, namespaceName + "." + GetResourceFilename(culture));
return dictionary;
}
- private void CopyInto(IDictionary<string, string> dictionary, string resourcePath, Assembly assembly)
+ private void CopyInto(IDictionary<string, string> dictionary, string resourcePath)
{
- using (var stream = assembly.GetManifestResourceStream(resourcePath))
+ using (var stream = _assemblyInfo.GetManifestResourceStream(GetType(), resourcePath))
{
if (stream != null)
{
@@ -419,4 +423,11 @@ namespace MediaBrowser.Server.Implementations.Localization
}.OrderBy(i => i.Name);
}
}
+
+ public interface ITextLocalizer
+ {
+ string RemoveDiacritics(string text);
+
+ string NormalizeFormKD(string text);
+ }
}
diff --git a/MediaBrowser.Server.Implementations/Localization/Ratings/au.txt b/Emby.Server.Implementations/Localization/Ratings/au.txt
index fa60f5305..fa60f5305 100644
--- a/MediaBrowser.Server.Implementations/Localization/Ratings/au.txt
+++ b/Emby.Server.Implementations/Localization/Ratings/au.txt
diff --git a/MediaBrowser.Server.Implementations/Localization/Ratings/be.txt b/Emby.Server.Implementations/Localization/Ratings/be.txt
index 99a53f664..99a53f664 100644
--- a/MediaBrowser.Server.Implementations/Localization/Ratings/be.txt
+++ b/Emby.Server.Implementations/Localization/Ratings/be.txt
diff --git a/MediaBrowser.Server.Implementations/Localization/Ratings/br.txt b/Emby.Server.Implementations/Localization/Ratings/br.txt
index 62f00fb87..62f00fb87 100644
--- a/MediaBrowser.Server.Implementations/Localization/Ratings/br.txt
+++ b/Emby.Server.Implementations/Localization/Ratings/br.txt
diff --git a/MediaBrowser.Server.Implementations/Localization/Ratings/ca.txt b/Emby.Server.Implementations/Localization/Ratings/ca.txt
index 5a110648c..5a110648c 100644
--- a/MediaBrowser.Server.Implementations/Localization/Ratings/ca.txt
+++ b/Emby.Server.Implementations/Localization/Ratings/ca.txt
diff --git a/MediaBrowser.Server.Implementations/Localization/Ratings/co.txt b/Emby.Server.Implementations/Localization/Ratings/co.txt
index a694a0be6..a694a0be6 100644
--- a/MediaBrowser.Server.Implementations/Localization/Ratings/co.txt
+++ b/Emby.Server.Implementations/Localization/Ratings/co.txt
diff --git a/MediaBrowser.Server.Implementations/Localization/Ratings/de.txt b/Emby.Server.Implementations/Localization/Ratings/de.txt
index ad1f18619..ad1f18619 100644
--- a/MediaBrowser.Server.Implementations/Localization/Ratings/de.txt
+++ b/Emby.Server.Implementations/Localization/Ratings/de.txt
diff --git a/MediaBrowser.Server.Implementations/Localization/Ratings/dk.txt b/Emby.Server.Implementations/Localization/Ratings/dk.txt
index b9a085e01..b9a085e01 100644
--- a/MediaBrowser.Server.Implementations/Localization/Ratings/dk.txt
+++ b/Emby.Server.Implementations/Localization/Ratings/dk.txt
diff --git a/MediaBrowser.Server.Implementations/Localization/Ratings/fr.txt b/Emby.Server.Implementations/Localization/Ratings/fr.txt
index 2bb205b0d..2bb205b0d 100644
--- a/MediaBrowser.Server.Implementations/Localization/Ratings/fr.txt
+++ b/Emby.Server.Implementations/Localization/Ratings/fr.txt
diff --git a/MediaBrowser.Server.Implementations/Localization/Ratings/gb.txt b/Emby.Server.Implementations/Localization/Ratings/gb.txt
index c1f7d0452..c1f7d0452 100644
--- a/MediaBrowser.Server.Implementations/Localization/Ratings/gb.txt
+++ b/Emby.Server.Implementations/Localization/Ratings/gb.txt
diff --git a/MediaBrowser.Server.Implementations/Localization/Ratings/ie.txt b/Emby.Server.Implementations/Localization/Ratings/ie.txt
index 283f07767..283f07767 100644
--- a/MediaBrowser.Server.Implementations/Localization/Ratings/ie.txt
+++ b/Emby.Server.Implementations/Localization/Ratings/ie.txt
diff --git a/MediaBrowser.Server.Implementations/Localization/Ratings/jp.txt b/Emby.Server.Implementations/Localization/Ratings/jp.txt
index 2e1da30d8..2e1da30d8 100644
--- a/MediaBrowser.Server.Implementations/Localization/Ratings/jp.txt
+++ b/Emby.Server.Implementations/Localization/Ratings/jp.txt
diff --git a/MediaBrowser.Server.Implementations/Localization/Ratings/kz.txt b/Emby.Server.Implementations/Localization/Ratings/kz.txt
index b31e12d96..b31e12d96 100644
--- a/MediaBrowser.Server.Implementations/Localization/Ratings/kz.txt
+++ b/Emby.Server.Implementations/Localization/Ratings/kz.txt
diff --git a/MediaBrowser.Server.Implementations/Localization/Ratings/mx.txt b/Emby.Server.Implementations/Localization/Ratings/mx.txt
index 93b609c3d..93b609c3d 100644
--- a/MediaBrowser.Server.Implementations/Localization/Ratings/mx.txt
+++ b/Emby.Server.Implementations/Localization/Ratings/mx.txt
diff --git a/MediaBrowser.Server.Implementations/Localization/Ratings/nl.txt b/Emby.Server.Implementations/Localization/Ratings/nl.txt
index f69cc2bcc..f69cc2bcc 100644
--- a/MediaBrowser.Server.Implementations/Localization/Ratings/nl.txt
+++ b/Emby.Server.Implementations/Localization/Ratings/nl.txt
diff --git a/MediaBrowser.Server.Implementations/Localization/Ratings/nz.txt b/Emby.Server.Implementations/Localization/Ratings/nz.txt
index bc761dcab..bc761dcab 100644
--- a/MediaBrowser.Server.Implementations/Localization/Ratings/nz.txt
+++ b/Emby.Server.Implementations/Localization/Ratings/nz.txt
diff --git a/MediaBrowser.Server.Implementations/Localization/Ratings/ru.txt b/Emby.Server.Implementations/Localization/Ratings/ru.txt
index 1bc94affd..1bc94affd 100644
--- a/MediaBrowser.Server.Implementations/Localization/Ratings/ru.txt
+++ b/Emby.Server.Implementations/Localization/Ratings/ru.txt
diff --git a/MediaBrowser.Server.Implementations/Localization/Ratings/us.txt b/Emby.Server.Implementations/Localization/Ratings/us.txt
index 3f5311e0e..3f5311e0e 100644
--- a/MediaBrowser.Server.Implementations/Localization/Ratings/us.txt
+++ b/Emby.Server.Implementations/Localization/Ratings/us.txt
diff --git a/MediaBrowser.Server.Implementations/Localization/countries.json b/Emby.Server.Implementations/Localization/countries.json
index e671b3685..e671b3685 100644
--- a/MediaBrowser.Server.Implementations/Localization/countries.json
+++ b/Emby.Server.Implementations/Localization/countries.json
diff --git a/MediaBrowser.Server.Implementations/Localization/iso6392.txt b/Emby.Server.Implementations/Localization/iso6392.txt
index 665a5375e..665a5375e 100644
--- a/MediaBrowser.Server.Implementations/Localization/iso6392.txt
+++ b/Emby.Server.Implementations/Localization/iso6392.txt
diff --git a/MediaBrowser.Server.Implementations/HttpServer/HttpListenerHost.cs b/MediaBrowser.Server.Implementations/HttpServer/HttpListenerHost.cs
index f00c81766..805cb0353 100644
--- a/MediaBrowser.Server.Implementations/HttpServer/HttpListenerHost.cs
+++ b/MediaBrowser.Server.Implementations/HttpServer/HttpListenerHost.cs
@@ -18,6 +18,7 @@ using System.Reflection;
using System.Threading;
using System.Threading.Tasks;
using Emby.Server.Implementations.HttpServer;
+using Emby.Server.Implementations.HttpServer.SocketSharp;
using MediaBrowser.Common.Net;
using MediaBrowser.Common.Security;
using MediaBrowser.Controller;
diff --git a/MediaBrowser.Server.Implementations/HttpServer/SocketSharp/WebSocketSharpRequest.cs b/MediaBrowser.Server.Implementations/HttpServer/SocketSharp/WebSocketSharpRequest.cs
index 2546519f4..c56f62bec 100644
--- a/MediaBrowser.Server.Implementations/HttpServer/SocketSharp/WebSocketSharpRequest.cs
+++ b/MediaBrowser.Server.Implementations/HttpServer/SocketSharp/WebSocketSharpRequest.cs
@@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.Collections.Specialized;
using System.IO;
using System.Text;
+using Emby.Server.Implementations.HttpServer.SocketSharp;
using Funq;
using MediaBrowser.Common.IO;
using MediaBrowser.Model.IO;
diff --git a/MediaBrowser.Server.Implementations/MediaBrowser.Server.Implementations.csproj b/MediaBrowser.Server.Implementations/MediaBrowser.Server.Implementations.csproj
index 066ee8e30..10ebe4ea6 100644
--- a/MediaBrowser.Server.Implementations/MediaBrowser.Server.Implementations.csproj
+++ b/MediaBrowser.Server.Implementations/MediaBrowser.Server.Implementations.csproj
@@ -117,7 +117,6 @@
<Compile Include="Devices\CameraUploadsFolder.cs" />
<Compile Include="EntryPoints\ExternalPortForwarding.cs" />
<Compile Include="HttpServer\ContainerAdapter.cs" />
- <Compile Include="HttpServer\GetSwaggerResource.cs" />
<Compile Include="HttpServer\HttpListenerHost.cs" />
<Compile Include="HttpServer\HttpResultFactory.cs" />
<Compile Include="HttpServer\LoggerUtils.cs" />
@@ -126,9 +125,7 @@
<Compile Include="HttpServer\ServerFactory.cs" />
<Compile Include="HttpServer\ServerLogFactory.cs" />
<Compile Include="HttpServer\ServerLogger.cs" />
- <Compile Include="HttpServer\SocketSharp\HttpUtility.cs" />
<Compile Include="HttpServer\SocketSharp\SharpWebSocket.cs" />
- <Compile Include="HttpServer\SwaggerService.cs" />
<Compile Include="HttpServer\SocketSharp\Extensions.cs" />
<Compile Include="HttpServer\SocketSharp\RequestMono.cs" />
<Compile Include="HttpServer\SocketSharp\WebSocketSharpListener.cs" />
@@ -158,7 +155,6 @@
<Compile Include="LiveTv\TunerHosts\SatIp\SatIpHost.cs" />
<Compile Include="LiveTv\TunerHosts\SatIp\TransmissionMode.cs" />
<Compile Include="LiveTv\TunerHosts\SatIp\Utils.cs" />
- <Compile Include="Localization\LocalizationManager.cs" />
<Compile Include="Persistence\BaseSqliteRepository.cs" />
<Compile Include="Persistence\DataExtensions.cs" />
<Compile Include="Persistence\IDbConnector.cs" />
@@ -202,162 +198,7 @@
</ProjectReference>
</ItemGroup>
<ItemGroup>
- <Content Include="..\ThirdParty\ServiceStack\swagger-ui\lib\backbone-min.js">
- <Link>swagger-ui\lib\backbone-min.js</Link>
- <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- </Content>
- <Content Include="..\ThirdParty\ServiceStack\swagger-ui\lib\handlebars-2.0.0.js">
- <Link>swagger-ui\lib\handlebars-2.0.0.js</Link>
- <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- </Content>
- <Content Include="..\ThirdParty\ServiceStack\swagger-ui\lib\highlight.7.3.pack.js">
- <Link>swagger-ui\lib\highlight.7.3.pack.js</Link>
- <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- </Content>
- <Content Include="..\ThirdParty\ServiceStack\swagger-ui\lib\jquery-1.8.0.min.js">
- <Link>swagger-ui\lib\jquery-1.8.0.min.js</Link>
- <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- </Content>
- <Content Include="..\ThirdParty\ServiceStack\swagger-ui\lib\jquery.ba-bbq.min.js">
- <Link>swagger-ui\lib\jquery.ba-bbq.min.js</Link>
- <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- </Content>
- <Content Include="..\ThirdParty\ServiceStack\swagger-ui\lib\jquery.slideto.min.js">
- <Link>swagger-ui\lib\jquery.slideto.min.js</Link>
- <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- </Content>
- <Content Include="..\ThirdParty\ServiceStack\swagger-ui\lib\jquery.wiggle.min.js">
- <Link>swagger-ui\lib\jquery.wiggle.min.js</Link>
- <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- </Content>
- <Content Include="..\ThirdParty\ServiceStack\swagger-ui\lib\marked.js">
- <Link>swagger-ui\lib\marked.js</Link>
- <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- </Content>
- <Content Include="..\ThirdParty\ServiceStack\swagger-ui\lib\shred.bundle.js">
- <Link>swagger-ui\lib\shred.bundle.js</Link>
- <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- </Content>
- <Content Include="..\ThirdParty\ServiceStack\swagger-ui\lib\swagger-client.js">
- <Link>swagger-ui\lib\swagger-client.js</Link>
- <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- </Content>
- <Content Include="..\ThirdParty\ServiceStack\swagger-ui\lib\swagger-oauth.js">
- <Link>swagger-ui\lib\swagger-oauth.js</Link>
- <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- </Content>
- <Content Include="..\ThirdParty\ServiceStack\swagger-ui\lib\underscore-min.js">
- <Link>swagger-ui\lib\underscore-min.js</Link>
- <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- </Content>
- <Content Include="..\ThirdParty\ServiceStack\swagger-ui\o2c.html">
- <Link>swagger-ui\o2c.html</Link>
- <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- </Content>
- <Content Include="..\ThirdParty\ServiceStack\swagger-ui\patch.js">
- <Link>swagger-ui\patch.js</Link>
- <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- </Content>
- <Content Include="..\ThirdParty\ServiceStack\swagger-ui\swagger-ui.js">
- <Link>swagger-ui\swagger-ui.js</Link>
- <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- </Content>
- <Content Include="..\ThirdParty\ServiceStack\swagger-ui\swagger-ui.min.js">
- <Link>swagger-ui\swagger-ui.min.js</Link>
- <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- </Content>
- <Content Include="..\ThirdParty\ServiceStack\swagger-ui\fonts\droid-sans-v6-latin-700.eot">
- <Link>swagger-ui\fonts\droid-sans-v6-latin-700.eot</Link>
- <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- </Content>
- <Content Include="..\ThirdParty\ServiceStack\swagger-ui\fonts\droid-sans-v6-latin-700.ttf">
- <Link>swagger-ui\fonts\droid-sans-v6-latin-700.ttf</Link>
- <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- </Content>
- <Content Include="..\ThirdParty\ServiceStack\swagger-ui\fonts\droid-sans-v6-latin-700.woff">
- <Link>swagger-ui\fonts\droid-sans-v6-latin-700.woff</Link>
- <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- </Content>
- <Content Include="..\ThirdParty\ServiceStack\swagger-ui\fonts\droid-sans-v6-latin-700.woff2">
- <Link>swagger-ui\fonts\droid-sans-v6-latin-700.woff2</Link>
- <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- </Content>
- <Content Include="..\ThirdParty\ServiceStack\swagger-ui\fonts\droid-sans-v6-latin-regular.eot">
- <Link>swagger-ui\fonts\droid-sans-v6-latin-regular.eot</Link>
- <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- </Content>
- <Content Include="..\ThirdParty\ServiceStack\swagger-ui\fonts\droid-sans-v6-latin-regular.ttf">
- <Link>swagger-ui\fonts\droid-sans-v6-latin-regular.ttf</Link>
- <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- </Content>
- <Content Include="..\ThirdParty\ServiceStack\swagger-ui\fonts\droid-sans-v6-latin-regular.woff">
- <Link>swagger-ui\fonts\droid-sans-v6-latin-regular.woff</Link>
- <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- </Content>
- <Content Include="..\ThirdParty\ServiceStack\swagger-ui\fonts\droid-sans-v6-latin-regular.woff2">
- <Link>swagger-ui\fonts\droid-sans-v6-latin-regular.woff2</Link>
- <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- </Content>
- <EmbeddedResource Include="Localization\Ratings\us.txt" />
- <EmbeddedResource Include="Localization\Ratings\ru.txt" />
- <EmbeddedResource Include="Localization\Ratings\nz.txt" />
- <EmbeddedResource Include="Localization\Ratings\nl.txt" />
- <EmbeddedResource Include="Localization\Ratings\mx.txt" />
- <EmbeddedResource Include="Localization\Ratings\kz.txt" />
- <EmbeddedResource Include="Localization\Ratings\jp.txt" />
- <EmbeddedResource Include="Localization\Ratings\ie.txt" />
- <EmbeddedResource Include="Localization\Ratings\gb.txt" />
- <EmbeddedResource Include="Localization\Ratings\fr.txt" />
- <EmbeddedResource Include="Localization\Ratings\dk.txt" />
- <EmbeddedResource Include="Localization\Ratings\de.txt" />
- <EmbeddedResource Include="Localization\Ratings\co.txt" />
- <EmbeddedResource Include="Localization\Ratings\ca.txt" />
- <EmbeddedResource Include="Localization\Ratings\br.txt" />
- <EmbeddedResource Include="Localization\Ratings\be.txt" />
- <EmbeddedResource Include="Localization\Ratings\au.txt" />
- <EmbeddedResource Include="Localization\iso6392.txt" />
<None Include="app.config" />
- <EmbeddedResource Include="Localization\Core\ar.json" />
- <EmbeddedResource Include="Localization\Core\bg-BG.json" />
- <EmbeddedResource Include="Localization\Core\ca.json" />
- <EmbeddedResource Include="Localization\Core\core.json" />
- <EmbeddedResource Include="Localization\Core\cs.json" />
- <EmbeddedResource Include="Localization\Core\da.json" />
- <EmbeddedResource Include="Localization\Core\de.json" />
- <EmbeddedResource Include="Localization\Core\el.json" />
- <EmbeddedResource Include="Localization\Core\en-GB.json" />
- <EmbeddedResource Include="Localization\Core\en-US.json" />
- <EmbeddedResource Include="Localization\Core\es-AR.json" />
- <EmbeddedResource Include="Localization\Core\es-MX.json" />
- <EmbeddedResource Include="Localization\Core\es.json" />
- <EmbeddedResource Include="Localization\Core\fi.json" />
- <EmbeddedResource Include="Localization\Core\fr-CA.json" />
- <EmbeddedResource Include="Localization\Core\fr.json" />
- <EmbeddedResource Include="Localization\Core\gsw.json" />
- <EmbeddedResource Include="Localization\Core\he.json" />
- <EmbeddedResource Include="Localization\Core\hr.json" />
- <EmbeddedResource Include="Localization\Core\hu.json" />
- <EmbeddedResource Include="Localization\Core\id.json" />
- <EmbeddedResource Include="Localization\Core\it.json" />
- <EmbeddedResource Include="Localization\Core\kk.json" />
- <EmbeddedResource Include="Localization\Core\ko.json" />
- <EmbeddedResource Include="Localization\Core\ms.json" />
- <EmbeddedResource Include="Localization\Core\nb.json" />
- <EmbeddedResource Include="Localization\Core\nl.json" />
- <EmbeddedResource Include="Localization\Core\pl.json" />
- <EmbeddedResource Include="Localization\Core\pt-BR.json" />
- <EmbeddedResource Include="Localization\Core\pt-PT.json" />
- <EmbeddedResource Include="Localization\Core\ro.json" />
- <EmbeddedResource Include="Localization\Core\ru.json" />
- <EmbeddedResource Include="Localization\Core\sl-SI.json" />
- <EmbeddedResource Include="Localization\Core\sv.json" />
- <EmbeddedResource Include="Localization\Core\tr.json" />
- <EmbeddedResource Include="Localization\Core\uk.json" />
- <EmbeddedResource Include="Localization\Core\vi.json" />
- <EmbeddedResource Include="Localization\Core\zh-CN.json" />
- <EmbeddedResource Include="Localization\Core\zh-HK.json" />
- <EmbeddedResource Include="Localization\Core\zh-TW.json" />
- <EmbeddedResource Include="Localization\countries.json" />
<None Include="LiveTv\TunerHosts\SatIp\ini\satellite\0030.ini" />
<None Include="LiveTv\TunerHosts\SatIp\ini\satellite\0049.ini" />
<None Include="LiveTv\TunerHosts\SatIp\ini\satellite\0070.ini" />
@@ -529,56 +370,6 @@
<None Include="LiveTv\TunerHosts\SatIp\ini\satellite\3594.ini" />
<None Include="packages.config" />
</ItemGroup>
- <ItemGroup>
- <Content Include="..\ThirdParty\ServiceStack\swagger-ui\css\reset.css">
- <Link>swagger-ui\css\reset.css</Link>
- <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- </Content>
- <Content Include="..\ThirdParty\ServiceStack\swagger-ui\css\screen.css">
- <Link>swagger-ui\css\screen.css</Link>
- <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- </Content>
- <Content Include="..\ThirdParty\ServiceStack\swagger-ui\css\typography.css">
- <Link>swagger-ui\css\typography.css</Link>
- <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- </Content>
- <Content Include="..\ThirdParty\ServiceStack\swagger-ui\fonts\droid-sans-v6-latin-700.svg">
- <Link>swagger-ui\fonts\droid-sans-v6-latin-700.svg</Link>
- <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- </Content>
- <Content Include="..\ThirdParty\ServiceStack\swagger-ui\fonts\droid-sans-v6-latin-regular.svg">
- <Link>swagger-ui\fonts\droid-sans-v6-latin-regular.svg</Link>
- <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- </Content>
- <Content Include="..\ThirdParty\ServiceStack\swagger-ui\images\explorer_icons.png">
- <Link>swagger-ui\images\explorer_icons.png</Link>
- <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- </Content>
- <Content Include="..\ThirdParty\ServiceStack\swagger-ui\images\logo_small.png">
- <Link>swagger-ui\images\logo_small.png</Link>
- <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- </Content>
- <Content Include="..\ThirdParty\ServiceStack\swagger-ui\images\pet_store_api.png">
- <Link>swagger-ui\images\pet_store_api.png</Link>
- <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- </Content>
- <Content Include="..\ThirdParty\ServiceStack\swagger-ui\images\throbber.gif">
- <Link>swagger-ui\images\throbber.gif</Link>
- <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- </Content>
- <Content Include="..\ThirdParty\ServiceStack\swagger-ui\images\wordnik_api.png">
- <Link>swagger-ui\images\wordnik_api.png</Link>
- <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- </Content>
- <Content Include="..\ThirdParty\ServiceStack\swagger-ui\index.html">
- <Link>swagger-ui\index.html</Link>
- <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- </Content>
- <Content Include="..\ThirdParty\ServiceStack\swagger-ui\lib\shred\content.js">
- <Link>swagger-ui\lib\shred\content.js</Link>
- <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- </Content>
- </ItemGroup>
<ItemGroup />
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
diff --git a/MediaBrowser.Server.Startup.Common/ApplicationHost.cs b/MediaBrowser.Server.Startup.Common/ApplicationHost.cs
index ba04338bb..fd84940dd 100644
--- a/MediaBrowser.Server.Startup.Common/ApplicationHost.cs
+++ b/MediaBrowser.Server.Startup.Common/ApplicationHost.cs
@@ -54,7 +54,6 @@ using MediaBrowser.Server.Implementations.Configuration;
using MediaBrowser.Server.Implementations.Devices;
using MediaBrowser.Server.Implementations.HttpServer;
using MediaBrowser.Server.Implementations.IO;
-using MediaBrowser.Server.Implementations.Localization;
using MediaBrowser.Server.Implementations.Notifications;
using MediaBrowser.Server.Implementations.Persistence;
using MediaBrowser.Server.Implementations.Security;
@@ -107,6 +106,7 @@ using Emby.Server.Implementations.FileOrganization;
using Emby.Server.Implementations.HttpServer.Security;
using Emby.Server.Implementations.Library;
using Emby.Server.Implementations.LiveTv;
+using Emby.Server.Implementations.Localization;
using Emby.Server.Implementations.MediaEncoder;
using Emby.Server.Implementations.Notifications;
using Emby.Server.Implementations.Persistence;
@@ -548,7 +548,10 @@ namespace MediaBrowser.Server.Startup.Common
RegisterSingleInstance(ServerConfigurationManager);
- LocalizationManager = new LocalizationManager(ServerConfigurationManager, FileSystemManager, JsonSerializer, LogManager.GetLogger("LocalizationManager"));
+ IAssemblyInfo assemblyInfo = new AssemblyInfo();
+ RegisterSingleInstance<IAssemblyInfo>(assemblyInfo);
+
+ LocalizationManager = new LocalizationManager(ServerConfigurationManager, FileSystemManager, JsonSerializer, LogManager.GetLogger("LocalizationManager"), assemblyInfo, new TextLocalizer());
StringExtensions.LocalizationManager = LocalizationManager;
RegisterSingleInstance(LocalizationManager);
@@ -558,8 +561,6 @@ namespace MediaBrowser.Server.Startup.Common
RegisterSingleInstance<IBlurayExaminer>(() => new BdInfoExaminer(FileSystemManager, textEncoding));
RegisterSingleInstance<IXmlReaderSettingsFactory>(new XmlReaderSettingsFactory());
- IAssemblyInfo assemblyInfo = new AssemblyInfo();
- RegisterSingleInstance<IAssemblyInfo>(assemblyInfo);
UserDataManager = new UserDataManager(LogManager, ServerConfigurationManager);
RegisterSingleInstance(UserDataManager);
diff --git a/MediaBrowser.Server.Startup.Common/MediaBrowser.Server.Startup.Common.csproj b/MediaBrowser.Server.Startup.Common/MediaBrowser.Server.Startup.Common.csproj
index d30d892c9..aca30aa2c 100644
--- a/MediaBrowser.Server.Startup.Common/MediaBrowser.Server.Startup.Common.csproj
+++ b/MediaBrowser.Server.Startup.Common/MediaBrowser.Server.Startup.Common.csproj
@@ -89,6 +89,7 @@
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="StartupOptions.cs" />
<Compile Include="SystemEvents.cs" />
+ <Compile Include="TextLocalizer.cs" />
<Compile Include="Threading\PeriodicTimer.cs" />
<Compile Include="UnhandledExceptionWriter.cs" />
</ItemGroup>
diff --git a/MediaBrowser.Server.Startup.Common/TextLocalizer.cs b/MediaBrowser.Server.Startup.Common/TextLocalizer.cs
new file mode 100644
index 000000000..c578199a0
--- /dev/null
+++ b/MediaBrowser.Server.Startup.Common/TextLocalizer.cs
@@ -0,0 +1,25 @@
+using System;
+using System.Globalization;
+using System.Linq;
+using System.Text;
+using Emby.Server.Implementations.Localization;
+
+namespace MediaBrowser.Server.Startup.Common
+{
+ public class TextLocalizer : ITextLocalizer
+ {
+ public string RemoveDiacritics(string text)
+ {
+ return String.Concat(
+ text.Normalize(NormalizationForm.FormD)
+ .Where(ch => CharUnicodeInfo.GetUnicodeCategory(ch) !=
+ UnicodeCategory.NonSpacingMark)
+ ).Normalize(NormalizationForm.FormC);
+ }
+
+ public string NormalizeFormKD(string text)
+ {
+ return text.Normalize(NormalizationForm.FormKD);
+ }
+ }
+}