diff --git a/src/frame_service/wavu/utils.py b/src/frame_service/wavu/utils.py index c8dfd93..80d8ccc 100644 --- a/src/frame_service/wavu/utils.py +++ b/src/frame_service/wavu/utils.py @@ -12,6 +12,7 @@ from framedb.const import CharacterName WAVU_API_URL = "https://wavu.wiki/w/api.php" +WAVU_VIDEO_LINK = "https://wavu.wiki/t/Special:Redirect/file/" """Available fields for the Move table in the Wavu DB""" FIELDS = [ @@ -130,8 +131,11 @@ def _convert_json_move(move_json: Any) -> WavuMove: else: image = "" - if "video" in move_json: + if "video" in move_json and move_json["video"]: video = _process_links(move_json["video"]) + video_name = video.split(":")[-1] + video_name = video_name.replace(" ", "_") + video = WAVU_VIDEO_LINK + video_name else: video = "" diff --git a/src/framedb/framedb.py b/src/framedb/framedb.py index 2fdea96..d5b3d2d 100644 --- a/src/framedb/framedb.py +++ b/src/framedb/framedb.py @@ -255,8 +255,6 @@ def search_move(self, character: Character, move_query: str) -> Move | List[Move moves = character_move elif len(similar_name_moves) == 1: moves = similar_name_moves[0] - elif len(similar_input_moves) == 1: - moves = similar_input_moves[0] else: similar_moves = similar_name_moves + similar_input_moves moves = similar_moves diff --git a/src/heihachi/embed.py b/src/heihachi/embed.py index c54f6c6..bb3572d 100644 --- a/src/heihachi/embed.py +++ b/src/heihachi/embed.py @@ -98,7 +98,8 @@ def get_move_embed(frame_service: FrameService, character: Character, move: Move if move.image: embed.set_image(url=move.image) - # TODO: include move.video in a nice way + if move.video: + embed.add_field(name="Video", value=f"[Link]({move.video})", inline=False) return embed