Fixed issues with copy link function when target link is actually a file and src is just a folder.

This commit is contained in:
echel0n 2014-04-28 17:52:24 -07:00
commit 409a88359e

View file

@ -146,7 +146,10 @@ def copy_link(src, targetLink, useLink):
if src != targetLink and os.path.exists(targetLink):
logger.info("MEDIAFILE already exists in the TARGET folder, skipping ...", 'COPYLINK')
return True
elif src == targetLink:
elif src == targetLink and os.path.isfile(targetLink) and os.path.isfile(src):
logger.info("SOURCE AND TARGET files are the same, skipping ...", 'COPYLINK')
return True
elif src == os.path.dirname(targetLink):
logger.info("SOURCE AND TARGET folders are the same, skipping ...", 'COPYLINK')
return True