Skip to content

Commit

Permalink
remove unused
Browse files Browse the repository at this point in the history
  • Loading branch information
nquang29 committed Nov 22, 2024
1 parent 4beb99c commit f8df7db
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 3 additions & 0 deletions backend/database/redis_db.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,9 @@ def get_plugin_installs_count(plugin_id: str) -> int:
return int(count)

def get_plugins_installs_count(plugin_ids: list) -> dict:
if not plugin_ids:
return {}

keys = [f'plugins:{plugin_id}:installs' for plugin_id in plugin_ids]
counts = r.mget(keys)
return {
Expand Down
2 changes: 0 additions & 2 deletions backend/utils/apps.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,8 @@ def get_available_apps(uid: str, include_reviews: bool = False) -> List[App]:
app_dict = app
app_dict['enabled'] = app['id'] in user_enabled
app_dict['rejected'] = app['approved'] is False
#app_dict['installs'] = get_plugin_installs_count(app['id'])
app_dict['installs'] = plugins_install.get(app['id'],0)
if include_reviews:
#reviews = get_plugin_reviews(app['id'])
reviews = plugins_review.get(app['id'], {})
sorted_reviews = reviews.values()
rating_avg = sum([x['score'] for x in sorted_reviews]) / len(sorted_reviews) if reviews else None
Expand Down

0 comments on commit f8df7db

Please sign in to comment.