mirror of
https://github.com/ryankazokas/turbovault-app.git
synced 2026-04-17 02:52:55 +00:00
Adds types
This commit is contained in:
@@ -1,4 +1,7 @@
|
||||
# typed: true
|
||||
|
||||
class IgdbMatchesController < ApplicationController
|
||||
extend T::Sig
|
||||
before_action :require_authentication
|
||||
before_action :set_suggestion, only: [ :approve, :reject ]
|
||||
|
||||
@@ -10,7 +13,7 @@ class IgdbMatchesController < ApplicationController
|
||||
.where(games: { igdb_id: nil })
|
||||
.includes(game: :platform)
|
||||
.group_by(&:game)
|
||||
|
||||
|
||||
@matched_games = current_user.games.igdb_matched.count
|
||||
@unmatched_games = current_user.games.igdb_unmatched.count
|
||||
@pending_review_count = current_user.igdb_match_suggestions
|
||||
@@ -43,8 +46,8 @@ class IgdbMatchesController < ApplicationController
|
||||
end
|
||||
|
||||
# Check if games need syncing
|
||||
unmatched_count = current_user.games.igdb_unmatched.where(igdb_match_status: [nil, "failed"]).count
|
||||
|
||||
unmatched_count = current_user.games.igdb_unmatched.where(igdb_match_status: [ nil, "failed" ]).count
|
||||
|
||||
if unmatched_count == 0
|
||||
redirect_to igdb_matches_path, alert: "All games are already matched or being processed!"
|
||||
return
|
||||
@@ -53,7 +56,7 @@ class IgdbMatchesController < ApplicationController
|
||||
# Try to run job immediately for faster feedback
|
||||
begin
|
||||
IgdbSyncJob.perform_later
|
||||
|
||||
|
||||
redirect_to igdb_matches_path, notice: "IGDB sync started! Processing #{unmatched_count} games. This may take a few minutes - the page will auto-refresh."
|
||||
rescue => e
|
||||
Rails.logger.error("Failed to start IGDB sync: #{e.message}")
|
||||
|
||||
Reference in New Issue
Block a user