Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Password problem when reusing MPD protocol module #646
I've been working on an extension that was basically meant to override and "enhance" the basic MPD frontend, giving the ability to configure what actions users can perform on a playlist, how many requests can be sent from a particular IP, etc. As a proof of concept I made an extension that just overrides the base mpd module, and it worked perfectly except for a problem I ran into with this line:
I had disabled the mpd module, but wanted to reuse the protocol, and mopidy.mpd.protocol was still referencing the mpd configuration in just that one instance. I was able to get around this by writing a special case to override that particular handler method, but it felt a bit dirty.
My question is: would it make sense to abstract the protocol module a bit more to make it more reusable? Or am I approaching this whole thing the wrong way?
Hmm, as I'm sure you've noticed this code was never written with this type of use in mind :-)
Immediate ideas that come to mind is:
#591 might also play in to this as we would likely end up with tokenizing the requests instead of regexp mathcing them, making some of these ideas easier to achieve.
@nathanharper I have done so by using stickers in the mpd frontend, and creating Metadata Provider feature in the core.
The usage would be to use sticker set song service:user:txomon and so. Maybe you are interested on that branch https://github.com/txomon/mopidy/tree/feature/metadata-provider