metabrainz / picard-plugins

Picard plugins: use 1.0 branch for Picard < 2.0 (python 2/Qt4) and 2.0 branch for Picard >= 2.0 (python 3/Qt5)
https://picard.musicbrainz.org/plugins/
145 stars 95 forks source link

Classical Extras: Error if release has a partial recording #133

Closed aereaux closed 6 years ago

aereaux commented 6 years ago

I am using the 0.8.6 release of classical_extras from here: https://github.com/MetaTunes/picard-plugins/ , but this was the only place I could find to report bugs. I think this bug also happens with the version of classical_extras in this repo.

Anyways, when classical_extras is enabled, on some of the albums in my music collection, picard gets stuck on "[loading album information]", and it outputs this to stderr:

  File "/usr/lib/python2.7/site-packages/picard/webservice.py", line 315, in _process_reply
    self._handle_reply(reply, request, handler, xml, refresh)
  File "/usr/lib/python2.7/site-packages/picard/webservice.py", line 304, in _handle_reply
    handler(document, reply, error)
  File "/home/aidane/.config/MusicBrainz/Picard/plugins/classical_extras.zip/classical_extras/__init__.py", line 3206, in work_process
  File "/home/aidane/.config/MusicBrainz/Picard/plugins/classical_extras.zip/classical_extras/__init__.py", line 3485, in process_album
  File "/home/aidane/.config/MusicBrainz/Picard/plugins/classical_extras.zip/classical_extras/__init__.py", line 4315, in extend_metadata
  File "/home/aidane/.config/MusicBrainz/Picard/plugins/classical_extras.zip/classical_extras/__init__.py", line 5074, in diff_pair
IndexError: list index out of range

and:

  File "/usr/lib/python2.7/site-packages/picard/webservice.py", line 315, in _process_reply
    self._handle_reply(reply, request, handler, xml, refresh)
  File "/usr/lib/python2.7/site-packages/picard/webservice.py", line 304, in _handle_reply
    handler(document, reply, error)
  File "/home/aidane/.config/MusicBrainz/Picard/plugins/classical_extras.zip/classical_extras/__init__.py", line 3206, in work_process
  File "/home/aidane/.config/MusicBrainz/Picard/plugins/classical_extras.zip/classical_extras/__init__.py", line 3485, in process_album
  File "/home/aidane/.config/MusicBrainz/Picard/plugins/classical_extras.zip/classical_extras/__init__.py", line 4116, in extend_metadata
  File "<string>", line 0

    ^
SyntaxError: unexpected EOF while parsing

I think this happens because the release include a partial recording. If any other information is needed to debug the problem, or if this is not the right place to report this bug, let me know.

Sophist-UK commented 6 years ago

Ping @MetaTunes.

MetaTunes commented 6 years ago

Thanks for the bug report @aereaux . Can you please post a link to the release that caused this error and I will investigate.

aereaux commented 6 years ago

I am currently using this release: https://github.com/MetaTunes/picard-plugins/releases/tag/v0.8.6 , and the bug appears. It has also appeared at least in the last few v0.8 releases.

aereaux commented 6 years ago

Here is an example of one of the releases it fails on: https://musicbrainz.org/release/9feb5f59-292f-47c8-a8cb-a8cc74f6dc40 . I also just confirmed that it the issue does not happen with the release in this repo (v0.7 / v0.8, the one available by default in Picard).

MetaTunes commented 6 years ago

Thanks @aereaux . That release works fine for me, but it may be a problem which only occurs with certain options. Can you post a copy of your picard.ini file so I can check it out?

aereaux commented 6 years ago

Here. Picard.ini.txt

MetaTunes commented 6 years ago

Hi @aereaux , I think the problem is that you are using Picard v 2.0 (dev version), whereas Classical Extras is designed to run on the current stable version v1.4. I will be releasing a v2.0-compatible version, but not until I have finished the 1.4-compatible version (which will be at least a month). If you want to use Classical Extras, I suggest you download Picard 1.4 (you can have both installed).

aereaux commented 6 years ago

I am 99% sure I am using picard v1.4. The 2.0 configuration stuff is there from when I accidentally upgraded, and classical extras did not work at all with that. Anyways, I did some additional testing, and I found out that it appears to work when I just open it from the tagger link on musicbrainz, but not when I actually select the files to tag. I also tried with a new config file, with the only changes being enabling the relationships options and the plugin, and it still failed.

MetaTunes commented 6 years ago

That might explain why I can't replicate the problem, since I only have the MB database, not the files. I'll investigate further.

MetaTunes commented 6 years ago

Judging from the error messages, it looks like you are using v0.8.5, not v0.8.6 2 options - either update to v0.8.6 now or wait a day or so and I should have released a new version with quite a few bug fixes and improvements.

aereaux commented 6 years ago

It looks like it is still not working after updating to v0.8.6 (the error messages were from when I was still using v0.8.5, sorry). Here is the updated error message, I think only the line numbers have changed.

  File "/usr/lib/python2.7/site-packages/picard/webservice.py", line 315, in _process_reply
    self._handle_reply(reply, request, handler, xml, refresh)
  File "/usr/lib/python2.7/site-packages/picard/webservice.py", line 304, in _handle_reply
    handler(document, reply, error)
  File "/home/aidane/.config/MusicBrainz/Picard/plugins/classical_extras.zip/classical_extras/__init__.py", line 3747, in work_process
  File "/home/aidane/.config/MusicBrainz/Picard/plugins/classical_extras.zip/classical_extras/__init__.py", line 4096, in process_album
  File "/home/aidane/.config/MusicBrainz/Picard/plugins/classical_extras.zip/classical_extras/__init__.py", line 5021, in extend_metadata
  File "/home/aidane/.config/MusicBrainz/Picard/plugins/classical_extras.zip/classical_extras/__init__.py", line 5829, in diff_pair
