浏览代码

update xmltv parsing

Luke Pulverenti 7 年之前
父节点
当前提交
0fbb5ab434
共有 1 个文件被更改,包括 9 次插入1 次删除
  1. 9 1
      Emby.Server.Implementations/LiveTv/Listings/XmlTvListingsProvider.cs

+ 9 - 1
Emby.Server.Implementations/LiveTv/Listings/XmlTvListingsProvider.cs

@@ -110,7 +110,15 @@ namespace Emby.Server.Implementations.LiveTv.Listings
                     var tempFolder = Path.Combine(_config.ApplicationPaths.TempDirectory, Guid.NewGuid().ToString());
                     _fileSystem.CreateDirectory(tempFolder);
 
-                    _zipClient.ExtractAllFromGz(stream, tempFolder, true);
+                    try
+                    {
+                        _zipClient.ExtractAllFromGz(stream, tempFolder, true);
+                    }
+                    catch
+                    {
+                        // If the extraction fails just return the original file, it could be a gz
+                        return file;
+                    }
 
                     return _fileSystem.GetFiles(tempFolder, true)
                         .Where(i => string.Equals(i.Extension, ".xml", StringComparison.OrdinalIgnoreCase))