|
22 | 22 | APPROVAL, |
23 | 23 | CELERY_PIPELINE, |
24 | 24 | DELETED, |
25 | | - DELETED_VIDEOS_STORAGE_BASE_DIRECTORY, |
| 25 | + DELETED_STORAGE_BASE_DIRECTORY, |
26 | 26 | ENDED, |
27 | 27 | ERROR, |
28 | 28 | HARVESTED, |
|
37 | 37 | STOPPING, |
38 | 38 | TRANSCODE_PIPELINE_CHOICES, |
39 | 39 | UPLOAD_ERROR_REASON_CHOICES, |
40 | | - VIDEOS_STORAGE_BASE_DIRECTORY, |
41 | | - VOD_VIDEOS_STORAGE_BASE_DIRECTORY, |
| 40 | + STORAGE_BASE_DIRECTORY, |
| 41 | + VOD_STORAGE_BASE_DIRECTORY, |
42 | 42 | ) |
43 | 43 | from marsha.core.models.account import ADMINISTRATOR, INSTRUCTOR, OrganizationAccess |
44 | 44 | from marsha.core.models.base import BaseModel |
@@ -314,34 +314,34 @@ def get_source_s3_key(self, stamp=None): |
314 | 314 | stamp = stamp or self.uploaded_on_stamp() |
315 | 315 | return f"{self.pk}/video/{self.pk}/{stamp}" |
316 | 316 |
|
317 | | - def get_videos_storage_prefix( |
| 317 | + def get_storage_prefix( |
318 | 318 | self, |
319 | 319 | stamp=None, |
320 | | - base_dir: VIDEOS_STORAGE_BASE_DIRECTORY = VOD_VIDEOS_STORAGE_BASE_DIRECTORY, |
| 320 | + base_dir: STORAGE_BASE_DIRECTORY = VOD_STORAGE_BASE_DIRECTORY, |
321 | 321 | ): |
322 | | - """Compute the videos storage prefix for the video. |
| 322 | + """Compute the storage prefix for the video. |
323 | 323 |
|
324 | 324 | Parameters |
325 | 325 | ---------- |
326 | 326 | stamp: Type[string] |
327 | | - Passing a value for this argument will return the videos storage prefix for the video |
| 327 | + Passing a value for this argument will return the storage prefix for the video |
328 | 328 | assuming its active stamp is set to this value. This is useful to create an upload |
329 | 329 | policy for this prospective version of the video, so that the client can upload the |
330 | 330 | file to S3 and the transcodings job can set the `uploaded_on` field to this value. |
331 | 331 |
|
332 | | - base: Type[VIDEOS_STORAGE_BASE_DIRECTORY] |
333 | | - The videos storage base directory. Defaults to VOD. It will be used to compute the |
334 | | - videos storage prefix. |
| 332 | + base: Type[STORAGE_BASE_DIRECTORY] |
| 333 | + The storage base directory. Defaults to VOD. It will be used to compute the |
| 334 | + storage prefix. |
335 | 335 |
|
336 | 336 | Returns |
337 | 337 | ------- |
338 | 338 | string |
339 | | - The videos storage prefix for the video, depending on the base directory passed. |
| 339 | + The storage prefix for the video, depending on the base directory passed. |
340 | 340 | """ |
341 | 341 | stamp = stamp or self.uploaded_on_stamp() |
342 | 342 | base = base_dir |
343 | | - if base == DELETED_VIDEOS_STORAGE_BASE_DIRECTORY: |
344 | | - base = f"{base}/{VOD_VIDEOS_STORAGE_BASE_DIRECTORY}" |
| 343 | + if base == DELETED_STORAGE_BASE_DIRECTORY: |
| 344 | + base = f"{base}/{VOD_STORAGE_BASE_DIRECTORY}" |
345 | 345 |
|
346 | 346 | return f"{base}/{self.pk}/video/{stamp}" |
347 | 347 |
|
@@ -666,34 +666,34 @@ def get_source_s3_key(self, stamp=None): |
666 | 666 | mode = f"_{self.mode}" if self.mode else "" |
667 | 667 | return f"{self.video.pk}/timedtexttrack/{self.pk}/{stamp}_{self.language}{mode}" |
668 | 668 |
|
669 | | - def get_videos_storage_prefix( |
| 669 | + def get_storage_prefix( |
670 | 670 | self, |
671 | 671 | stamp=None, |
672 | | - base_dir: VIDEOS_STORAGE_BASE_DIRECTORY = VOD_VIDEOS_STORAGE_BASE_DIRECTORY, |
| 672 | + base_dir: STORAGE_BASE_DIRECTORY = VOD_STORAGE_BASE_DIRECTORY, |
673 | 673 | ): |
674 | | - """Compute the videos storage prefix for the video. |
| 674 | + """Compute the storage prefix for the video. |
675 | 675 |
|
676 | 676 | Parameters |
677 | 677 | ---------- |
678 | 678 | stamp: Type[string] |
679 | | - Passing a value for this argument will return the videos storage prefix for the video |
| 679 | + Passing a value for this argument will return the storage prefix for the video |
680 | 680 | assuming its active stamp is set to this value. This is useful to create an upload |
681 | 681 | policy for this prospective version of the video, so that the client can upload the |
682 | 682 | file to S3 and the transcodings job can set the `uploaded_on` field to this value. |
683 | 683 |
|
684 | | - base_dir: Type[VIDEOS_STORAGE_BASE_DIRECTORY] |
685 | | - The videos storage base directory. Defaults to VOD. It will be used to compute the |
686 | | - videos storage prefix. |
| 684 | + base_dir: Type[STORAGE_BASE_DIRECTORY] |
| 685 | + The storage base directory. Defaults to VOD. It will be used to compute the |
| 686 | + storage prefix. |
687 | 687 |
|
688 | 688 | Returns |
689 | 689 | ------- |
690 | 690 | string |
691 | | - The videos storage prefix for the video, depending on the base directory passed. |
| 691 | + The storage prefix for the video, depending on the base directory passed. |
692 | 692 | """ |
693 | 693 | stamp = stamp or self.uploaded_on_stamp() |
694 | 694 | base = base_dir |
695 | | - if base_dir == DELETED_VIDEOS_STORAGE_BASE_DIRECTORY: |
696 | | - base = f"{DELETED_VIDEOS_STORAGE_BASE_DIRECTORY}/{VOD_VIDEOS_STORAGE_BASE_DIRECTORY}" |
| 695 | + if base_dir == DELETED_STORAGE_BASE_DIRECTORY: |
| 696 | + base = f"{DELETED_STORAGE_BASE_DIRECTORY}/{VOD_STORAGE_BASE_DIRECTORY}" |
697 | 697 |
|
698 | 698 | return f"{base}/{self.video.pk}/timedtext/{self.pk}/{stamp}" |
699 | 699 |
|
@@ -817,35 +817,35 @@ def get_source_s3_key(self, stamp=None): |
817 | 817 | stamp = stamp or self.uploaded_on_stamp() |
818 | 818 | return f"{self.video.pk}/thumbnail/{self.pk}/{stamp}" |
819 | 819 |
|
820 | | - def get_videos_storage_prefix( |
| 820 | + def get_storage_prefix( |
821 | 821 | self, |
822 | 822 | stamp=None, |
823 | | - base_dir: VIDEOS_STORAGE_BASE_DIRECTORY = VOD_VIDEOS_STORAGE_BASE_DIRECTORY, |
| 823 | + base_dir: STORAGE_BASE_DIRECTORY = VOD_STORAGE_BASE_DIRECTORY, |
824 | 824 | ): |
825 | | - """Compute the videos storage prefix for the thumbnail. |
| 825 | + """Compute the storage prefix for the thumbnail. |
826 | 826 |
|
827 | 827 | Parameters |
828 | 828 | ---------- |
829 | 829 | stamp: Type[string] |
830 | | - Passing a value for this argument will return the videos storage prefix for the shared |
| 830 | + Passing a value for this argument will return the storage prefix for the shared |
831 | 831 | live media assuming its active stamp is set to this value. This is useful to create |
832 | 832 | an upload policy for this prospective version of the thumbnail, so that the |
833 | 833 | client can upload the file and celery task can set the `uploaded_on` field to this |
834 | 834 | value. |
835 | 835 |
|
836 | | - base_dir: Type[VIDEOS_STORAGE_BASE_DIRECTORY] |
837 | | - The videos storage base directory. Defaults to VOD. It will be used to compute the |
838 | | - videos storage prefix. |
| 836 | + base_dir: Type[STORAGE_BASE_DIRECTORY] |
| 837 | + The storage base directory. Defaults to VOD. It will be used to compute the |
| 838 | + storage prefix. |
839 | 839 |
|
840 | 840 | Returns |
841 | 841 | ------- |
842 | 842 | string |
843 | | - The videos storage prefix for the thumbnail. |
| 843 | + The storage prefix for the thumbnail. |
844 | 844 | """ |
845 | 845 | stamp = stamp or self.uploaded_on_stamp() |
846 | 846 | base = base_dir |
847 | | - if base_dir == DELETED_VIDEOS_STORAGE_BASE_DIRECTORY: |
848 | | - base = f"{DELETED_VIDEOS_STORAGE_BASE_DIRECTORY}/{VOD_VIDEOS_STORAGE_BASE_DIRECTORY}" |
| 847 | + if base_dir == DELETED_STORAGE_BASE_DIRECTORY: |
| 848 | + base = f"{DELETED_STORAGE_BASE_DIRECTORY}/{VOD_STORAGE_BASE_DIRECTORY}" |
849 | 849 |
|
850 | 850 | return f"{base}/{self.video.pk}/thumbnail/{stamp}" |
851 | 851 |
|
@@ -1299,35 +1299,35 @@ def get_source_s3_key(self, stamp=None, extension=None): |
1299 | 1299 | stamp = stamp or self.uploaded_on_stamp() |
1300 | 1300 | return f"{self.video.pk}/sharedlivemedia/{self.pk}/{stamp}{extension}" |
1301 | 1301 |
|
1302 | | - def get_videos_storage_prefix( |
| 1302 | + def get_storage_prefix( |
1303 | 1303 | self, |
1304 | 1304 | stamp=None, |
1305 | | - base_dir: VIDEOS_STORAGE_BASE_DIRECTORY = VOD_VIDEOS_STORAGE_BASE_DIRECTORY, |
| 1305 | + base_dir: STORAGE_BASE_DIRECTORY = VOD_STORAGE_BASE_DIRECTORY, |
1306 | 1306 | ): |
1307 | | - """Compute the videos storage prefix for the shared live media. |
| 1307 | + """Compute the storage prefix for the shared live media. |
1308 | 1308 |
|
1309 | 1309 | Parameters |
1310 | 1310 | ---------- |
1311 | 1311 | stamp: Type[string] |
1312 | | - Passing a value for this argument will return the videos storage prefix for the shared |
| 1312 | + Passing a value for this argument will return the storage prefix for the shared |
1313 | 1313 | live media assuming its active stamp is set to this value. This is useful to create |
1314 | 1314 | an upload policy for this prospective version of the shared live media, so that the |
1315 | 1315 | client can upload the file and celery task can set the `uploaded_on` field to this |
1316 | 1316 | value. |
1317 | 1317 |
|
1318 | | - base_dir: Type[VIDEOS_STORAGE_BASE_DIRECTORY] |
1319 | | - The videos storage base directory. Defaults to VOD. It will be used to compute the |
1320 | | - videos storage prefix. |
| 1318 | + base_dir: Type[STORAGE_BASE_DIRECTORY] |
| 1319 | + The storage base directory. Defaults to VOD. It will be used to compute the |
| 1320 | + storage prefix. |
1321 | 1321 |
|
1322 | 1322 | Returns |
1323 | 1323 | ------- |
1324 | 1324 | string |
1325 | | - The videos storage prefix for the shared live media. |
| 1325 | + The storage prefix for the shared live media. |
1326 | 1326 | """ |
1327 | 1327 | stamp = stamp or self.uploaded_on_stamp() |
1328 | 1328 | base = base_dir |
1329 | | - if base_dir == DELETED_VIDEOS_STORAGE_BASE_DIRECTORY: |
1330 | | - base = f"{DELETED_VIDEOS_STORAGE_BASE_DIRECTORY}/{VOD_VIDEOS_STORAGE_BASE_DIRECTORY}" |
| 1329 | + if base_dir == DELETED_STORAGE_BASE_DIRECTORY: |
| 1330 | + base = f"{DELETED_STORAGE_BASE_DIRECTORY}/{VOD_STORAGE_BASE_DIRECTORY}" |
1331 | 1331 |
|
1332 | 1332 | return f"{base}/{self.video.pk}/sharedlivemedia/{self.pk}/{stamp}" |
1333 | 1333 |
|
|
0 commit comments