refactor(main.py): move grade directory creation to the point of use

This commit is contained in:
2025-08-18 17:21:04 +02:00
parent 5fc6456db9
commit 8ba99a2053

View File

@@ -76,11 +76,6 @@ class MediaGrader:
self.window_width = 800
self.window_height = 600
# Create grade directories
for i in range(1, 6):
grade_dir = self.directory / str(i)
grade_dir.mkdir(exist_ok=True)
def find_media_files(self) -> List[Path]:
"""Find all media files recursively in the directory"""
media_files = []
@@ -353,6 +348,10 @@ class MediaGrader:
current_file = self.media_files[self.current_index]
grade_dir = self.directory / str(grade)
# Create grade directory if it doesn't exist
grade_dir.mkdir(exist_ok=True)
destination = grade_dir / current_file.name
counter = 1