0.2.4: Fix it and ship it

This commit is contained in:
Fijxu 2024-07-03 17:55:07 -04:00
parent fc2957a601
commit ee578cc90b
Signed by: Fijxu
GPG key ID: 32C1DDF333EDA6A4

View file

@ -390,7 +390,7 @@ module TwAPI::Datahandlers::Twitch
end
json.field "statusHidden", false # TODO: what is this? I need to get it NOW!
json.field "followedAt", gql["info"]["relationship"]["followedAt"]
if (gql["info"]["relationship"]["streak"] == nil) || (gql["info"]["relationship"]["streak"]["elapsedDays"]? == 0)
if gql["info"]["relationship"]["streak"] == nil
json.field "streak", nil
else
json.field "streak" do
@ -403,7 +403,7 @@ module TwAPI::Datahandlers::Twitch
end
end
end
if (gql["info"]["relationship"]["cumulative"] == nil) || (gql["info"]["relationship"]["cumulative"]["elapsedDays"]? == 0)
if gql["info"]["relationship"]["cumulative"] == nil
json.field "cumulative", nil
else
json.field "cumulative" do
@ -421,17 +421,26 @@ module TwAPI::Datahandlers::Twitch
else
json.field "meta" do
json.object do
if json.field "type", gql["info"]["relationship"]["meta"]["giftMeta"]["isGift"] == false
if gql["info"]["relationship"]["meta"]["giftMeta"]["isGift"] == false
json.field "type", "paid"
elsif gql["info"]["relationship"]["meta"]["purchasedWithPrime"] == true
json.field "type", "prime"
else
json.field "type", "gift"
end
json.field "tier", (gql["info"]["relationship"]["meta"]["tier"].to_s.to_i // 1000)
json.field "tier", (gql["info"]["relationship"]["meta"]["tier"].to_s.to_i // 1000).to_s
json.field "endsAt", gql["info"]["relationship"]["meta"]["endsAt"]
json.field "renewsAt", gql["info"]["relationship"]["meta"]["renewsAt"]
json.field "giftMeta", nil # TODO: fill giftMeta is sub is gifted
if gql["info"]["relationship"]["meta"]["giftMeta"]["isGift"] == true
json.field "giftMeta" do
json.object do
json.field "giftDate", gql["info"]["relationship"]["meta"]["giftMeta"]["giftDate"]
json.field "gifter", gql["info"]["relationship"]["meta"]["giftMeta"]["gifter"]
end
end
else
json.field "giftMeta", nil
end
end
end
end