This commit is contained in:
Trit0 2025-06-29 17:43:34 -04:00
parent b07616086c
commit c350aedcb5
4 changed files with 5 additions and 4 deletions

View File

@ -50,7 +50,7 @@ const optionsOpen = ref(false);
onMounted(async () => { onMounted(async () => {
games.value = await fetchGames(); games.value = await fetchGames();
tags.value = [...new Set(games.value.flatMap(game => game.Genres))]; tags.value = [...new Set(games.value.flatMap(game => game.Genres.split(",")))];
selectedTag.value = tags.value[0]; selectedTag.value = tags.value[0];
selectedGame.value = store.filteredGames[0]; selectedGame.value = store.filteredGames[0];
}); });

View File

@ -45,7 +45,7 @@ export async function fetchGames(): Promise<Game[]> {
// TODO games should be loaded from and started from the wails/go code // TODO games should be loaded from and started from the wails/go code
const games = await LoadGames(); const games = await LoadGames();
for (const game in games) { for (const game of games) {
console.log(game) console.log(game)
} }
return games; return games;

View File

@ -14,7 +14,7 @@ export const useAppStore = defineStore('app', {
}), }),
getters: { getters: {
filteredGames(state): Game[] { filteredGames(state): Game[] {
return state.games.filter(game => game.Genres.includes(state.selectedTag ?? '')); return state.games.filter(game => game.Genres.split(",").includes(state.selectedTag ?? ''));
} }
}, },
actions: { actions: {

View File

@ -105,7 +105,8 @@ func GetConjureGameInfo() []models.Game {
fmt.Println("Contents of metadata.txt:") fmt.Println("Contents of metadata.txt:")
metadata, err := io.ReadAll(rc) metadata, err := io.ReadAll(rc)
parseGameInfo(metadata) game := parseGameInfo(metadata)
games = append(games, game)
if err != nil { if err != nil {
log.Fatal(err) log.Fatal(err)
} }