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

Add listenbrainz scrobbling plugin. #3528

Merged
merged 2 commits into from
Feb 21, 2021

Conversation

ijc
Copy link
Contributor

@ijc ijc commented Jan 3, 2021

Check-list

  • There is a linked issue discussing the motivations for this feature or bugfix: Add ListenBrainz scrobbling support #2397
  • Unit tests have been added where possible
  • I've added / updated documentation for any user-facing features.
  • Performance seems to be comparable or better than current master

What this change is adding / fixing

This is a quick PR to pull in the listenbrainz plugin from ijc/quodlibet-listenbrainz-plugin@949270a as requested by @declension in #2397.

Listenbrainz is an opensource music scrobbling service from the metabrainz metabrainz foundation.


I tried to run setup.py test before submitting, but it segfaults even without these changes:

running test
============================================================================================================================== test session starts ==============================================================================================================================
platform linux -- Python 3.8.6, pytest-4.6.11, py-1.9.0, pluggy-0.13.0
rootdir: /local/scratch/ijc/development/listenbrainz/quodlibet, inifile: setup.cfg
collected 4355 items / 1 skipped / 4354 selected                                                                                                                                                                                                                                

tests/test___init__.py .....                                                                                                                                                                                                                                              [  0%]
tests/test_appdata_files.py ssss                                                                                                                                                                                                                                          [  0%]
tests/test_browsers___init__.py .........                                                                                                                                                                                                                                 [  0%]
tests/test_browsers__base.py Segmentation fault

It seems non-deterministic, I've also seen:

tests/test_browsers__base.py .  what():  Unable to read configuration
Aborted

and

tests/test_browsers__base.py .  what():  Unable to read configuration
Aborted

@declension
Copy link
Member

