Skip to content

Commit

Permalink
gui: can't scroll down after click 'play all' button (feeluown#655)
Browse files Browse the repository at this point in the history
  • Loading branch information
cosven committed Mar 4, 2023
1 parent ab17da1 commit 8f6ac7c
Show file tree
Hide file tree
Showing 4 changed files with 180 additions and 127 deletions.
11 changes: 8 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,22 @@ docs:
pylint:
pylint feeluown/gui/pages/ feeluown/fuoexec/ feeluown/server/


# Packages need to check currently.
# All packages are supposed to be checked in the future.
MYPY_PKGS=
MYPY_PKGS+=feeluown/library/
MYPY_PKGS+=feeluown/player/
MYPY_PKGS+=feeluown/app/
MYPY_PKGS+=feeluown/entry_points/

MYPY_STRICT_PKGS=
MYPY_STRICT_PKGS+=feeluown/utils/reader.py
MYPY_STRICT_PKGS+=feeluown/server/
MYPY_STRICT_PKGS+=feeluown/cli/cli.py
MYPY_STRICT_PKGS+=feeluown/gui/widgets/textlist.py
mypy:
# Add flag --check-untyped-defs.
mypy ${MYPY_PKGS}
mypy --check-untyped-defs feeluown/server/ feeluown/cli/cli.py feeluown/gui/widgets/textlist.py
mypy --check-untyped-defs ${MYPY_STRICT_PKGS}

flake8:
flake8 feeluown/ tests/
Expand Down
6 changes: 3 additions & 3 deletions feeluown/gui/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
和应用逻辑相关的一些工具函数
"""
import asyncio
import itertools
import random
import sys
import logging
Expand All @@ -20,6 +19,7 @@
pass

from feeluown.utils import aio
from feeluown.utils.reader import AsyncReader
from feeluown.excs import ProviderIOError
from feeluown.library import NotSupported, ModelType, BaseModel
from feeluown.models.uri import reverse
Expand Down Expand Up @@ -348,7 +348,7 @@ def fetch_more_impl(self):
reader = self._reader
step = self._fetch_more_step

if reader.is_async:
if isinstance(reader, AsyncReader):
async def fetch():
items = []
count = 0
Expand All @@ -362,7 +362,7 @@ async def fetch():
future.add_done_callback(self._async_fetch_cb)
else:
try:
items = list(itertools.islice(reader, step))
items = reader.read_range(self.rowCount(), step + self.rowCount())
except ProviderIOError:
logger.exception('fetch more items failed')
self._fetch_more_cb([])
Expand Down

0 comments on commit 8f6ac7c

Please sign in to comment.