InputUsername / rescrobbled

MPRIS music scrobbler daemon
GNU General Public License v3.0
232 stars 13 forks source link

Player whitelist: identifying options #61

Closed Tuuuukka closed 2 years ago

Tuuuukka commented 2 years ago

Since we have a lot of Electron/Chromium based media players in the Linux world, it's hard to whitelist these, as their Identity property always(?) has the value of "Chromium". So basically if I have three of this kind of players, I can't whitelist just one of them, as the Identity is the same: https://github.com/InputUsername/rescrobbled/blob/f901d95e16b98223c0a29190acdd57fcc121855d/src/player.rs#L59-L69

Using the unique D-Bus name works, but the unique part automatically changes every time the player is restarted, so it's not a long term solution.

Would it be feasible to take the whitelisting a little further to provide more control to the user?

InputUsername commented 2 years ago

Would it be feasible to take the whitelisting a little further to provide more control to the user?

Sure! Do you have anything specific in mind?

What do these unique D-Bus names look like? The current check should be able to deal with bus names like org.mpris.MediaPlayer2.player.instance123, where the player part is constant but the instance123 changes. Then you can just whitelist player and it should work.

Tuuuukka commented 2 years ago

What do these unique D-Bus names look like? The current check should be able to deal with bus names like org.mpris.MediaPlayer2.player.instance123, where the player part is constant but the instance123 changes.

That's the thing, they're following the same chromiumish approach, so they're all like this:

$ playerctl --list-all
chromium.instance8096
chromium.instance1145951

So there's not much to work with 😄 Of course it might be possible to change these names on the app's side, but at least every Electron based player I've used are named like this. So it might be something that's not even possible to change.

That's why I'm thinking if there'd be a way to identify the player by something else by Rescrobbled. What that would be and what it would require, I don't know. If you instantly know that it's not possible or not worth the effort, then we'll let it be!

InputUsername commented 2 years ago

That's the thing, they're following the same chromiumish approach, so they're all like this:

Right, yeah then I'm afraid there isn't really any way to do this from rescrobbled's side, and I'd recommend figuring out if you can change the name of the player somehow. Sorry!

InputUsername commented 2 years ago

Closing this issue as there's unfortunately not much that can be done to fix this.