Skip to content

Commit

Permalink
Update tvrenamr
Browse files Browse the repository at this point in the history
  • Loading branch information
Attila Szöllősi committed Mar 3, 2017
1 parent fdea571 commit 5c3ea4e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions resources/lib/tvrenamr/cli/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ def build_file_list(paths, recursive=False, ignore_filelist=()):
"""Finds files from a list of paths"""
for path in paths:
if os.path.isfile(path):
path = os.path.realpath(path)
yield os.path.split(path)

if os.path.isdir(path):
Expand Down
5 changes: 3 additions & 2 deletions resources/lib/tvrenamr/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -258,9 +258,10 @@ def rename(self, current_filepath, destination_filepath):
os.symlink(source_filepath, destination_filepath)
elif os.name == 'nt':
import ctypes
source_filepath = source_filepath.decode('UTF-8')
kernel_dll = ctypes.windll.LoadLibrary("kernel32.dll")
kernel_dll.CreateSymbolicLinkA(source_filepath,
destination_filepath, 0)
kernel_dll.CreateSymbolicLinkA(destination_filepath,
source_filepath, 0)
else:
shutil.move(source_filepath, destination_filepath)
destination_file = os.path.split(destination_filepath)[1]
Expand Down

0 comments on commit 5c3ea4e

Please sign in to comment.