mirror of
https://git.lecygnenoir.info/LecygneNoir/prismedia.git
synced 2025-10-03 17:39:16 +02:00
decode stdin strins arguments
This commit is contained in:
parent
7e4f9d995c
commit
dffd3ffa84
2 changed files with 12 additions and 11 deletions
14
lib/utils.py
14
lib/utils.py
|
@ -123,7 +123,6 @@ def searchThumbnail(options):
|
|||
options['--thumbnail'] = video_directory + video_file + ".jpeg"
|
||||
return options
|
||||
|
||||
|
||||
# return the nfo as a RawConfigParser object
|
||||
def loadNFO(options):
|
||||
video_directory = dirname(options.get('--file')) + "/"
|
||||
|
@ -168,7 +167,6 @@ def loadNFO(options):
|
|||
logging.info("No suitable NFO found, skipping.")
|
||||
return False
|
||||
|
||||
|
||||
def parseNFO(options):
|
||||
nfo = loadNFO(options)
|
||||
if nfo:
|
||||
|
@ -189,11 +187,9 @@ def parseNFO(options):
|
|||
exit(1)
|
||||
return options
|
||||
|
||||
|
||||
def upcaseFirstLetter(s):
|
||||
return s[0].upper() + s[1:]
|
||||
|
||||
|
||||
def cleanString(toclean):
|
||||
toclean = toclean.split(' ')
|
||||
cleaned = ''
|
||||
|
@ -208,3 +204,13 @@ def cleanString(toclean):
|
|||
cleaned = cleaned + strtoclean
|
||||
|
||||
return cleaned
|
||||
|
||||
def decodeArgumentStrings(options, encoding):
|
||||
if options["--name"] is not None:
|
||||
options["--name"] = options["--name"].decode(encoding)
|
||||
|
||||
if options["--description"] is not None:
|
||||
options["--description"] = options["--description"].decode(encoding)
|
||||
|
||||
if options["--tags"] is not None:
|
||||
options["--tags"] = options["--tags"].decode(encoding)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue