@@ -29,6 +29,7 @@ def __init__(
2929 ):
3030 self .logger = getLogger (__name__ )
3131 self .archive = Archive (archive_base_path )
32+ self .archive_base_path = archive_base_path
3233 self .django_api = django_api
3334
3435 async def ingest (self , video_id : str , original_file : Path , metadata : FfprobeOutput ):
@@ -53,7 +54,9 @@ async def ingest(self, video_id: str, original_file: Path, metadata: FfprobeOutp
5354 await self .django_api .set_video_duration (video_id , metadata .format .duration )
5455
5556 await self .django_api .create_video_file (
56- filename = archive_original , file_format = FormatEnum .ORIGINAL , video_id = video_id
57+ filename = archive_original .relative_to (self .archive_base_path ),
58+ file_format = FormatEnum .ORIGINAL ,
59+ video_id = video_id ,
5760 )
5861 except Exception as e :
5962 self .logger .error ("django-api error post original ingest: %s" , e )
@@ -93,4 +96,6 @@ async def _process_format(
9396 await Task (command ).execute ()
9497
9598 self .logger .info ("Creating video file entry for %s" , output_file )
96- await self .django_api .create_video_file (filename = str (output_file ), file_format = file_format , video_id = video_id )
99+ await self .django_api .create_video_file (
100+ filename = str (output_file .relative_to (self .archive_base_path )), file_format = file_format , video_id = video_id
101+ )
0 commit comments