videos: move formats structure to a separate file/module

This commit is contained in:
Samantaz Fox
2022-05-23 21:54:48 +02:00
parent 6250039405
commit 88141c459c
4 changed files with 120 additions and 118 deletions

View File

@@ -50,7 +50,7 @@ module Invidious::Frontend::WatchPage
video_assets.full_videos.each do |option|
mimetype = option["mimeType"].as_s.split(";")[0]
height = itag_to_metadata?(option["itag"]).try &.["height"]?
height = Invidious::Videos::Formats.itag_to_metadata?(option["itag"]).try &.["height"]?
value = {"itag": option["itag"], "ext": mimetype.split("/")[1]}.to_json