Skip to content

Commit c094a54

Browse files
committed
fix: fixed author encoding bug and revamped description
1 parent a118aa0 commit c094a54

File tree

3 files changed

+16
-4
lines changed

3 files changed

+16
-4
lines changed

api/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "1.3"
1+
__version__ = "1.3.2"

api/anime_girls.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,12 @@ def to_dict(self) -> BookDict:
7878

7979
def to_file_response(self) -> FileResponse:
8080
"""Returns file response object."""
81+
try: # Testing to see if the author name can encode. If not just set it as null.
82+
self.commit_author.encode("latin-1")
83+
except UnicodeEncodeError as e:
84+
self.commit_author = "null"
85+
print(e)
86+
8187
return FileResponse(
8288
self.path,
8389
headers = {

api/main.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,17 @@
2626
}
2727
]
2828

29+
DESCRIPTION = """
30+
Behold the **anime girls holding programming books** API. ✴️
31+
32+
This is a ✨ feature rich 🌟 [open source](https://github.com/THEGOLDENPRO/aghpb_api) API I made for the anime girls holding programming books [github repo](https://github.com/cat-milk/Anime-Girls-Holding-Programming-Books) because I was bored.
33+
34+
🐞 Report bugs [over here](https://github.com/THEGOLDENPRO/aghpb_api/issues).
35+
"""
36+
2937
app = FastAPI(
3038
title = "AGHPB API",
31-
description = "Behold the **anime girls holding programming books** API. ✴️ \n\n" \
32-
"This is an open api I made for the anime girls holding programming books " \
33-
"[github repo](https://github.com/cat-milk/Anime-Girls-Holding-Programming-Books) because I was bored.",
39+
description = DESCRIPTION,
3440
license_info = {
3541
"name": "Apache 2.0",
3642
"identifier": "MIT",

0 commit comments

Comments
 (0)