IndexError: list index out of range

Would it help to debug it if I gave you some of the music files that are failing?

MetaTunes commented 6 years ago

If you can find one fairly small file that fails, that may help, thanks (my internet is v.v.v. slow).

MetaTunes commented 6 years ago

Meanwhile, I've made a very small change that might fix this error and will be in v0.8.7

aereaux commented 6 years ago

I tried taking the audio data out of the files, and just leaving the metadata, and it still seems to exhibit the issue.
music.zip

I'll also try v0.8.7 as soon as it is released.

MetaTunes commented 6 years ago

v0.8.7 released - see https://github.com/MetaTunes/picard-plugins/releases/tag/v0.8.7

MetaTunes commented 6 years ago

See also comments at https://community.metabrainz.org/t/classical-extras-plugin/300217/100

MetaTunes commented 6 years ago

I could not replicate the problems you were experiencing, but did find another bug. Let me know how it goes.

aereaux commented 6 years ago

OK, the v0.8.7 release seems to have fixed some of the errors I was getting. It still fails (at least as far as I can tell) on these two releases: https://musicbrainz.org/release/5288f266-bab8-45bd-83e4-555730f02fa0

  File "/usr/lib/python2.7/site-packages/picard/webservice.py", line 315, in _process_reply
    self._handle_reply(reply, request, handler, xml, refresh)
  File "/usr/lib/python2.7/site-packages/picard/webservice.py", line 304, in _handle_reply
    handler(document, reply, error)
  File "/home/aidane/.config/MusicBrainz/Picard/plugins/classical_extras.zip/classical_extras/__init__.py", line 3855, in work_process
  File "/home/aidane/.config/MusicBrainz/Picard/plugins/classical_extras.zip/classical_extras/__init__.py", line 4236, in process_album
  File "/home/aidane/.config/MusicBrainz/Picard/plugins/classical_extras.zip/classical_extras/__init__.py", line 5026, in extend_metadata
  File "<string>", line 0
    ^
SyntaxError: unexpected EOF while parsing

and https://musicbrainz.org/release/38e6faed-801f-42a0-802a-c5bbb4e95445

  File "/usr/lib/python2.7/site-packages/picard/webservice.py", line 315, in _process_reply
    self._handle_reply(reply, request, handler, xml, refresh)
  File "/usr/lib/python2.7/site-packages/picard/webservice.py", line 304, in _handle_reply
    handler(document, reply, error)
  File "/home/aidane/.config/MusicBrainz/Picard/plugins/classical_extras.zip/classical_extras/__init__.py", line 3855, in work_process
  File "/home/aidane/.config/MusicBrainz/Picard/plugins/classical_extras.zip/classical_extras/__init__.py", line 4236, in process_album
  File "/home/aidane/.config/MusicBrainz/Picard/plugins/classical_extras.zip/classical_extras/__init__.py", line 4991, in extend_metadata
  File "<string>", line 0
    ^
SyntaxError: unexpected EOF while parsing

The symptoms are the same as before: it will finish processing all the other albums, and the pending requests will go down to zero, but the offending albums will still be listed as '[loading album information]'. The interface will be responsive pretty much the whole time, I don't think I'm seeing any of the symptoms that I saw mentioned in the thread you linked.

MetaTunes commented 6 years ago

I've looked at the first release. I can see what the cause of the problem is, but I'm not sure of the solution! The problem arises because Finlandia (CD3 Track 7) has an arrangement Finlandia-hymni (CD10, track 17). The latter is treated as a part of the former and the plugin is therefore confused as to whether Finlandia is a "level 0" or "level 1" work. The problem is therefore linked to the caching issue #134 , as it results from trying to re-use works information between albums (to reduce time-consuming look-ups) so I will try and deal with them both, but not sure if I'll fix it before Xmas. Also, there may be other problems related to this release. Meanwhile, if I find a work-round, I'll post it.

MetaTunes commented 6 years ago

The second release (Barber) is the same issue. The famous adagio is there as part of the quartet no 11 and as the arrangement. At least this is a smaller release to use for testing! Great music! Enjoy it, albeit without the full metadata until I find a fix.

aereaux commented 6 years ago

OK, thanks for the quick responses and for looking into this. I've really enjoyed using your plugin for tagging my classical music.

MetaTunes commented 6 years ago

Any idea why En Saga is shown as two different but apparently identical recordings: https://beta.musicbrainz.org/recording/675173fe-ef2e-4ad7-afa7-27024b10e4a5 ?

aereaux commented 6 years ago

Looks like some of the duplicate relationships were kept around when two recordings were merged. I went ahead and submitted an edit to delete them.

MetaTunes commented 6 years ago

v0.8.8 should now fix this - see https://community.metabrainz.org/t/classical-extras-plugin/300217/120

aereaux commented 6 years ago

Yep, it now appears fixed. Thanks.