spl0k / supysonic

Supysonic is a Python implementation of the Subsonic server API.
https://supysonic.readthedocs.io
GNU Affero General Public License v3.0
259 stars 57 forks source link

merge identical genre tags in album info #221

Closed davebiffuk closed 2 years ago

davebiffuk commented 2 years ago

This PR merges duplicate track genre tags when constructing the album genre info. This change will help players which display the album genre to avoid cluttering their display with a repeated list of identical genre names. This idea came from https://github.com/peguerosdc/subplayer/issues/48

codecov[bot] commented 2 years ago

Codecov Report

Merging #221 (a1eeeb8) into master (e6e20d1) will not change coverage. The diff coverage is 100.00%.

:exclamation: Current head a1eeeb8 differs from pull request most recent head e8d3f16. Consider uploading reports for the commit e8d3f16 to get more accurate results Impacted file tree graph

@@           Coverage Diff           @@
##           master     #221   +/-   ##
=======================================
  Coverage   86.67%   86.67%           
=======================================
  Files          40       40           
  Lines        3684     3684           
=======================================
  Hits         3193     3193           
  Misses        491      491           
Impacted Files Coverage Δ
supysonic/db.py 93.75% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update e6e20d1...e8d3f16. Read the comment docs.

spl0k commented 2 years ago

Hi, thank you for the PR.

I guess I didn't understand Pony's attribute lifting properly, it seems to have some confusing behaviour. I'll run some tests on this, there might be a better way to fix it.

davebiffuk commented 2 years ago

I know nothing about Pony, sorry, so this is a naive patch but it works for me. If there's a better way, that's great.

davebiffuk commented 2 years ago

Nice, thanks!