Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gamejolt trophies #80

Merged
merged 2 commits into from
Dec 13, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions app/Console/Commands/UpdateGamejoltAccountTrophies.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ public function handle()
foreach ($accounts as $account) {
try {
$trophies = $api->trophies()->fetch($account->username, $account->token);
if ($trophies['response'] != 'success') {
return;
}
$trophies = $trophies['response']['trophies'];
foreach ($trophies as $trophy) {
$account->trophies()->updateOrCreate(
Expand All @@ -65,6 +68,8 @@ public function handle()
}
} catch (TimeOutException $e) {
$this->error("Timeout for {$account->username}");
} catch (\Exception $e) {
$this->error("Unknown Error: {$e->getMessage()}");
}
}
return Command::SUCCESS;
Expand Down
2 changes: 1 addition & 1 deletion resources/views/member/show.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
</div>
<div x-show="activeTab===3">
@if($user->gamejolt)
@if($user->gamejolt->trophies)
@if($user->gamejolt->trophies->count() > 0)
<div class="w-full mb-2 text-gray-800 dark:text-slate-200">Completed {{ $user->gamejolt->trophies->where('achieved', true)->count() }} of {{ $user->gamejolt->trophies->count() }} trophies</div>
<div class="grid grid-cols-2 gap-4">
@foreach ($user->gamejolt->trophies as $trophy)
Expand Down