]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
webui: file bundle - don't compress .gz files twice, fixes #2845
authorJaroslav Kysela <perex@perex.cz>
Thu, 14 May 2015 19:19:10 +0000 (21:19 +0200)
committerJaroslav Kysela <perex@perex.cz>
Thu, 14 May 2015 19:19:10 +0000 (21:19 +0200)
support/mkbundle

index 83eaf412a3d9cfc635bb77f5b4908e3a720c8139..00057095ce821e602d3a426d8ac340dbda4bd431 100755 (executable)
@@ -76,7 +76,12 @@ def output_file ( path, name, idx, next = -1 ):
   outf.write('static const uint8_t filebundle_data_%06d[] = {' % idx)
   o = -1
   d = open(p, 'rb').read()
-  if opts.gzip:
+  if p.endswith('.gz'):
+    t = BytesIO(d)
+    z = gzip.GzipFile(filename=name, mode='r', fileobj=t)
+    nd = z.read()
+    o = len(nd)
+  elif opts.gzip:
     o = len(d)
     l = opts.gzlevel
     t = BytesIO()