mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-11-07 20:30:41 -05:00
[movefiles] Don't give "cant find" warning when move is unnecessary
This commit is contained in:
parent
2d6921210d
commit
9882064024
1 changed files with 3 additions and 3 deletions
|
@ -28,14 +28,14 @@ def run(self, info):
|
||||||
self.files_to_move[info['filepath']] = finalpath
|
self.files_to_move[info['filepath']] = finalpath
|
||||||
|
|
||||||
for oldfile, newfile in self.files_to_move.items():
|
for oldfile, newfile in self.files_to_move.items():
|
||||||
if not os.path.exists(encodeFilename(oldfile)):
|
|
||||||
self.report_warning('File "%s" cannot be found' % oldfile)
|
|
||||||
continue
|
|
||||||
if not newfile:
|
if not newfile:
|
||||||
newfile = os.path.join(finaldir, os.path.basename(encodeFilename(oldfile)))
|
newfile = os.path.join(finaldir, os.path.basename(encodeFilename(oldfile)))
|
||||||
oldfile, newfile = compat_str(oldfile), compat_str(newfile)
|
oldfile, newfile = compat_str(oldfile), compat_str(newfile)
|
||||||
if os.path.abspath(encodeFilename(oldfile)) == os.path.abspath(encodeFilename(newfile)):
|
if os.path.abspath(encodeFilename(oldfile)) == os.path.abspath(encodeFilename(newfile)):
|
||||||
continue
|
continue
|
||||||
|
if not os.path.exists(encodeFilename(oldfile)):
|
||||||
|
self.report_warning('File "%s" cannot be found' % oldfile)
|
||||||
|
continue
|
||||||
if os.path.exists(encodeFilename(newfile)):
|
if os.path.exists(encodeFilename(newfile)):
|
||||||
if self.get_param('overwrites', True):
|
if self.get_param('overwrites', True):
|
||||||
self.report_warning('Replacing existing file "%s"' % newfile)
|
self.report_warning('Replacing existing file "%s"' % newfile)
|
||||||
|
|
Loading…
Reference in a new issue