Skip to content

Commit e11911b

Browse files
committed
update at schema
1 parent 3613593 commit e11911b

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

Diff for: api/src/AngelThumpClient.cpp

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
#include "AngelThumpClient.h"
22

3+
#include <string>
4+
35
#include "Curl.h"
46
#include "JSON.h"
57

@@ -20,7 +22,7 @@ rapidjson::Document ChannelResult::GetSchema() {
2022
"type": "string",
2123
"format": "uri"
2224
},
23-
"viewer_count": {"type": "integer"},
25+
"viewer_count": {"type": "string"},
2426
"user": {
2527
"type": "object",
2628
"properties": {
@@ -69,7 +71,7 @@ bool ChannelResult::IsNSFW() const {
6971

7072
uint64_t ChannelResult::GetViewers() const {
7173
return GetVideoData().HasMember("viewer_count")
72-
? GetVideoData()["viewer_count"].GetUint64()
74+
? std::stoull(json::StringRef(GetVideoData()["viewer_count"]))
7375
: 0;
7476
}
7577

Diff for: api/tests/AngelthumpTest.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ TEST(AngelthumpTest, TestNSFW) {
1414
{
1515
"type": "live",
1616
"thumbnail_url": "https://thumbnail.angelthump.com/thumbnails/psrngafk.jpeg",
17-
"viewer_count": 38,
17+
"viewer_count": "38",
1818
"user": {
1919
"offline_banner_url": "https://images-angelthump.nyc3.cdn.digitaloceanspaces.com/offline-banners/31dc54b09264952f60fcdd6b7b743920be725a74a1026a858b81b259cfc79fc6.png",
2020
"title": "Arrival (2016)",
@@ -45,7 +45,7 @@ TEST(AngelthumpTest, TestNotNSFW) {
4545
{
4646
"type": "live",
4747
"thumbnail_url": "https://thumbnail.angelthump.com/thumbnails/psrngafk.jpeg",
48-
"viewer_count": 34,
48+
"viewer_count": "34",
4949
"user": {
5050
"offline_banner_url": "https://images-angelthump.nyc3.cdn.digitaloceanspaces.com/offline-banners/31dc54b09264952f60fcdd6b7b743920be725a74a1026a858b81b259cfc79fc6.png",
5151
"title": "Arrival (2016)",

0 commit comments

Comments
 (0)