cxb: hotfix to classic rev

This commit is contained in:
Midorica 2024-02-26 18:35:34 -05:00
parent 43d0edf036
commit b83399cef4
2 changed files with 29 additions and 19 deletions

View File

@ -1,6 +1,11 @@
# Changelog # Changelog
Documenting updates to ARTEMiS, to be updated every time the master branch is pushed to. Documenting updates to ARTEMiS, to be updated every time the master branch is pushed to.
## 20240226
### CXB
+ Fixing paths for rev.py
+ Changed encoding for handle_data_item_list_icon_request
## 20240202 ## 20240202
### SAO ### SAO
+ Added reader assets and edited the game specific documentation + Added reader assets and edited the game specific documentation

View File

@ -47,7 +47,7 @@ class CxbRev(CxbBase):
@cached(lifetime=86400) @cached(lifetime=86400)
async def handle_data_music_list_request(self, data: Dict) -> Dict: async def handle_data_music_list_request(self, data: Dict) -> Dict:
ret_str = "" ret_str = ""
with open(r"titles/cxb/data/rss/MusicArchiveList.csv") as music: with open(r"titles/cxb/data/rev/MusicArchiveList.csv") as music:
lines = music.readlines() lines = music.readlines()
for line in lines: for line in lines:
line_split = line.split(",") line_split = line.split(",")
@ -59,7 +59,7 @@ class CxbRev(CxbBase):
async def handle_data_item_list_icon_request(self, data: Dict) -> Dict: async def handle_data_item_list_icon_request(self, data: Dict) -> Dict:
ret_str = "\r\n#ItemListIcon\r\n" ret_str = "\r\n#ItemListIcon\r\n"
with open( with open(
r"titles/cxb/data/rss/Item/ItemArchiveList_Icon.csv", encoding="utf-8" r"titles/cxb/data/rev/Item/ItemArchiveList_Icon.csv", encoding="shift-jis"
) as item: ) as item:
lines = item.readlines() lines = item.readlines()
for line in lines: for line in lines:
@ -70,7 +70,7 @@ class CxbRev(CxbBase):
async def handle_data_item_list_skin_notes_request(self, data: Dict) -> Dict: async def handle_data_item_list_skin_notes_request(self, data: Dict) -> Dict:
ret_str = "\r\n#ItemListSkinNotes\r\n" ret_str = "\r\n#ItemListSkinNotes\r\n"
with open( with open(
r"titles/cxb/data/rss/Item/ItemArchiveList_SkinNotes.csv", encoding="utf-8" r"titles/cxb/data/rev/Item/ItemArchiveList_SkinNotes.csv", encoding="utf-8"
) as item: ) as item:
lines = item.readlines() lines = item.readlines()
for line in lines: for line in lines:
@ -81,7 +81,7 @@ class CxbRev(CxbBase):
async def handle_data_item_list_skin_effect_request(self, data: Dict) -> Dict: async def handle_data_item_list_skin_effect_request(self, data: Dict) -> Dict:
ret_str = "\r\n#ItemListSkinEffect\r\n" ret_str = "\r\n#ItemListSkinEffect\r\n"
with open( with open(
r"titles/cxb/data/rss/Item/ItemArchiveList_SkinEffect.csv", encoding="utf-8" r"titles/cxb/data/rev/Item/ItemArchiveList_SkinEffect.csv", encoding="utf-8"
) as item: ) as item:
lines = item.readlines() lines = item.readlines()
for line in lines: for line in lines:
@ -92,7 +92,7 @@ class CxbRev(CxbBase):
async def handle_data_item_list_skin_bg_request(self, data: Dict) -> Dict: async def handle_data_item_list_skin_bg_request(self, data: Dict) -> Dict:
ret_str = "\r\n#ItemListSkinBg\r\n" ret_str = "\r\n#ItemListSkinBg\r\n"
with open( with open(
r"titles/cxb/data/rss/Item/ItemArchiveList_SkinBg.csv", encoding="utf-8" r"titles/cxb/data/rev/Item/ItemArchiveList_SkinBg.csv", encoding="utf-8"
) as item: ) as item:
lines = item.readlines() lines = item.readlines()
for line in lines: for line in lines:
@ -103,7 +103,7 @@ class CxbRev(CxbBase):
async def handle_data_item_list_title_request(self, data: Dict) -> Dict: async def handle_data_item_list_title_request(self, data: Dict) -> Dict:
ret_str = "\r\n#ItemListTitle\r\n" ret_str = "\r\n#ItemListTitle\r\n"
with open( with open(
r"titles/cxb/data/rss/Item/ItemList_Title.csv", encoding="shift-jis" r"titles/cxb/data/rev/Item/ItemList_Title.csv", encoding="shift-jis"
) as item: ) as item:
lines = item.readlines() lines = item.readlines()
for line in lines: for line in lines:
@ -114,7 +114,7 @@ class CxbRev(CxbBase):
async def handle_data_shop_list_music_request(self, data: Dict) -> Dict: async def handle_data_shop_list_music_request(self, data: Dict) -> Dict:
ret_str = "\r\n#ShopListMusic\r\n" ret_str = "\r\n#ShopListMusic\r\n"
with open( with open(
r"titles/cxb/data/rss/Shop/ShopList_Music.csv", encoding="shift-jis" r"titles/cxb/data/rev/Shop/ShopList_Music.csv", encoding="shift-jis"
) as shop: ) as shop:
lines = shop.readlines() lines = shop.readlines()
for line in lines: for line in lines:
@ -125,7 +125,7 @@ class CxbRev(CxbBase):
async def handle_data_shop_list_icon_request(self, data: Dict) -> Dict: async def handle_data_shop_list_icon_request(self, data: Dict) -> Dict:
ret_str = "\r\n#ShopListIcon\r\n" ret_str = "\r\n#ShopListIcon\r\n"
with open( with open(
r"titles/cxb/data/rss/Shop/ShopList_Icon.csv", encoding="shift-jis" r"titles/cxb/data/rev/Shop/ShopList_Icon.csv", encoding="shift-jis"
) as shop: ) as shop:
lines = shop.readlines() lines = shop.readlines()
for line in lines: for line in lines:
@ -136,7 +136,7 @@ class CxbRev(CxbBase):
async def handle_data_shop_list_title_request(self, data: Dict) -> Dict: async def handle_data_shop_list_title_request(self, data: Dict) -> Dict:
ret_str = "\r\n#ShopListTitle\r\n" ret_str = "\r\n#ShopListTitle\r\n"
with open( with open(
r"titles/cxb/data/rss/Shop/ShopList_Title.csv", encoding="shift-jis" r"titles/cxb/data/rev/Shop/ShopList_Title.csv", encoding="shift-jis"
) as shop: ) as shop:
lines = shop.readlines() lines = shop.readlines()
for line in lines: for line in lines:
@ -156,7 +156,7 @@ class CxbRev(CxbBase):
async def handle_data_shop_list_sale_request(self, data: Dict) -> Dict: async def handle_data_shop_list_sale_request(self, data: Dict) -> Dict:
ret_str = "\r\n#ShopListSale\r\n" ret_str = "\r\n#ShopListSale\r\n"
with open( with open(
r"titles/cxb/data/rss/Shop/ShopList_Sale.csv", encoding="shift-jis" r"titles/cxb/data/rev/Shop/ShopList_Sale.csv", encoding="shift-jis"
) as shop: ) as shop:
lines = shop.readlines() lines = shop.readlines()
for line in lines: for line in lines:
@ -164,14 +164,19 @@ class CxbRev(CxbBase):
return {"data": ret_str} return {"data": ret_str}
async def handle_data_extra_stage_list_request(self, data: Dict) -> Dict: async def handle_data_extra_stage_list_request(self, data: Dict) -> Dict:
return {"data": ""} ret_str = ""
with open(r"titles/cxb/data/rev/ExtraStageList.csv", encoding="shift-jis") as stage:
lines = stage.readlines()
for line in lines:
ret_str += f"{line[:-1]}\r\n"
return {"data": ret_str}
@cached(lifetime=86400) @cached(lifetime=86400)
async def handle_data_exxxxx_request(self, data: Dict) -> Dict: async def handle_data_exxxxx_request(self, data: Dict) -> Dict:
extra_num = int(data["dldate"]["filetype"][-4:]) extra_num = int(data["dldate"]["filetype"][-4:])
ret_str = "" ret_str = ""
with open( with open(
rf"titles/cxb/data/rss/Ex000{extra_num}.csv", encoding="shift-jis" rf"titles/cxb/data/rev/Ex000{extra_num}.csv", encoding="shift-jis"
) as stage: ) as stage:
lines = stage.readlines() lines = stage.readlines()
for line in lines: for line in lines:
@ -187,7 +192,7 @@ class CxbRev(CxbBase):
@cached(lifetime=86400) @cached(lifetime=86400)
async def handle_data_news_list_request(self, data: Dict) -> Dict: async def handle_data_news_list_request(self, data: Dict) -> Dict:
ret_str = "" ret_str = ""
with open(r"titles/cxb/data/rss/NewsList.csv", encoding="UTF-8") as news: with open(r"titles/cxb/data/rev/NewsList.csv", encoding="UTF-8") as news:
lines = news.readlines() lines = news.readlines()
for line in lines: for line in lines:
ret_str += f"{line[:-1]}\r\n" ret_str += f"{line[:-1]}\r\n"
@ -199,7 +204,7 @@ class CxbRev(CxbBase):
@cached(lifetime=86400) @cached(lifetime=86400)
async def handle_data_license_request(self, data: Dict) -> Dict: async def handle_data_license_request(self, data: Dict) -> Dict:
ret_str = "" ret_str = ""
with open(r"titles/cxb/data/rss/License_Offline.csv", encoding="UTF-8") as lic: with open(r"titles/cxb/data/rev/License_Offline.csv", encoding="UTF-8") as lic:
lines = lic.readlines() lines = lic.readlines()
for line in lines: for line in lines:
ret_str += f"{line[:-1]}\r\n" ret_str += f"{line[:-1]}\r\n"
@ -209,7 +214,7 @@ class CxbRev(CxbBase):
async def handle_data_course_list_request(self, data: Dict) -> Dict: async def handle_data_course_list_request(self, data: Dict) -> Dict:
ret_str = "" ret_str = ""
with open( with open(
r"titles/cxb/data/rss/Course/CourseList.csv", encoding="UTF-8" r"titles/cxb/data/rev/Course/CourseList.csv", encoding="UTF-8"
) as course: ) as course:
lines = course.readlines() lines = course.readlines()
for line in lines: for line in lines:
@ -222,7 +227,7 @@ class CxbRev(CxbBase):
extra_num = int(data["dldate"]["filetype"][-4:]) extra_num = int(data["dldate"]["filetype"][-4:])
ret_str = "" ret_str = ""
with open( with open(
rf"titles/cxb/data/rss/Course/Cs000{extra_num}.csv", encoding="shift-jis" rf"titles/cxb/data/rev/Course/Cs000{extra_num}.csv", encoding="shift-jis"
) as course: ) as course:
lines = course.readlines() lines = course.readlines()
for line in lines: for line in lines:
@ -233,7 +238,7 @@ class CxbRev(CxbBase):
async def handle_data_mission_list_request(self, data: Dict) -> Dict: async def handle_data_mission_list_request(self, data: Dict) -> Dict:
ret_str = "" ret_str = ""
with open( with open(
r"titles/cxb/data/rss/MissionList.csv", encoding="shift-jis" r"titles/cxb/data/rev/MissionList.csv", encoding="shift-jis"
) as mission: ) as mission:
lines = mission.readlines() lines = mission.readlines()
for line in lines: for line in lines:
@ -250,7 +255,7 @@ class CxbRev(CxbBase):
async def handle_data_event_list_request(self, data: Dict) -> Dict: async def handle_data_event_list_request(self, data: Dict) -> Dict:
ret_str = "" ret_str = ""
with open( with open(
r"titles/cxb/data/rss/Event/EventArchiveList.csv", encoding="shift-jis" r"titles/cxb/data/rev/Event/EventArchiveList.csv", encoding="shift-jis"
) as mission: ) as mission:
lines = mission.readlines() lines = mission.readlines()
for line in lines: for line in lines:
@ -292,7 +297,7 @@ class CxbRev(CxbBase):
async def handle_data_event_stamp_list_request(self, data: Dict) -> Dict: async def handle_data_event_stamp_list_request(self, data: Dict) -> Dict:
ret_str = "" ret_str = ""
with open( with open(
r"titles/cxb/data/rss/Event/EventStampList.csv", encoding="shift-jis" r"titles/cxb/data/rev/Event/EventStampList.csv", encoding="shift-jis"
) as event: ) as event:
lines = event.readlines() lines = event.readlines()
for line in lines: for line in lines: