@@ -37,12 +37,15 @@ def __repr__(self) -> str:
3737
3838 def get_videos (self ) -> List [Video ]:
3939 videos_data = self ._connection .get (
40- path = f"{ ApiPath .collection } /{ self .id } /{ ApiPath .video } "
40+ path = f"{ ApiPath .video } " ,
41+ params = {"collection_id" : self .id },
4142 )
4243 return [Video (self ._connection , ** video ) for video in videos_data .get ("videos" )]
4344
4445 def get_video (self , video_id : str ) -> Video :
45- video_data = self ._connection .get (path = f"{ ApiPath .video } /{ video_id } " )
46+ video_data = self ._connection .get (
47+ path = f"{ ApiPath .video } /{ video_id } " , params = {"collection_id" : self .id }
48+ )
4649 return Video (self ._connection , ** video_data )
4750
4851 def delete_video (self , video_id : str ) -> None :
@@ -53,33 +56,45 @@ def delete_video(self, video_id: str) -> None:
5356 :return: None if the delete is successful
5457 :rtype: None
5558 """
56- return self ._connection .delete (path = f"{ ApiPath .video } /{ video_id } " )
59+ return self ._connection .delete (
60+ path = f"{ ApiPath .video } /{ video_id } " , params = {"collection_id" : self .id }
61+ )
5762
5863 def get_audios (self ) -> List [Audio ]:
5964 audios_data = self ._connection .get (
60- path = f"{ ApiPath .collection } /{ self .id } /{ ApiPath .audio } "
65+ path = f"{ ApiPath .audio } " ,
66+ params = {"collection_id" : self .id },
6167 )
6268 return [Audio (self ._connection , ** audio ) for audio in audios_data .get ("audios" )]
6369
6470 def get_audio (self , audio_id : str ) -> Audio :
65- audio_data = self ._connection .get (path = f"{ ApiPath .audio } /{ audio_id } " )
71+ audio_data = self ._connection .get (
72+ path = f"{ ApiPath .audio } /{ audio_id } " , params = {"collection_id" : self .id }
73+ )
6674 return Audio (self ._connection , ** audio_data )
6775
6876 def delete_audio (self , audio_id : str ) -> None :
69- return self ._connection .delete (path = f"{ ApiPath .audio } /{ audio_id } " )
77+ return self ._connection .delete (
78+ path = f"{ ApiPath .audio } /{ audio_id } " , params = {"collection_id" : self .id }
79+ )
7080
7181 def get_images (self ) -> List [Image ]:
7282 images_data = self ._connection .get (
73- path = f"{ ApiPath .collection } /{ self .id } /{ ApiPath .image } "
83+ path = f"{ ApiPath .image } " ,
84+ params = {"collection_id" : self .id },
7485 )
7586 return [Image (self ._connection , ** image ) for image in images_data .get ("images" )]
7687
7788 def get_image (self , image_id : str ) -> Image :
78- image_data = self ._connection .get (path = f"{ ApiPath .image } /{ image_id } " )
89+ image_data = self ._connection .get (
90+ path = f"{ ApiPath .image } /{ image_id } " , params = {"collection_id" : self .id }
91+ )
7992 return Image (self ._connection , ** image_data )
8093
8194 def delete_image (self , image_id : str ) -> None :
82- return self ._connection .delete (path = f"{ ApiPath .image } /{ image_id } " )
95+ return self ._connection .delete (
96+ path = f"{ ApiPath .image } /{ image_id } " , params = {"collection_id" : self .id }
97+ )
8398
8499 def search (
85100 self ,
0 commit comments