From 2dc17d7409df1e6ee258a6cc684a064921a32350 Mon Sep 17 00:00:00 2001 From: syeopite Date: Wed, 20 Sep 2023 11:52:07 -0700 Subject: [PATCH] Add data for chapters to JSON endpoint for videos --- src/invidious/jsonify/api_v1/video_json.cr | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/invidious/jsonify/api_v1/video_json.cr b/src/invidious/jsonify/api_v1/video_json.cr index 0dced80b..0967403e 100644 --- a/src/invidious/jsonify/api_v1/video_json.cr +++ b/src/invidious/jsonify/api_v1/video_json.cr @@ -201,6 +201,14 @@ module Invidious::JSONify::APIv1 end end + if !video.chapters.empty? + json.field "chapters" do + json.object do + Invidious::Videos::Chapters.to_json(json, video.chapters, video.automatically_generated_chapters?.as(Bool)) + end + end + end + if !video.music.empty? json.field "musicTracks" do json.array do