mirror of
https://github.com/ankitects/anki.git
synced 2026-01-13 22:13:58 -05:00
trim file to basename before creating SoundOrVideoTag
This commit is contained in:
parent
27c1ed1899
commit
c57ab0a04f
2 changed files with 3 additions and 3 deletions
|
|
@ -95,7 +95,7 @@ class PartiallyRenderedCard:
|
|||
def av_tag_to_native(tag: card_rendering_pb2.AVTag) -> AVTag:
|
||||
val = tag.WhichOneof("value")
|
||||
if val == "sound_or_video":
|
||||
return SoundOrVideoTag(filename=tag.sound_or_video)
|
||||
return SoundOrVideoTag(filename=os.path.basename(tag.sound_or_video))
|
||||
else:
|
||||
return TTSTag(
|
||||
field_text=tag.tts.field_text,
|
||||
|
|
|
|||
|
|
@ -176,7 +176,7 @@ class AVPlayer:
|
|||
self._stop_if_playing()
|
||||
|
||||
def play_file(self, filename: str) -> None:
|
||||
self.play_tags([SoundOrVideoTag(filename=filename)])
|
||||
self.play_tags([SoundOrVideoTag(filename=os.path.basename(filename))])
|
||||
|
||||
def play_file_with_caller(self, filename: str, caller: Any) -> None:
|
||||
if self.current_caller:
|
||||
|
|
@ -185,7 +185,7 @@ class AVPlayer:
|
|||
self.play_file(filename)
|
||||
|
||||
def insert_file(self, filename: str) -> None:
|
||||
self._enqueued.insert(0, SoundOrVideoTag(filename=filename))
|
||||
self._enqueued.insert(0, SoundOrVideoTag(filename=os.path.basename(filename)))
|
||||
self._play_next_if_idle()
|
||||
|
||||
def toggle_pause(self) -> None:
|
||||
|
|
|
|||
Loading…
Reference in a new issue