diff --git a/app/controllers/cities_controller.rb b/app/controllers/cities_controller.rb
index aaf3976..a97510c 100644
--- a/app/controllers/cities_controller.rb
+++ b/app/controllers/cities_controller.rb
@@ -5,6 +5,7 @@ class CitiesController < ApplicationController
def index
@regions = Region.order(:name)
@cities = City.includes(:country, country: :region).order(:name)
+ @latest_arts = WeatherArt.includes(:city, :image_attachment).latest(1)
if params[:query].present?
@cities = @cities.search_by_name(params[:query])
diff --git a/app/models/weather_art.rb b/app/models/weather_art.rb
index 2550991..2f96114 100644
--- a/app/models/weather_art.rb
+++ b/app/models/weather_art.rb
@@ -120,7 +120,7 @@ class WeatherArt < ApplicationRecord
medium: [ 896, 512 ],
small: [ 448, 256 ]
}.freeze
- def preview_image(size = :medium)
+ def preview_image(size = :big)
return nil unless image.attached?
width, height = PREVIEW_DIMENSIONS[size] || PREVIEW_DIMENSIONS[:medium]
diff --git a/app/views/cities/index.html.erb b/app/views/cities/index.html.erb
index b5aae1c..ebd0048 100644
--- a/app/views/cities/index.html.erb
+++ b/app/views/cities/index.html.erb
@@ -1,7 +1,7 @@
- <% featured_art = WeatherArt.includes(:city).joins(:image_attachment).order(created_at: :desc).first %>
+ <% featured_art = @latest_arts.first %>
<% if featured_art&.image&.attached? %>
diff --git a/app/views/home/index.html.erb b/app/views/home/index.html.erb
index 9f238b1..048de0c 100644
--- a/app/views/home/index.html.erb
+++ b/app/views/home/index.html.erb
@@ -3,7 +3,7 @@
<% if @latest_arts.first&.image&.attached? %>
- <%= image_tag @latest_arts.first.preview_image(:large).processed, class: "w-full h-full object-cover" %>
+ <%= image_tag @latest_arts.first.webp_image.processed, class: "w-full h-full object-cover" %>
<% end %>
diff --git a/app/workers/batch_generate_weather_arts_worker.rb b/app/workers/batch_generate_weather_arts_worker.rb
index fe03033..8641647 100644
--- a/app/workers/batch_generate_weather_arts_worker.rb
+++ b/app/workers/batch_generate_weather_arts_worker.rb
@@ -4,8 +4,8 @@ class BatchGenerateWeatherArtsWorker
GENERATION_INTERVAL = 36.hours
MAX_DURATION = 5.minutes
SLEEP_DURATION = 10.seconds
- DAILY_GENERATION_LIMIT = 50 # 每日生成图片上限
- PER_RUN_GENERATION_LIMIT = 5 # 每次运行生成图片上限
+ DAILY_GENERATION_LIMIT = 60 # 每日生成图片上限
+ PER_RUN_GENERATION_LIMIT = 3 # 每次运行生成图片上限
def perform(*args)
start_time = Time.current