Skip to content

Commit 30995ae

Browse files
committed
adding last combinations of searches + testing all urls
1 parent 7bdd1ad commit 30995ae

File tree

11 files changed

+136
-110
lines changed

11 files changed

+136
-110
lines changed

onepyece/__init__.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,16 @@
1616
"chapter_by_title",
1717
"count_chapters",
1818
"arc_by_id",
19-
"arc_by_title",
19+
# "arc_by_title",
20+
"arc_by_saga_id",
2021
"count_arcs",
2122
"saga_by_id",
2223
"saga_by_title",
2324
"count_sagas",
2425
"haki_by_id",
2526
"haki_by_name",
2627
"haki_by_roman_name",
28+
"haki_by_characters_id",
2729
"count_hakis",
2830
"character_by_id",
2931
"character_by_name",
16 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.
199 Bytes
Binary file not shown.
286 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.

onepyece/common.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,24 +5,24 @@
55
"episodes": ["id", "count", "title", "saga_id", "arc_id"],
66
"movies": ["id", "count", "title"],
77
"tomes": ["id", "count", "title"],
8-
"chapters": ["id", "count", "title"],
9-
"arcs": ["id", "count", "title"],
8+
"chapters": ["id", "count", "title", "tome_id", "tome"],
9+
"arcs": ["id", "count", "saga_id"],
1010
"sagas": ["id", "count", "title"],
11-
"hakis": ["id", "count", "name", "roman_name"],
11+
"hakis": ["id", "count", "name", "roman_name", "characters_id"],
1212
"characters": ["id", "count", "name", "job", "bounty", "status", "size"],
1313
"dials": ["id", "count", "name", "type"],
1414
"luffy/gears": ["id", "count", "title"],
15-
"luffy/techniques": ["id", "count", "name", "translation"],
15+
"luffy/techniques": ["id", "count", "name", "translation", "gear_id"],
1616
"locates": ["id", "count", "name", "sea", "affiliation"],
1717
"fruits": ["id", "count", "type"],
1818
"swords": ["id", "count", "name"],
1919
"boats": ["id", "count", "name", "type", "crew_id", "captain_id"],
2020
"crews": ["id", "count", "name", "status", "yonko"],
2121
}
2222

23-
STRING_SEARCHES = ["name", "job", "bounty", "status", "size", "type"]
23+
STRING_SEARCHES = ["name", "job", "bounty", "status", "size", "type", "tome_name", "roman_name", "sea", "affiliation"]
2424
ID_SEARCHES = ["crew_id", "captain_id"]
25-
NO_SEARCH_ID_SEARCHES = ["saga_id", "arc_id"]
25+
NO_SEARCH_ID_SEARCHES = ["saga_id", "arc_id", "characters_id", "gear_id", "tome_id"]
2626
NO_RESOURCE_SEARCHES = ["count", "yonko"]
2727

2828

@@ -51,7 +51,7 @@ def build_url(endpoint, search=None, resource_id=None):
5151
def adding_search(endpoint, search, resource_id=None):
5252
if search in STRING_SEARCHES:
5353
return f"{URL}{endpoint}/search/{search}/{resource_id}"
54-
elif search in ID_SEARCHES:
54+
elif search in ID_SEARCHES or (endpoint == "arcs" and 'id' in search and search != "id"):
5555
return f"{URL}{endpoint}/search/{search[:-3]}/{resource_id}"
5656
elif search in NO_SEARCH_ID_SEARCHES:
5757
return f"{URL}{endpoint}/{search[:-3]}/{resource_id}"
@@ -67,4 +67,4 @@ def convert_name(name):
6767

6868

6969
def pretty_print(data):
70-
return json.dumps(data, indent=4)
70+
return json.dumps(data, indent=4, ensure_ascii=False).encode("utf8").decode()

0 commit comments

Comments
 (0)