mirror of
https://github.com/iv-org/invidious.git
synced 2026-01-28 07:48:31 -06:00
Fix Style/RedundantBegin type of Ameba issues
This commit is contained in:
parent
5f1c9849bf
commit
9f96682783
@ -31,9 +31,6 @@ Lint/SpecFilename:
|
||||
# Style
|
||||
#
|
||||
|
||||
Style/RedundantBegin:
|
||||
Enabled: false
|
||||
|
||||
Style/RedundantReturn:
|
||||
Enabled: false
|
||||
|
||||
|
||||
@ -64,20 +64,18 @@ struct Preferences
|
||||
end
|
||||
|
||||
def self.from_json(value : JSON::PullParser) : String
|
||||
begin
|
||||
result = value.read_string
|
||||
result = value.read_string
|
||||
|
||||
if result.empty?
|
||||
CONFIG.default_user_preferences.dark_mode
|
||||
else
|
||||
result
|
||||
end
|
||||
rescue ex
|
||||
if value.read_bool
|
||||
"dark"
|
||||
else
|
||||
"light"
|
||||
end
|
||||
if result.empty?
|
||||
CONFIG.default_user_preferences.dark_mode
|
||||
else
|
||||
result
|
||||
end
|
||||
rescue ex
|
||||
if value.read_bool
|
||||
"dark"
|
||||
else
|
||||
"light"
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@ -17,11 +17,9 @@ struct Invidious::User
|
||||
|
||||
module PreferencesConverter
|
||||
def self.from_rs(rs)
|
||||
begin
|
||||
Preferences.from_json(rs.read(String))
|
||||
rescue ex
|
||||
Preferences.from_json("{}")
|
||||
end
|
||||
Preferences.from_json(rs.read(String))
|
||||
rescue ex
|
||||
Preferences.from_json("{}")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@ -37,15 +37,13 @@ record AuthorFallback, name : String, id : String
|
||||
private module Parsers
|
||||
module BaseParser
|
||||
def parse(*args)
|
||||
begin
|
||||
return parse_internal(*args)
|
||||
rescue ex
|
||||
LOGGER.debug("#{{{ @type.name }}}: Failed to render item.")
|
||||
LOGGER.debug("#{{{ @type.name }}}: Got exception: #{ex.message}")
|
||||
ProblematicTimelineItem.new(
|
||||
parse_exception: ex
|
||||
)
|
||||
end
|
||||
return parse_internal(*args)
|
||||
rescue ex
|
||||
LOGGER.debug("#{{{ @type.name }}}: Failed to render item.")
|
||||
LOGGER.debug("#{{{ @type.name }}}: Got exception: #{ex.message}")
|
||||
ProblematicTimelineItem.new(
|
||||
parse_exception: ex
|
||||
)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user