Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Popular Page is empty. #7964

Closed
drew2a opened this issue Apr 11, 2024 · 1 comment · Fixed by #7970
Closed

Popular Page is empty. #7964

drew2a opened this issue Apr 11, 2024 · 1 comment · Fixed by #7970
Assignees

Comments

@drew2a
Copy link
Contributor

drew2a commented Apr 11, 2024

Describe the bug
The Popular Page is empty.

To Reproduce
Steps to reproduce the behavior:

  1. Open Tribler
  2. Go to "Popular"
  3. See an empty page

Expected behavior
I expect to see a list of popular torrents.

Screenshots
image

Desktop (please complete the following information):

  • OS: macOS 12.7.4
  • Tribler's version: main (5695d0e)
@drew2a drew2a added this to the 7.15.0 milestone Apr 11, 2024
@drew2a
Copy link
Contributor Author

drew2a commented Apr 11, 2024

After some time, the results appear on the page. The strange thing here is that the database was not empty. It contains torrent entities that, for some reason, do not appear on the Popular page.

The query:

t = time() - POPULAR_TORRENTS_FRESHNESS_PERIOD
health_list = list(
select(
health for health in self.TorrentState
if health.has_data == 1 # The condition had to be written this way for the partial index to work
and health.last_check >= t and (health.seeders > 0 or health.leechers > 0)
).order_by(
lambda health: (desc(health.seeders), desc(health.leechers), desc(health.last_check))
)[:POPULAR_TORRENTS_COUNT]
)
pony_query = pony_query.where(lambda g: g.health in health_list)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging a pull request may close this issue.

1 participant