Skip to content

Commit

Permalink
Update book.py
Browse files Browse the repository at this point in the history
  • Loading branch information
tonquer committed Jun 30, 2024
1 parent f9e4688 commit 49a7521
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/tools/book.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ def server(self):
def GetBook(self, bookId) -> BookInfo:
if not bookId:
return
return self.books.get(int(bookId))
return self.books.get(str(bookId))

def UpdateBookInfoList(self, bookList):
for info in bookList:
Expand All @@ -176,6 +176,7 @@ def UpdateBookInfoList(self, bookList):
self.books[info.baseInfo.id] = info

def UpdateBookInfo(self, bookId, info):
bookId = str(bookId)
book = self.GetBook(bookId)
assert isinstance(info, BookInfo)
if not book:
Expand All @@ -186,6 +187,7 @@ def UpdateBookInfo(self, bookId, info):
return

def UpdateBookPicture(self, bookId, epsId, aid, minAid, pictureUrl, pictureName):
bookId = str(bookId)
book = self.GetBook(bookId)
assert isinstance(book, BookInfo)
if not book:
Expand All @@ -200,6 +202,7 @@ def UpdateBookPicture(self, bookId, epsId, aid, minAid, pictureUrl, pictureName)
return

def UpdateBookEps(self, bookId, newEps):
bookId = str(bookId)
book = self.GetBook(bookId)
assert isinstance(book, BookInfo)
if not book:
Expand All @@ -211,6 +214,7 @@ def UpdateBookEps(self, bookId, newEps):
book.pageInfo.epsInfo[newEps.index] = newEps

def UpdateBookEpsScrambleId(self, bookId, epsIndex, scrambleId):
bookId = str(bookId)
book = self.GetBook(bookId)
assert isinstance(book, BookInfo)
if not book:
Expand Down

0 comments on commit 49a7521

Please sign in to comment.