* Renamed -t/--tmpdir configuration option to -o/--outdir.
authorUrban Wallasch <urban.wallasch@freenet.de>
Wed, 12 May 2021 18:15:31 +0000 (20:15 +0200)
committerUrban Wallasch <urban.wallasch@freenet.de>
Wed, 12 May 2021 18:15:31 +0000 (20:15 +0200)
README.md
ffpreview.conf.sample
ffpreview.py

index 183dcb8e89ce468b0b2565c16cddfabe0ce334c1..ae84cd7248cd0d4dd8af57bf30c2e6812af9b0cc 100644 (file)
--- a/README.md
+++ b/README.md
@@ -49,7 +49,7 @@ optional arguments:
   -c F, --config F    read configuration from file F
   -g G, --grid G      set grid geometry in COLS[xROWS] format
   -w N, --width N     thumbnail image width in pixel
-  -t P, --tmpdir P    set thumbnail parent directory to P
+  -o P, --outdir P    set thumbnail parent directory to P
   -f, --force         force thumbnail and index rebuild
   -r, --reuse         reuse filter settings from index file
   -i, --iframe        select only I-frames (default)
index fead3e06a0999c1326118d91fccb0d091be7d0c2..7699837586257dfdc18e2bb9e4329573a5a7f2f1 100644 (file)
@@ -4,7 +4,7 @@
 
 # Output directory path.
 # A separate subdirectory is created for each video file.
-tmpdir=
+outdir=
 
 # Target width in pixels for thumbnails.
 thumb_width=128
index f79d62b106c2502e8f60ec81e4876d5b2c3832d3..6b813cd1273ce250f5ff84c2c7ea6ca16c4ca7c5 100755 (executable)
@@ -97,7 +97,7 @@ def configure():
         'home': expanduser("~"),
         'conffile': 'ffpreview.conf',
         'vid': '',
-        'tmpdir': '',
+        'outdir': '',
         'thdir': '',
         'idxfile': '',
         'grid': '5x5',
@@ -148,7 +148,7 @@ def configure():
     parser.add_argument('-c', '--config', metavar='F', help='read configuration from file F')
     parser.add_argument('-g', '--grid', metavar='G', help='set grid geometry in COLS[xROWS] format')
     parser.add_argument('-w', '--width', type=int, metavar='N', help='thumbnail image width in pixel')
-    parser.add_argument('-t', '--tmpdir', metavar='P', help='set thumbnail parent directory to P')
+    parser.add_argument('-o', '--outdir', metavar='P', help='set thumbnail parent directory to P')
     parser.add_argument('-f', '--force', action='count', help='force thumbnail and index rebuild')
     parser.add_argument('-r', '--reuse', action='count', help='reuse filter settings from index file')
     parser.add_argument('-i', '--iframe', action='count', help='select only I-frames (default)')
@@ -200,8 +200,8 @@ def configure():
 
     # evaluate remaining command line args
     cfg['vid'] = args.filename
-    if args.tmpdir:
-        cfg['tmpdir'] = args.tmpdir
+    if args.outdir:
+        cfg['outdir'] = args.outdir
     if args.start:
         cfg['start'] = hms2s(args.start)
     if args.end:
@@ -261,10 +261,10 @@ def configure():
         cfg['grid_rows'] = int(grid[1])
 
     # prepare temp directory
-    if not cfg['tmpdir']:
-        cfg['tmpdir'] = tempfile.gettempdir()
+    if not cfg['outdir']:
+        cfg['outdir'] = tempfile.gettempdir()
     try:
-        os.makedirs(cfg['tmpdir'], exist_ok=True)
+        os.makedirs(cfg['outdir'], exist_ok=True)
     except Exception as e:
         eprint(0, str(e))
         exit(1)
@@ -577,7 +577,7 @@ class sMainWindow(QMainWindow):
         self.setWindowTitle('ffpreview - '+cfg['vid'])
 
         # prepare thumbnail directory
-        cfg['thdir'] = cfg['tmpdir'] + '/ffpreview_thumbs/' + os.path.basename(cfg['vid'])
+        cfg['thdir'] = cfg['outdir'] + '/ffpreview_thumbs/' + os.path.basename(cfg['vid'])
         try:
             os.makedirs(cfg['thdir'], exist_ok=True)
         except Exception as e: