Просмотр исходного кода

Only complain about non-TVDB entries in verbose mode

Zach Isbach 2 лет назад
Родитель
Сommit
704e67ea6c
1 измененных файлов с 4 добавлено и 3 удалено
  1. 4 3
      TVDB/main.py

+ 4 - 3
TVDB/main.py

@@ -23,7 +23,7 @@ def readConfigLine(file, opt=False):
           value = line.strip()
           break
   except Exception as error:
-    if not opt:
+    if not opt or cli.verbose:
       print('Unable to read config: {e}'.format(e=error))
   return value
 
@@ -86,7 +86,7 @@ for file in dirfiles:
 # Fetch the TVDB episode list
 try:
   apikey = readConfigLine(cli.api)
-  id = readConfigLine('.tvdb')
+  id = readConfigLine('.tvdb', opt=True)
 
   if cli.lang is not None:
     lang = cli.lang
@@ -103,7 +103,8 @@ try:
     order = default_order
 
   if apikey is None or id is None:
-    print('Invalid TVDB parameters')
+    if cli.verbose:
+      print('Invalid TVDB parameters')
     exit(1)
   if cli.verbose:
     print('Series: {id}'.format(id=id))