Thanks. To fix the tests I think you need to

  • Add some filenames to POTFILES.in so they get picked up for translation (as you've used translations there)
  • Fix the license to be the same setup as the all other source files
  • Fix / add typing annotations, and make sure anything that can be None is checked for (Mypy is good at finding these)
  • (auto)format the file to comply with PEP-008 to fix these:
E302 expected 2 blank lines, found 1
E         /home/runner/work/quodlibet/quodlibet/quodlibet/plugins/listenbrainz/__init__.py:27:1: F401 'quodlibet.const' imported but unused
E         /home/runner/work/quodlibet/quodlibet/quodlibet/plugins/listenbrainz/__init__.py:27:1: F401 'quodlibet.util' imported but unused
E         /home/runner/work/quodlibet/quodlibet/quodlibet/plugins/listenbrainz/__init__.py:57:1: E302 expected 2 blank lines, found 1
E         /home/runner/work/quodlibet/quodlibet/quodlibet/plugins/listenbrainz/__init__.py:60:1: E302 expected 2 blank lines, found 1
E         /home/runner/work/quodlibet/quodlibet/quodlibet/plugins/listenbrainz/__init__.py:63:1: E302 expected 2 blank lines, found 1
E         /home/runner/work/quodlibet/quodlibet/quodlibet/plugins/listenbrainz/__init__.py:65:20: E701 multiple statements on one line (colon)
E         /home/runner/work/quodlibet/quodlibet/quodlibet/plugins/listenbrainz/__init__.py:67:62: E231 missing whitespace after ','
E         /home/runner/work/quodlibet/quodlibet/quodlibet/plugins/listenbrainz/__init__.py:70:12: F821 undefined name 'e'
E         /home/runner/work/quodlibet/quodlibet/quodlibet/plugins/listenbrainz/__init__.py:71:59: F821 undefined name 'e'
E         /home/runner/work/quodlibet/quodlibet/quodlibet/plugins/listenbrainz/__init__.py:74:1: E302 expected 2 blank lines, found 1
E         /home/runner/work/quodlibet/quodlibet/quodlibet/plugins/listenbrainz/__init__.py:109:37: E231 missing whitespace after ','
E         /home/runner/work/quodlibet/quodlibet/quodlibet/plugins/listenbrainz/__init__.py:123:89: E501 line too long (225 > 88 characters)
E         /home/runner/work/quodlibet/quodlibet/quodlibet/plugins/listenbrainz/__init__.py:124:89: E501 line too long (115 > 88 characters)
E         /home/runner/work/quodlibet/quodlibet/quodlibet/plugins/listenbrainz/__init__.py:125:89: E501 line too long (103 > 88 characters)
E         /home/runner/work/quodlibet/quodlibet/quodlibet/plugins/listenbrainz/__init__.py:126:89: E501 line too long (92 > 88 characters)
E         /home/runner/work/quodlibet/quodlibet/quodlibet/plugins/listenbrainz/__init__.py:127:89: E501 line too long (101 > 88 characters)
E         /home/runner/work/quodlibet/quodlibet/quodlibet/plugins/listenbrainz/__init__.py:128:89: E501 line too long (106 > 88 characters)
E         /home/runner/work/quodlibet/quodlibet/quodlibet/plugins/listenbrainz/__init__.py:129:89: E501 line too long (117 > 88 characters)
E         /home/runner/work/quodlibet/quodlibet/quodlibet/plugins/listenbrainz/__init__.py:131:89: E501 line too long (144 > 88 characters)
E         /home/runner/work/quodlibet/quodlibet/quodlibet/plugins/listenbrainz/__init__.py:132:89: E501 line too long (305 > 88 characters)
E         /home/runner/work/quodlibet/quodlibet/quodlibet/plugins/listenbrainz/__init__.py:148:15: E231 missing whitespace after ','
E         /home/runner/work/quodlibet/quodlibet/quodlibet/plugins/listenbrainz/__init__.py:149:29: E241 multiple spaces after ','
E         /home/runner/work/quodlibet/quodlibet/quodlibet/plugins/listenbrainz/__init__.py:151:29: E241 multiple spaces after ','
E         /home/runner/work/quodlibet/quodlibet/quodlibet/plugins/listenbrainz/__init__.py:152:31: E241 multiple spaces after ','
E         /home/runner/work/quodlibet/quodlibet/quodlibet/plugins/listenbrainz/__init__.py:153:27: E241 multiple spaces after ','
E         /home/runner/work/quodlibet/quodlibet/quodlibet/plugins/listenbrainz/__init__.py:154:27: E241 multiple spaces after ','
E         /home/runner/work/quodlibet/quodlibet/quodlibet/plugins/listenbrainz/__init__.py:155:28: E241 multiple spaces after ','
E         /home/runner/work/quodlibet/quodlibet/quodlibet/plugins/listenbrainz/__init__.py:156:21: E241 multiple spaces after ','
E         /home/runner/work/quodlibet/quodlibet/quodlibet/plugins/listenbrainz/__init__.py:157:21: E241 multiple spaces after ','
E         /home/runner/work/quodlibet/quodlibet/quodlibet/plugins/listenbrainz/__init__.py:237:89: E501 line too long (122 > 88 characters)
E         /home/runner/work/quodlibet/quodlibet/quodlibet/plugins/listenbrainz/__init__.py:272:89: E501 line too long (114 > 88 characters)
E         /home/runner/work/quodlibet/quodlibet/quodlibet/plugins/listenbrainz/__init__.py:275:89: E501 line too long (91 > 88 characters)
E         /home/runner/work/quodlibet/quodlibet/quodlibet/plugins/listenbrainz/__init__.py:305:29: W291 trailing whitespace
E         /home/runner/work/quodlibet/quodlibet/quodlibet/plugins/listenbrainz/__init__.py:310:89: E501 line too long (97 > 88 characters)
E         /home/runner/work/quodlibet/quodlibet/quodlibet/plugins/listenbrainz/__init__.py:322:1: E302 expected 2 blank lines, found 1
E         /home/runner/work/quodlibet/quodlibet/quodlibet/plugins/listenbrainz/__init__.py:356:29: E226 missing whitespace around arithmetic operator
E         /home/runner/work/quodlibet/quodlibet/quodlibet/plugins/listenbrainz/__init__.py:424:24: E201 whitespace after '['

ℹ️ you can just run code quality tests locally with pytest /home/nick/workspace/quodlibet/tests/quality

@ijc
Copy link
Contributor Author

ijc commented Jan 5, 2021

Thanks, it'll likely be at least this weekend before I have a chance to look in to this.

@ijc ijc force-pushed the 2397-listenbrainz-plugin branch from abafd51 to 2b9f818 Compare February 19, 2021 21:17
ijc added 2 commits February 19, 2021 21:20
Imported from ijc/quodlibet-listenbrainz-plugin@949270a
as requested in quodlibet#2397.

The listenbrainz.py module is from @phw and licensed under the MIT license. The
plugin scaffolding was derived from the QLScrobbler plugin by me and is
licensed GPLv2.

Closes: quodlibet#2397
License update is propagated from the current version of qlscrobbler.py from
which the code is derived.
@ijc ijc force-pushed the 2397-listenbrainz-plugin branch from 2b9f818 to 55a5bf1 Compare February 19, 2021 21:24
@ijc
Copy link
Contributor Author

ijc commented Feb 20, 2021

@declension took a bit longer than I expected but I finally fixed the CI here.

@declension declension merged commit be13c29 into quodlibet:master Feb 21, 2021
@declension
Copy link
Member

Thanks!

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

Successfully merging this pull request may close these issues.

2 participants