fix remote_path handling on different os types.

This commit is contained in:
clinton-hall 2014-05-26 16:49:19 +09:30
commit 7ece7997a9
4 changed files with 38 additions and 7 deletions

View file

@ -145,6 +145,14 @@ class autoProcessMovie:
process_all_exceptions(inputName.lower(), dirName)
inputName, dirName = convert_to_ascii(inputName, dirName)
if remote_path:
if remote_path[-1] in ['\\','/']: # supplied directory includes final directory separator
remote_path = remote_path + os.path.basename(dirName)
elif remote_path[0] == '/': # posix path
remote_path = remote_path + '/' + os.path.basename(dirName)
else: # assume windows path or UNF path
remote_path = remote_path + '\\' + os.path.basename(dirName)
if status == 0:
if nzbtomedia.TRANSCODE == 1:
result = transcoder.Transcode_directory(dirName)
@ -165,7 +173,7 @@ class autoProcessMovie:
params['media_folder'] = dirName
if remote_path:
params['media_folder'] = os.path.join(remote_path, os.path.basename(dirName))
params['media_folder'] = remote_path
url = "%s%s" % (baseURL, command)