Skip to content

Commit

Permalink
Merge branch 'master' of github.com:TLNBS2405/heihachi into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
AbhijeetKrishnan committed Mar 24, 2024
2 parents 1d2be9d + e9de99e commit 2dc4ac4
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
6 changes: 5 additions & 1 deletion src/frame_service/wavu/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [
Expand Down Expand Up @@ -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 = ""

Expand Down
2 changes: 0 additions & 2 deletions src/framedb/framedb.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion src/heihachi/embed.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 2dc4ac4

Please sign in to comment.