From d9bf4f745b12f7a9cd06b72eb0e036b0b3db01e8 Mon Sep 17 00:00:00 2001 From: Emi Matchu Date: Sun, 1 Dec 2024 10:39:19 -0800 Subject: [PATCH] Skip glitched appearances in bulk-labeling mode It's not as important to label glitched states, and sometimes the glitch prevents it from being visually identifiable. Don't sweat 'em! --- app/controllers/pet_states_controller.rb | 2 +- app/models/pet_state.rb | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/app/controllers/pet_states_controller.rb b/app/controllers/pet_states_controller.rb index cd988d9c9..4fc7d5339 100644 --- a/app/controllers/pet_states_controller.rb +++ b/app/controllers/pet_states_controller.rb @@ -38,7 +38,7 @@ class PetStatesController < ApplicationController # Rather than just getting the newest unlabeled pet state, prioritize the # newest *pet type*. This better matches the user's perception of what the # newest state is, because the Rainbow Pool UI is grouped by pet type! - unlabeled_appearance = PetState.unlabeled.newest_pet_type.newest.first + unlabeled_appearance = PetState.needs_labeling.newest_pet_type.newest.first if unlabeled_appearance edit_pet_type_pet_state_path( diff --git a/app/models/pet_state.rb b/app/models/pet_state.rb index 2a5ce1dfd..17b027ed8 100644 --- a/app/models/pet_state.rb +++ b/app/models/pet_state.rb @@ -20,6 +20,7 @@ class PetState < ApplicationRecord scope :newest, -> { order(created_at: :desc) } scope :newest_pet_type, -> { joins(:pet_type).merge(PetType.newest) } scope :unlabeled, -> { with_pose("UNKNOWN") } + scope :needs_labeling, -> { unlabeled.where(glitched: false) } # A simple ordering that tries to bring reliable pet states to the front. scope :emotion_order, -> {