Skip to content
This repository has been archived by the owner on Dec 7, 2020. It is now read-only.

Fix track filtering #232

Merged
merged 3 commits into from
Mar 10, 2020
Merged

Fix track filtering #232

merged 3 commits into from
Mar 10, 2020

Conversation

jjok
Copy link
Contributor

@jjok jjok commented Mar 1, 2020

Fixes #231

I guess these are things that changed with Python 3.

The filter() function now returns a filter object, rather than a list, so it has to be converted to a list before it can be filtered again in the loop.

It seems that a string is iterable, so we need to differentiate between a list and a string, we need to specifically check is values is a list, not just if it is iterable.

@codecov
Copy link

codecov bot commented Mar 1, 2020

Codecov Report

Merging #232 into master will not change coverage.
The diff coverage is 22.22%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #232   +/-   ##
=======================================
  Coverage   59.92%   59.92%           
=======================================
  Files           9        9           
  Lines         751      751           
=======================================
  Hits          450      450           
  Misses        301      301
Impacted Files Coverage Δ
mopidy_gmusic/library.py 50.87% <22.22%> (ø) ⬆️

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 88e71a1...5bb2d66. Read the comment docs.

@jodal jodal added this to the v4.0.1 milestone Mar 1, 2020
@jodal jodal requested a review from belak March 1, 2020 21:48
@jjok
Copy link
Contributor Author

jjok commented Mar 10, 2020

black run-test: commands[0] | python -m black --check .
would reformat /home/circleci/project/mopidy_gmusic/library.py
Oh no! 💥 💔 💥
1 file would be reformatted, 18 files would be left unchanged.
ERROR: InvocationError for command /home/circleci/project/.tox/black/bin/python -m black --check . (exited with code 1)
___________________________________ summary ____________________________________
ERROR:   black: commands failed

Exited with code exit status 1

@jodal Any idea why Black is failing? Is it some kind of linting that's failing? Or the actual command itself isn't running correctly?
If it's linting, it would be helpful to show what changes should be made, like Flake8 does.

@jodal
Copy link
Member

jodal commented Mar 10, 2020

Black does all the changes for you, if you just run black . locally.

@kingosticks
Copy link
Member

It's telling you that one file in the codebase failed the formatting check. Just run the command black and it'll make the changes required to the file for you. (don't forget to commit them too)

@jodal jodal merged commit 3f378dd into mopidy:master Mar 10, 2020
@jodal
Copy link
Member

jodal commented Mar 10, 2020

Thanks :-)

@jjok jjok deleted the fix/231 branch March 10, 2020 23:40
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

No tracks showing when browsing album
4 participants