Skip to content

Commit 5c3ea4e

Browse files
author
Attila Szöllősi
committed
Update tvrenamr
1 parent fdea571 commit 5c3ea4e

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

resources/lib/tvrenamr/cli/helpers.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ def build_file_list(paths, recursive=False, ignore_filelist=()):
88
"""Finds files from a list of paths"""
99
for path in paths:
1010
if os.path.isfile(path):
11+
path = os.path.realpath(path)
1112
yield os.path.split(path)
1213

1314
if os.path.isdir(path):

resources/lib/tvrenamr/main.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -258,9 +258,10 @@ def rename(self, current_filepath, destination_filepath):
258258
os.symlink(source_filepath, destination_filepath)
259259
elif os.name == 'nt':
260260
import ctypes
261+
source_filepath = source_filepath.decode('UTF-8')
261262
kernel_dll = ctypes.windll.LoadLibrary("kernel32.dll")
262-
kernel_dll.CreateSymbolicLinkA(source_filepath,
263-
destination_filepath, 0)
263+
kernel_dll.CreateSymbolicLinkA(destination_filepath,
264+
source_filepath, 0)
264265
else:
265266
shutil.move(source_filepath, destination_filepath)
266267
destination_file = os.path.split(destination_filepath)[1]

0 commit comments

Comments
 (0)