mirror of
https://github.com/discourse/discourse.git
synced 2026-03-04 01:15:08 +08:00
We recently hid multiple very technical site settings related to image quality. In this PR we add a unified image_quality setting. Power users can still configure the individual settings (now defaulting to 0) and they will take precedence.
20 lines
393 B
Ruby
20 lines
393 B
Ruby
# frozen_string_literal: true
|
|
|
|
class ImageQualitySetting < EnumSiteSetting
|
|
def self.valid_value?(val)
|
|
values.any? { |v| v[:value].to_s == val.to_s }
|
|
end
|
|
|
|
def self.values
|
|
[
|
|
{ name: "original", value: 100 },
|
|
{ name: "high", value: 90 },
|
|
{ name: "medium", value: 70 },
|
|
{ name: "low", value: 50 },
|
|
]
|
|
end
|
|
|
|
def self.translate_names?
|
|
false
|
|
end
|
|
end
|