Removed need for more API calls by parsing the publishedTimeText string

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

No files matched your search

+1 -1
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