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

Plugin addition - Submit Folksonomy Tags #349

Closed Viktini closed 1 year ago

Viktini commented 1 year ago

You may know me as Victini on MusicBrainz or Flaky on Discord.

Put briefly, this plugin lets users submit tags from their files as MusicBrainz' folksonomy tags. I've gone into more detail here: https://community.metabrainz.org/t/submit-folksonomy-tags-plugin-for-submitting-tags-to-musicbrainz-via-picard/626105

The only major bug I have with the plugin is that submitting after logging in from Picard's "to do this you must login" popup gives me an Unauthorised error (any subsequent submits are fine and of course, logging on before submitting), but Aerozol suggested on Discord that I should submit this anyhow and fix it later.

Viktini commented 1 year ago

Only major issue is the complexity now. I should be able to work on that next week, if that's alright?

rdswift commented 1 year ago

Only major issue is the complexity now. I should be able to work on that next week, if that's alright?

That should be fine. I don't think there's any need to rush. The current working version is available from your repository if anybody wants to try it out, so I suggest that you take whatever time you need. For what it's worth, I still have a tendency to include everything in the same function / module / method myself. I think it's because I've done way too much "linear" programming in the past, and haven't totally embraced the concepts of OOP. :grin:

One final thing, and this is really minor... I appreciate the credit that you've provided in the comments in your code, but I noticed that you referred to 'rswift' rather than 'rdswift'. Like I said, really minor. :wink:

Viktini commented 1 year ago

Alright, thank you! :)

I've tested the plugin on Arch Linux (Python 3.10.10) / Picard 2.8.5 and all seems to be working just fine now. The complexity of the main function should still be sorted in the near future, but if there's no other problems I think it can be merged.

Viktini commented 1 year ago

I've started work on refactoring, and thus far I've managed to split the submission handler into different functions in a class. I'm using Radon as a way to check if I'm on the right track, will that pose an issue with Codacy?

FWIW, the initial functions I have have a complexity of 13 at the highest (Radon also says B-grade) right now.