Closed Overlord360 closed 1 year ago
I like the idea!
However, can we rename --sub-dir
to --recurse
"Recurse" seems like the proper term for what we're trying to do and it's a standard programing word.
We can, but it doesn't really recurse as it only searches one directory level deep as that's the intended file structure e.g. "./One Piece [tvdb4-81797]/Arc 01 - Romance Dawn/file.mkv"
I've changed the argument, It's a fairly easy change to make it truly recursive if we want to search through nested sub-directories as well
Yeah, I think we should travers the directories
import os
...
for root, dirs, files in os.walk(directory):
for file in files:
if file.endswith(".mkv"):
print(os.path.join(root, file))
The script will now recursively search all sub directories and any nested directories
It looks good, but I want to test it first. I don't have access to my computer currently, I'll let you know when it's tested and I'll approve.
Add -sd or --sub-dir argument to allow the script to search through the one pace folder structure (e.g. "Arc 01 - Romance Dawn/file.mkv")
Changed some variables to be file paths instead of file names to facilitate the change
Updated README with instructions on how to use it.