Skip to content

Commit

Permalink
Group history compact layout results by quality (#9788)
Browse files Browse the repository at this point in the history
* Group history compact layout results by quality

* Refactor. Quality is always available.
  • Loading branch information
p0psicles authored Aug 13, 2021
1 parent 2a72f3e commit 10be933
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions medusa/server/api/v2/history.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,8 @@ def get(self, series_slug, path_param):
for item in results:
if item.get('showid') and item.get('season') and item.get('episode') and item.get('indexer_id'):
item['showslug'] = f"{indexer_id_to_name(item['indexer_id'])}{item['showid']}"
my_key = f"{item['showslug']}S{item['season']}E{item['episode']}"
res.setdefault(my_key, []).append(item)
group_by_key = f"{item['showslug']}S{item['season']}E{item['episode']}Q{item['quality']}"
res.setdefault(group_by_key, []).append(item)
results = res
headers['X-Pagination-Count'] = len(results)

Expand Down

0 comments on commit 10be933

Please sign in to comment.