MCPcopy Create free account
hub / github.com/CodeClash-ai/CodeClash / get_navigation_info

Function get_navigation_info

codeclash/viewer/app.py:1005–1025  ·  view source on GitHub ↗

Get previous and next game folders for navigation

(selected_folder: str)

Source from the content-addressed store, hash-verified

1003
1004
1005def get_navigation_info(selected_folder: str) -> dict[str, str | None]:
1006 """Get previous and next game folders for navigation"""
1007 # Get all game folders
1008 game_folders = find_all_game_folders(LOG_BASE_DIR)
1009
1010 # Extract game folder names
1011 game_names = [folder["name"] for folder in game_folders]
1012 game_names.sort()
1013
1014 # Find current game index
1015 try:
1016 current_index = game_names.index(selected_folder)
1017 except ValueError:
1018 # Current folder not found in the list
1019 return {"previous": None, "next": None}
1020
1021 # Determine previous and next
1022 previous_game = game_names[current_index - 1] if current_index > 0 else None
1023 next_game = game_names[current_index + 1] if current_index < len(game_names) - 1 else None
1024
1025 return {"previous": previous_game, "next": next_game}
1026
1027
1028@timeout(120)

Callers 1

_render_game_viewer_implFunction · 0.85

Calls 1

find_all_game_foldersFunction · 0.85

Tested by

no test coverage detected