Skip to content

Commit

Permalink
fix: transcript params
Browse files Browse the repository at this point in the history
  • Loading branch information
ankit-v2-3 committed Aug 5, 2024
1 parent f88f4d5 commit c32c144
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 11 deletions.
2 changes: 1 addition & 1 deletion videodb/__about__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
""" About information for videodb sdk"""


__version__ = "0.2.3"
__version__ = "0.2.4"
__title__ = "videodb"
__author__ = "videodb"
__email__ = "[email protected]"
Expand Down
2 changes: 2 additions & 0 deletions videodb/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
SceneExtractionType,
MediaType,
SearchType,
Segmenter,
SubtitleAlignment,
SubtitleBorderStyle,
SubtitleStyle,
Expand Down Expand Up @@ -41,6 +42,7 @@
"SubtitleStyle",
"TextStyle",
"SceneExtractionType",
"Segmenter",
]


Expand Down
6 changes: 6 additions & 0 deletions videodb/_constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,12 @@ class SemanticSearchDefaultValues:
score_threshold = 0.2


class Segmenter:
time = "time"
word = "word"
sentence = "sentence"


class ApiPath:
collection = "collection"
upload = "upload"
Expand Down
21 changes: 11 additions & 10 deletions videodb/video.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
IndexType,
SceneExtractionType,
SearchType,
Segmenter,
SubtitleStyle,
Workflows,
)
Expand Down Expand Up @@ -128,16 +129,16 @@ def _fetch_transcript(
self,
start: int = None,
end: int = None,
segmenter: str = None,
count: int = None,
segmenter: str = Segmenter.word,
length: int = 1,
force: bool = None,
) -> None:
if (
self.transcript
and not start
and not end
and not segmenter
and not count
and not length
and not force
):
return
Expand All @@ -147,7 +148,7 @@ def _fetch_transcript(
"start": start,
"end": end,
"segmenter": segmenter,
"count": count,
"length": length,
"force": "true" if force else "false",
},
show_progress=True,
Expand All @@ -159,25 +160,25 @@ def get_transcript(
self,
start: int = None,
end: int = None,
segmenter: str = None,
count: int = None,
segmenter: str = Segmenter.word,
length: int = 1,
force: bool = None,
) -> List[Dict]:
self._fetch_transcript(
start=start, end=end, segmenter=segmenter, count=count, force=force
start=start, end=end, segmenter=segmenter, length=length, force=force
)
return self.transcript

def get_transcript_text(
self,
start: int = None,
end: int = None,
segmenter: str = None,
count: int = None,
segmenter: str = Segmenter.word,
length: int = 1,
force: bool = None,
) -> str:
self._fetch_transcript(
start=start, end=end, segmenter=segmenter, count=count, force=force
start=start, end=end, segmenter=segmenter, length=length, force=force
)
return self.transcript_text

Expand Down

0 comments on commit c32c144

Please sign in to comment.