From cdd67ffbc335b0708f6e41c71573801cb9a23b8e Mon Sep 17 00:00:00 2001 From: Midorica Date: Sat, 25 Nov 2023 15:41:38 -0500 Subject: [PATCH] cxb: fix data handlers for s1 & add coupons for s2 --- titles/cxb/data/rss2/FreeCoupon.csv | 9 +++++++++ titles/cxb/rss1.py | 4 ++-- titles/cxb/rss2.py | 7 ++++++- 3 files changed, 17 insertions(+), 3 deletions(-) create mode 100644 titles/cxb/data/rss2/FreeCoupon.csv diff --git a/titles/cxb/data/rss2/FreeCoupon.csv b/titles/cxb/data/rss2/FreeCoupon.csv new file mode 100644 index 0000000..0767645 --- /dev/null +++ b/titles/cxb/data/rss2/FreeCoupon.csv @@ -0,0 +1,9 @@ +1,1412103600,4070908801,1, +2,1412103600,4070908801,1, +3,1412103600,4070908801,1, +4,1412103600,4070908801,1, +5,1412103600,4070908801,1, +6,1412103600,4070908801,1, +7,1412103600,4070908801,1, +8,1412103600,4070908801,1, +9,1412103600,4070908801,1, diff --git a/titles/cxb/rss1.py b/titles/cxb/rss1.py index ac657bb..fe43e42 100644 --- a/titles/cxb/rss1.py +++ b/titles/cxb/rss1.py @@ -122,7 +122,7 @@ class CxbRevSunriseS1(CxbBase): def handle_data_extra_stage_list_request(self, data: Dict) -> Dict: return {"data": ""} - def handle_data_ex0001_request(self, data: Dict) -> Dict: + def handle_data_exxxxx_request(self, data: Dict) -> Dict: return {"data": ""} def handle_data_one_more_extra_list_request(self, data: Dict) -> Dict: @@ -131,7 +131,7 @@ class CxbRevSunriseS1(CxbBase): def handle_data_bonus_list10100_request(self, data: Dict) -> Dict: return {"data": ""} - def handle_data_oe0001_request(self, data: Dict) -> Dict: + def handle_data_oexxxx_request(self, data: Dict) -> Dict: return {"data": ""} def handle_data_free_coupon_request(self, data: Dict) -> Dict: diff --git a/titles/cxb/rss2.py b/titles/cxb/rss2.py index 85cca85..114d142 100644 --- a/titles/cxb/rss2.py +++ b/titles/cxb/rss2.py @@ -140,7 +140,12 @@ class CxbRevSunriseS2(CxbBase): return {"data": ""} def handle_data_free_coupon_request(self, data: Dict) -> Dict: - return {"data": ""} + ret_str="" + with open(r"titles/cxb/data/rss2/FreeCoupon.csv") as coupon: + lines = coupon.readlines() + for line in lines: + ret_str += f"{line[:-1]}\r\n" + return({"data":ret_str}) @cached(lifetime=86400) def handle_data_news_list_request(self, data: Dict) -> Dict: