Skip to content

Commit

Permalink
Check files in folder recursively ONLY when using the CLI
Browse files Browse the repository at this point in the history
  • Loading branch information
emericg committed Mar 20, 2020
1 parent 90bf057 commit 62c3782
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions OpenSubtitlesDownload.py
Original file line number Diff line number Diff line change
Expand Up @@ -570,10 +570,17 @@ def dependencyChecker():
for i in result.filePathListArg:
filePath = os.path.abspath(i)
if os.path.isdir(filePath):
# If it is a folder, check all of its files recursively
for root, _, items in os.walk(filePath):
for item in items:
localPath = os.path.join(root, item)
if opt_gui == 'cli':
# If it is a folder, check all of its files recursively
for root, _, items in os.walk(filePath):
for item in items:
localPath = os.path.join(root, item)
if checkFileValidity(localPath):
videoPathList.append(localPath)
else:
# If it is a folder, check all of its files
for item in os.listdir(filePath):
localPath = os.path.join(filePath, item)
if checkFileValidity(localPath):
videoPathList.append(localPath)
elif checkFileValidity(filePath):
Expand Down

0 comments on commit 62c3782

Please sign in to comment.