diff --git a/Emby.Server.Implementations/Emby.Server.Implementations.csproj b/Emby.Server.Implementations/Emby.Server.Implementations.csproj
index a1bd67f1f..b4bb92cfa 100644
--- a/Emby.Server.Implementations/Emby.Server.Implementations.csproj
+++ b/Emby.Server.Implementations/Emby.Server.Implementations.csproj
@@ -309,8 +309,8 @@
{4f26d5d8-a7b0-42b3-ba42-7cb7d245934e}
SocketHttpListener.Portable
-
- ..\packages\Emby.XmlTv.1.0.6\lib\portable-net45+win8\Emby.XmlTv.dll
+
+ ..\packages\Emby.XmlTv.1.0.7\lib\portable-net45+win8\Emby.XmlTv.dll
True
diff --git a/Emby.Server.Implementations/LiveTv/Listings/XmlTvListingsProvider.cs b/Emby.Server.Implementations/LiveTv/Listings/XmlTvListingsProvider.cs
index d7803f9e3..a89acf647 100644
--- a/Emby.Server.Implementations/LiveTv/Listings/XmlTvListingsProvider.cs
+++ b/Emby.Server.Implementations/LiveTv/Listings/XmlTvListingsProvider.cs
@@ -5,6 +5,7 @@ using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
+using System.IO.Compression;
using System.Linq;
using System.Net;
using System.Text;
@@ -26,13 +27,15 @@ namespace Emby.Server.Implementations.LiveTv.Listings
private readonly IHttpClient _httpClient;
private readonly ILogger _logger;
private readonly IFileSystem _fileSystem;
+ private readonly IZipClient _zipClient;
- public XmlTvListingsProvider(IServerConfigurationManager config, IHttpClient httpClient, ILogger logger, IFileSystem fileSystem)
+ public XmlTvListingsProvider(IServerConfigurationManager config, IHttpClient httpClient, ILogger logger, IFileSystem fileSystem, IZipClient zipClient)
{
_config = config;
_httpClient = httpClient;
_logger = logger;
_fileSystem = fileSystem;
+ _zipClient = zipClient;
}
public string Name
@@ -63,7 +66,7 @@ namespace Emby.Server.Implementations.LiveTv.Listings
var cacheFile = Path.Combine(_config.ApplicationPaths.CachePath, "xmltv", cacheFilename);
if (_fileSystem.FileExists(cacheFile))
{
- return cacheFile;
+ return UnzipIfNeeded(path, cacheFile);
}
_logger.Info("Downloading xmltv listings from {0}", path);
@@ -103,7 +106,30 @@ namespace Emby.Server.Implementations.LiveTv.Listings
}
_logger.Debug("Returning xmltv path {0}", cacheFile);
- return cacheFile;
+ return UnzipIfNeeded(path, cacheFile);
+ }
+
+ private string UnzipIfNeeded(string originalUrl, string file)
+ {
+ //var ext = Path.GetExtension(originalUrl);
+
+ //if (string.Equals(ext, ".gz", StringComparison.OrdinalIgnoreCase))
+ //{
+ // using (var stream = _fileSystem.OpenRead(file))
+ // {
+ // var tempFolder = Path.Combine(_config.ApplicationPaths.TempDirectory, Guid.NewGuid().ToString());
+ // _fileSystem.CreateDirectory(tempFolder);
+
+ // _zipClient.ExtractAllFromZip(stream, tempFolder, true);
+
+ // return _fileSystem.GetFiles(tempFolder, true)
+ // .Where(i => string.Equals(i.Extension, ".xml", StringComparison.OrdinalIgnoreCase))
+ // .Select(i => i.FullName)
+ // .FirstOrDefault();
+ // }
+ //}
+
+ return file;
}
public async Task> GetProgramsAsync(ListingsProviderInfo info, string channelId, DateTime startDateUtc, DateTime endDateUtc, CancellationToken cancellationToken)
@@ -122,6 +148,8 @@ namespace Emby.Server.Implementations.LiveTv.Listings
}
}
+ _logger.Debug("Getting xmltv programs for channel {0}", channelId);
+
var path = await GetXml(info.Path, cancellationToken).ConfigureAwait(false);
var reader = new XmlTvReader(path, GetLanguage());
diff --git a/Emby.Server.Implementations/packages.config b/Emby.Server.Implementations/packages.config
index 3c82e979b..88627957b 100644
--- a/Emby.Server.Implementations/packages.config
+++ b/Emby.Server.Implementations/packages.config
@@ -1,6 +1,6 @@
-
+
diff --git a/MediaBrowser.Controller/LiveTv/LiveTvProgram.cs b/MediaBrowser.Controller/LiveTv/LiveTvProgram.cs
index 5a139e09d..5919d87fd 100644
--- a/MediaBrowser.Controller/LiveTv/LiveTvProgram.cs
+++ b/MediaBrowser.Controller/LiveTv/LiveTvProgram.cs
@@ -48,6 +48,19 @@ namespace MediaBrowser.Controller.LiveTv
return list;
}
+ public override double? GetDefaultPrimaryImageAspectRatio()
+ {
+ if (IsMovie)
+ {
+ double value = 2;
+ value /= 3;
+
+ return value;
+ }
+
+ return null;
+ }
+
[IgnoreDataMember]
public override SourceType SourceType
{