11import os
22import shutil
33
4- # Configurazione percorsi
4+ # Percorsi
55project_dir = os .path .abspath (os .path .join (os .path .dirname (__file__ ), ".." , ".." ))
66desktop_dir = os .path .join (os .path .expanduser ("~" ), "Desktop" )
77
8- # File da gestire (in ordine di priorità)
8+ # File da gestire
99TARGET_FILES = {
1010 'keep' : [
11- "Final.srt" , # Prima priorità
12- "whisper_adjusted.srt" , # Seconda priorità
11+ "Final.srt" ,
12+ "whisper_adjusted.srt" ,
1313
1414 ],
1515 'cleanup' : [
1616 "whisper.srt" ,
1717 "whisper.aac" ,
1818 "vocali.wav" ,
19- "temp.wav" ,
2019 "scene_timestamps.srt" ,
2120 "scene_timestamps_adjusted.srt"
2221 ]
2322}
2423
2524def find_existing_files (file_list , search_dir ):
26- """Cerca i file esistenti senza output"""
2725 return [f for f in file_list if os .path .exists (os .path .join (search_dir , f ))]
2826
2927def move_to_desktop (files , source_dir , dest_dir ):
30- """Sposta i file sul Desktop senza output"""
3128 for filename in files :
3229 try :
3330 shutil .move (os .path .join (source_dir , filename ),
@@ -36,15 +33,14 @@ def move_to_desktop(files, source_dir, dest_dir):
3633 pass
3734
3835def cleanup_files (files , target_dir ):
39- """Elimina i file residui senza output"""
4036 for filename in files :
4137 try :
4238 os .remove (os .path .join (target_dir , filename ))
4339 except Exception :
4440 pass
4541
4642def main ():
47- # Cerca automaticamente il primo file MKV
43+ # Cerca MKV
4844 mkv_files = [f for f in os .listdir (project_dir ) if f .endswith ('.mkv' )]
4945 if not mkv_files :
5046 raise FileNotFoundError ("Nessun file .mkv trovato nella directory." )
0 commit comments