From 5ea97d3f898028c0d65bed42538a1d43c0b31409 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Simon=20K=C3=BCnzel?= <simonk@fsmpi.rwth-aachen.de>
Date: Sat, 17 May 2025 20:19:04 +0200
Subject: [PATCH] Adjust default file name pattern

---
 common_py/src/videoag_common/media_process/media_process.py | 4 ++--
 common_py/src/videoag_common/objects/medium.py              | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/common_py/src/videoag_common/media_process/media_process.py b/common_py/src/videoag_common/media_process/media_process.py
index debcf5d..db1af35 100644
--- a/common_py/src/videoag_common/media_process/media_process.py
+++ b/common_py/src/videoag_common/media_process/media_process.py
@@ -26,8 +26,8 @@ def get_permanent_lecture_dir(lecture: "Lecture") -> str:
     """
     return (
         f"{_PERMANENT_MEDIA_DIR_NAME}/"
-        f"course-{lecture.course.id}.{lecture.course.handle}/"
-        f"lecture-{lecture.id}.{lecture.time.strftime("%y%m%d")}"
+        f"{lecture.course.handle}.course-{lecture.course.id}/"
+        f"{lecture.time.strftime("%y%m%d")}.lecture-{lecture.id}"
     )
 
 
diff --git a/common_py/src/videoag_common/objects/medium.py b/common_py/src/videoag_common/objects/medium.py
index ffc6a64..3de3f29 100644
--- a/common_py/src/videoag_common/objects/medium.py
+++ b/common_py/src/videoag_common/objects/medium.py
@@ -233,7 +233,7 @@ class MediumFile(DeletableApiObject, Base):
     
     def get_default_file_path_no_ending(self):
         assert self.id is not None and self.process_target_id is not None
-        return f"{get_permanent_lecture_dir(self.lecture)}/target-{self.id}.{self.process_target_id}"
+        return f"{get_permanent_lecture_dir(self.lecture)}/{self.process_target_id}.target-{self.id}"
     
     @hybrid_method
     def has_access(self, context: dict[AccessContextKey, Any]):
-- 
GitLab