diff --git a/commands/tinfoil.py b/commands/tinfoil.py index d898f82..4f6b53f 100755 --- a/commands/tinfoil.py +++ b/commands/tinfoil.py @@ -48,6 +48,13 @@ def remove(path, file): os.remove(os.path.join(path, file)) +def clean(path, database): + for file in os.listdir(path): + if os.path.isfile(os.path.join(path, file)) and file not in database: + # remove(path, file) + print(f"Hop {path}/{file}") + + req_titles = requests.get( "https://raw.githubusercontent.com/blawar/titledb/master/FR.fr.json" ) @@ -79,6 +86,11 @@ def get_title_shortid(name): return id[0:-4] if id in titles else None +clean("nsz/base", bases) +clean("nsz/dlc", dlcs) +clean("nsz/updates", updates) + + try: subprocess.run( ["rclone", "sync", "-P", "-v", f"{remote}:nsz/homebrew", "nsz/homebrew/"],