Removed need for more API calls by parsing the publishedTimeText string

This commit is contained in:
RadoslavL
2023-10-09 12:00:37 +03:00
parent 6b929da0e1
commit b7a252b096
2 changed files with 58 additions and 43 deletions

View File

@@ -245,7 +245,7 @@ module Invidious::JSONify::APIv1
json.field "lengthSeconds", rv["length_seconds"]?.try &.to_i
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"]?.try { |t| Time.parse(t, "%Y-%m-%d", Time::Location::UTC).to_unix } || Time.utc
json.field "published", rv["published"]?
end
end
end