Skip to content

Commit baf7842

Browse files
committed
Merge branch 'main' of https://github.com/video-db/videodb-python into ankit/add-text-asset
2 parents 29e8c4f + e0b3eee commit baf7842

File tree

3 files changed

+8
-7
lines changed

3 files changed

+8
-7
lines changed

videodb/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424

2525
logger: logging.Logger = logging.getLogger("videodb")
2626

27-
__version__ = "0.0.5a1"
27+
__version__ = "0.0.5"
2828
__author__ = "videodb"
2929

3030
__all__ = [

videodb/collection.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
from typing import (
44
Optional,
55
Union,
6+
List,
67
)
78
from videodb._upload import (
89
upload,
@@ -26,7 +27,7 @@ def __init__(self, _connection, id: str, name: str = None, description: str = No
2627
self.name = name
2728
self.description = description
2829

29-
def get_videos(self) -> list[Video]:
30+
def get_videos(self) -> List[Video]:
3031
videos_data = self._connection.get(path=f"{ApiPath.video}")
3132
return [Video(self._connection, **video) for video in videos_data.get("videos")]
3233

@@ -44,7 +45,7 @@ def delete_video(self, video_id: str) -> None:
4445
"""
4546
return self._connection.delete(path=f"{ApiPath.video}/{video_id}")
4647

47-
def get_audios(self) -> list[Audio]:
48+
def get_audios(self) -> List[Audio]:
4849
audios_data = self._connection.get(path=f"{ApiPath.audio}")
4950
return [Audio(self._connection, **audio) for audio in audios_data.get("audios")]
5051

@@ -55,7 +56,7 @@ def get_audio(self, audio_id: str) -> Audio:
5556
def delete_audio(self, audio_id: str) -> None:
5657
return self._connection.delete(path=f"{ApiPath.audio}/{audio_id}")
5758

58-
def get_images(self) -> list[Image]:
59+
def get_images(self) -> List[Image]:
5960
images_data = self._connection.get(path=f"{ApiPath.image}")
6061
return [Image(self._connection, **image) for image in images_data.get("images")]
6162

videodb/video.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from typing import Optional
1+
from typing import Optional, List, Dict, Tuple
22
from videodb._utils._video import play_stream
33
from videodb._constants import (
44
ApiPath,
@@ -67,7 +67,7 @@ def delete(self) -> None:
6767
"""
6868
self._connection.delete(path=f"{ApiPath.video}/{self.id}")
6969

70-
def generate_stream(self, timeline: Optional[list[tuple[int, int]]] = None) -> str:
70+
def generate_stream(self, timeline: Optional[List[Tuple[int, int]]] = None) -> str:
7171
"""Generate the stream url of the video
7272
7373
:param list timeline: The timeline of the video to be streamed. Defaults to None.
@@ -107,7 +107,7 @@ def _fetch_transcript(self, force: bool = False) -> None:
107107
self.transcript = transcript_data.get("word_timestamps", [])
108108
self.transcript_text = transcript_data.get("text", "")
109109

110-
def get_transcript(self, force: bool = False) -> list[dict]:
110+
def get_transcript(self, force: bool = False) -> List[Dict]:
111111
self._fetch_transcript(force)
112112
return self.transcript
113113

0 commit comments

Comments
 (0)