Readd removed comments

This commit is contained in:
syeopite 2021-10-12 04:09:01 -07:00
parent cc69d08983
commit f54c10004d
No known key found for this signature in database
GPG Key ID: 6FA616E5A5294A82
2 changed files with 5 additions and 1 deletions

View File

@ -9,6 +9,7 @@ module DB::Serializable
}}
end
# Initialize DB::Serializable descendants via NamedTuples
def initialize(tuple)
\{% for var in @type.instance_vars %}
\{% ann = var.annotation(::DB::Field) %}

View File

@ -61,9 +61,12 @@ private module Parsers
# Typically views are stored under a "simpleText" in the "viewCountText". However, for
# livestreams and premiered it is stored under a "runs" array: [{"text":123}, {"text": "watching"}]
# When view count is disabled the "viewCountText" is not present on InnerTube data.
# TODO change default value to nil and typical encoding type to tuple storing type (watchers, views, etc)
# TODO change default value to nil and change the view_count to tuple storing type (watchers, views, etc)
# and count
view_count = item_contents.dig?("viewCountText", "simpleText").try &.as_s.gsub(/\D+/, "").to_i64? || 0_i64
# TODO YouTube seems to have removed the description_html snippet and replaced it with "snippetText"
# inside the detailedMetadataSnippets attribute
description_html = item_contents["descriptionSnippet"]?.try { |t| parse_content(t) } || ""
# The length information *should* only always exist in "lengthText". However, the legacy Invidious code