File 0005-Copy-logic-fix-for-legacy-mode.patch of Package flac2all

From 7be32ce21210dcded715f97b308b1eeadefefa06 Mon Sep 17 00:00:00 2001
From: zv <info@ziva-vatra.com>
Date: Fri, 28 Feb 2020 17:09:48 +0000
Subject: [PATCH 5/5] Copy logic fix for legacy mode

---
 flac2all_pkg/multiprocess_encode.py | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/flac2all_pkg/multiprocess_encode.py b/flac2all_pkg/multiprocess_encode.py
index fa02051..bd012c2 100755
--- a/flac2all_pkg/multiprocess_encode.py
+++ b/flac2all_pkg/multiprocess_encode.py
@@ -42,12 +42,12 @@ if __name__ == '__main__' and __package__ is None:
 try:
     from config import opts
     from core import encode_thread, generate_summary, print_summary, write_logfile
-    from shell import shell
+    from shell import shell, filecopy
     from logging import console
 except ImportError:
     from .config import opts
     from .core import encode_thread, generate_summary
-    from .shell import shell
+    from .shell import shell, filecopy
     from .logging import console
 
 
@@ -87,6 +87,8 @@ def encode():
                 pQ.put([infile, opts['dirpath'], opts['outdir'], mode])
                 count += 1
             else:
+                # If we want to copy, then any non-flac file gets added
+                # with the target mode, so we know what to copy
                 if opts['copy']:
                     cQ.put([infile, opts['dirpath'], opts['outdir'], mode])
 
@@ -134,7 +136,10 @@ def encode():
             command = cQ.get(timeout=10)
             srcfile, srcroot, dest, encformat = command
             outdir = sh.generateoutdir(srcfile, os.path.join(dest, encformat), srcroot)
+            filename = srcfile.rsplit('/', 1)[-1]
+            outdir = os.path.join(outdir, filename)
             log.info(("%s => %s" % (srcfile, outdir)))
+            results = filecopy({"copymode": "_legacy_"}).convert(srcfile, outdir)
         except mp.TimeoutError as e:
             sflags[1] = 1
         except queue.Empty as e:
-- 
2.25.1

openSUSE Build Service is sponsored by