From 64d85e4c3337adf6ca3fe66dac66a2b241d94c18 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Mon, 25 Sep 2017 15:13:34 -0400 Subject: remove unused data --- Emby.Server.Implementations/EntryPoints/UsageEntryPoint.cs | 4 ++-- Emby.Server.Implementations/EntryPoints/UsageReporter.cs | 10 +--------- 2 files changed, 3 insertions(+), 11 deletions(-) (limited to 'Emby.Server.Implementations') diff --git a/Emby.Server.Implementations/EntryPoints/UsageEntryPoint.cs b/Emby.Server.Implementations/EntryPoints/UsageEntryPoint.cs index fb94029861..11e806b0cf 100644 --- a/Emby.Server.Implementations/EntryPoints/UsageEntryPoint.cs +++ b/Emby.Server.Implementations/EntryPoints/UsageEntryPoint.cs @@ -74,7 +74,7 @@ namespace Emby.Server.Implementations.EntryPoints try { - await new UsageReporter(_applicationHost, _httpClient, _userManager, _logger) + await new UsageReporter(_applicationHost, _httpClient, _logger) .ReportAppUsage(client, CancellationToken.None) .ConfigureAwait(false); } @@ -117,7 +117,7 @@ namespace Emby.Server.Implementations.EntryPoints try { - await new UsageReporter(_applicationHost, _httpClient, _userManager, _logger) + await new UsageReporter(_applicationHost, _httpClient, _logger) .ReportServerUsage(CancellationToken.None) .ConfigureAwait(false); } diff --git a/Emby.Server.Implementations/EntryPoints/UsageReporter.cs b/Emby.Server.Implementations/EntryPoints/UsageReporter.cs index 778c8a6ced..deee8d64bd 100644 --- a/Emby.Server.Implementations/EntryPoints/UsageReporter.cs +++ b/Emby.Server.Implementations/EntryPoints/UsageReporter.cs @@ -17,15 +17,13 @@ namespace Emby.Server.Implementations.EntryPoints { private readonly IServerApplicationHost _applicationHost; private readonly IHttpClient _httpClient; - private readonly IUserManager _userManager; private readonly ILogger _logger; private const string MbAdminUrl = "https://www.mb3admin.com/admin/"; - public UsageReporter(IServerApplicationHost applicationHost, IHttpClient httpClient, IUserManager userManager, ILogger logger) + public UsageReporter(IServerApplicationHost applicationHost, IHttpClient httpClient, ILogger logger) { _applicationHost = applicationHost; _httpClient = httpClient; - _userManager = userManager; _logger = logger; } @@ -43,12 +41,6 @@ namespace Emby.Server.Implementations.EntryPoints { "platform", _applicationHost.OperatingSystemDisplayName } }; - var users = _userManager.Users.ToList(); - - data["localusers"] = users.Count(i => !i.ConnectLinkType.HasValue).ToString(CultureInfo.InvariantCulture); - data["guests"] = users.Count(i => i.ConnectLinkType.HasValue && i.ConnectLinkType.Value == UserLinkType.Guest).ToString(CultureInfo.InvariantCulture); - data["linkedusers"] = users.Count(i => i.ConnectLinkType.HasValue && i.ConnectLinkType.Value == UserLinkType.LinkedUser).ToString(CultureInfo.InvariantCulture); - data["plugins"] = string.Join(",", _applicationHost.Plugins.Select(i => i.Id).ToArray()); var logErrors = false; -- cgit v1.2.3 From ab8c0bf1e6a3b29f9ff0c6037bd29301e69f1ac7 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Mon, 25 Sep 2017 15:13:54 -0400 Subject: improve support for compressed xmltv --- .../LiveTv/Listings/XmlTvListingsProvider.cs | 24 +++------------------- 1 file changed, 3 insertions(+), 21 deletions(-) (limited to 'Emby.Server.Implementations') diff --git a/Emby.Server.Implementations/LiveTv/Listings/XmlTvListingsProvider.cs b/Emby.Server.Implementations/LiveTv/Listings/XmlTvListingsProvider.cs index 55500df6e5..8ea98879a6 100644 --- a/Emby.Server.Implementations/LiveTv/Listings/XmlTvListingsProvider.cs +++ b/Emby.Server.Implementations/LiveTv/Listings/XmlTvListingsProvider.cs @@ -72,8 +72,7 @@ namespace Emby.Server.Implementations.LiveTv.Listings var cacheFile = Path.Combine(_config.ApplicationPaths.CachePath, "xmltv", cacheFilename); if (_fileSystem.FileExists(cacheFile)) { - //return UnzipIfNeeded(path, cacheFile); - return cacheFile; + return UnzipIfNeeded(path, cacheFile); } _logger.Info("Downloading xmltv listings from {0}", path); @@ -95,26 +94,9 @@ namespace Emby.Server.Implementations.LiveTv.Listings _fileSystem.CreateDirectory(_fileSystem.GetDirectoryName(cacheFile)); - using (var stream = _fileSystem.OpenRead(tempFile)) - { - using (var reader = new StreamReader(stream, Encoding.UTF8)) - { - using (var fileStream = _fileSystem.GetFileStream(cacheFile, FileOpenMode.Create, FileAccessMode.Write, FileShareMode.Read)) - { - using (var writer = new StreamWriter(fileStream)) - { - while (!reader.EndOfStream) - { - writer.WriteLine(reader.ReadLine()); - } - } - } - } - } + _fileSystem.CopyFile(tempFile, cacheFile, true); - _logger.Debug("Returning xmltv path {0}", cacheFile); - return cacheFile; - //return UnzipIfNeeded(path, cacheFile); + return UnzipIfNeeded(path, cacheFile); } private string UnzipIfNeeded(string originalUrl, string file) -- cgit v1.2.3