Skip to content

Commit

Permalink
fix Page.all() bug
Browse files Browse the repository at this point in the history
  • Loading branch information
sakura committed Jul 29, 2022
1 parent 58de6d8 commit 00bcb2c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

**优雅的异步高性能 Python 音乐 API 库**

开箱即用/简单/快速
开箱即用/简单/快速 Python >= 3.9

[基于 NeteaseCloudMusicApi 改写](https://github.com/Binaryify/NeteaseCloudMusicApi)

Expand Down
6 changes: 3 additions & 3 deletions pycloudmusic/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,10 @@ async def all(
else:
await self._set_index(data)

tasks, page = [], 0
while page <= self.__max_page:
tasks = []
while self.__page <= self.__max_page:
tasks.append(asyncio.create_task(self.__api_fun(page=self.__page, limit=self.limit, **self.kwargs)))
page += 1
self.__page += 1

done, _ = await asyncio.wait(tasks)
return (task.result() for task in done)
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

setup(
name="pycloudmusic",
version="0.1.2.1",
version="0.1.2.2",
description="优雅的异步高性能 Python 音乐 API 库",
keywords=[
"cloudmusic",
Expand Down

0 comments on commit 00bcb2c

Please sign in to comment.