mirror of
https://github.com/iv-org/invidious.git
synced 2025-01-16 08:22:21 +01:00
Corrected usage of publishedText variable throughout the code
This commit is contained in:
parent
7b7197cde8
commit
cab02d4959
2 changed files with 5 additions and 2 deletions
|
@ -246,7 +246,11 @@ module Invidious::JSONify::APIv1
|
|||
json.field "viewCountText", rv["short_view_count"]?
|
||||
json.field "viewCount", rv["view_count"]?.try &.empty? ? nil : rv["view_count"].to_i64
|
||||
json.field "published", rv["published"]?
|
||||
json.field "publishedTimeText", translate(locale, "`x` ago", rv["publishedText"].to_s.gsub(" ago", ""))
|
||||
if !rv[published].nil?
|
||||
json.field "publishedText", translate(locale, "`x` ago", recode_date(rv[published], locale))
|
||||
else
|
||||
json.field "publishedText", translate(locale, "`x` ago", "NaN")
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -56,7 +56,6 @@ def parse_related_video(related : JSON::Any) : Hash(String, JSON::Any)?
|
|||
"short_view_count" => JSON::Any.new(short_view_count || "0"),
|
||||
"author_verified" => JSON::Any.new(author_verified),
|
||||
"published" => JSON::Any.new(published || ""),
|
||||
"publishedText" => JSON::Any.new(published_time_text || ""),
|
||||
}
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue