8000 fix: get v/a/img path · video-db/videodb-python@8a6edbd · GitHub
[go: up one dir, main page]

Skip to content

Commit 8a6edbd

Browse files
committed
fix: get v/a/img path
1 parent 4b54cd6 commit 8a6edbd

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

videodb/collection.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,9 @@ def __repr__(self) -> str:
3636
)
3737

3838
def get_videos(self) -> List[Video]:
39-
videos_data = self._connection.get(path=f"{ApiPath.video}")
39+
videos_data = self._connection.get(
40+
path=f"{ApiPath.collection}/{self.id}/{ApiPath.video}"
41+
)
4042
return [Video(self._connection, **video) for video in videos_data.get("videos")]
4143

4244
def get_video(self, video_id: str) -> Video:
@@ -54,7 +56,9 @@ def delete_video(self, video_id: str) -> None:
5456
return self._connection.delete(path=f"{ApiPath.video}/{video_id}")
5557

5658
def get_audios(self) -> List[Audio]:
57-
audios_data = self._connection.get(path=f"{ApiPath.audio}")
59+
audios_data = self._connection.get(
60+
path=f"{ApiPath.collection}/{self.id}/{ApiPath.audio}"
61+
)
5862
return [Audio(self._connection, **audio) for audio in audios_data.get("audios")]
5963

6064
def get_audio(self, audio_id: str) -> Audio:
@@ -65,7 +69,9 @@ def delete_audio(self, audio_id: str) -> None:
6569
return self._connection.delete(path=f"{ApiPath.audio}/{audio_id}")
6670

6771
def get_images(self) -> List[Image]:
68-
images_data = self._connection.get(path=f"{ApiPath.image}")
72+
images_data = self._connection.get(
73+
path=f"{ApiPath.collection}/{self.id}/{ApiPath.image}"
74+
)
6975
return [Image(self._connection, **image) for image in images_data.get("images")]
7076

7177
def get_image(self, image_id: str) -> Image:

0 commit comments

Comments
 (0)
0