Skip to content

Commit 49a7521

Browse files
committed
Update book.py
1 parent f9e4688 commit 49a7521

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/tools/book.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ def server(self):
165165
def GetBook(self, bookId) -> BookInfo:
166166
if not bookId:
167167
return
168-
return self.books.get(int(bookId))
168+
return self.books.get(str(bookId))
169169

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

178178
def UpdateBookInfo(self, bookId, info):
179+
bookId = str(bookId)
179180
book = self.GetBook(bookId)
180181
assert isinstance(info, BookInfo)
181182
if not book:
@@ -186,6 +187,7 @@ def UpdateBookInfo(self, bookId, info):
186187
return
187188

188189
def UpdateBookPicture(self, bookId, epsId, aid, minAid, pictureUrl, pictureName):
190+
bookId = str(bookId)
189191
book = self.GetBook(bookId)
190192
assert isinstance(book, BookInfo)
191193
if not book:
@@ -200,6 +202,7 @@ def UpdateBookPicture(self, bookId, epsId, aid, minAid, pictureUrl, pictureName)
200202
return
201203

202204
def UpdateBookEps(self, bookId, newEps):
205+
bookId = str(bookId)
203206
book = self.GetBook(bookId)
204207
assert isinstance(book, BookInfo)
205208
if not book:
@@ -211,6 +214,7 @@ def UpdateBookEps(self, bookId, newEps):
211214
book.pageInfo.epsInfo[newEps.index] = newEps
212215

213216
def UpdateBookEpsScrambleId(self, bookId, epsIndex, scrambleId):
217+
bookId = str(bookId)
214218
book = self.GetBook(bookId)
215219
assert isinstance(book, BookInfo)
216220
if not book:

0 commit comments

Comments
 (0)