File tree 2 files changed +6
-4
lines changed
2 files changed +6
-4
lines changed Original file line number Diff line number Diff line change 1
1
#include " AngelThumpClient.h"
2
2
3
+ #include < string>
4
+
3
5
#include " Curl.h"
4
6
#include " JSON.h"
5
7
@@ -20,7 +22,7 @@ rapidjson::Document ChannelResult::GetSchema() {
20
22
"type": "string",
21
23
"format": "uri"
22
24
},
23
- "viewer_count": {"type": "integer "},
25
+ "viewer_count": {"type": "string "},
24
26
"user": {
25
27
"type": "object",
26
28
"properties": {
@@ -69,7 +71,7 @@ bool ChannelResult::IsNSFW() const {
69
71
70
72
uint64_t ChannelResult::GetViewers () const {
71
73
return GetVideoData ().HasMember (" viewer_count" )
72
- ? GetVideoData ()[" viewer_count" ]. GetUint64 ( )
74
+ ? std::stoull ( json::StringRef ( GetVideoData ()[" viewer_count" ]) )
73
75
: 0 ;
74
76
}
75
77
Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ TEST(AngelthumpTest, TestNSFW) {
14
14
{
15
15
"type": "live",
16
16
"thumbnail_url": "https://thumbnail.angelthump.com/thumbnails/psrngafk.jpeg",
17
- "viewer_count": 38 ,
17
+ "viewer_count": "38" ,
18
18
"user": {
19
19
"offline_banner_url": "https://images-angelthump.nyc3.cdn.digitaloceanspaces.com/offline-banners/31dc54b09264952f60fcdd6b7b743920be725a74a1026a858b81b259cfc79fc6.png",
20
20
"title": "Arrival (2016)",
@@ -45,7 +45,7 @@ TEST(AngelthumpTest, TestNotNSFW) {
45
45
{
46
46
"type": "live",
47
47
"thumbnail_url": "https://thumbnail.angelthump.com/thumbnails/psrngafk.jpeg",
48
- "viewer_count": 34 ,
48
+ "viewer_count": "34" ,
49
49
"user": {
50
50
"offline_banner_url": "https://images-angelthump.nyc3.cdn.digitaloceanspaces.com/offline-banners/31dc54b09264952f60fcdd6b7b743920be725a74a1026a858b81b259cfc79fc6.png",
51
51
"title": "Arrival (2016)",
You can’t perform that action at this time.
0 commit comments