TheQwertiest / foo_discord_rich

foobar2000 component for integration with Discord Rich Presence
https://theqwertiest.github.io/foo_discord_rich/
MIT License
424 stars 43 forks source link

Rich presence only for matching items filtered by query syntax #68

Open redactedscribe opened 2 months ago

redactedscribe commented 2 months ago

Hello and thank you for your great foobar2000 component.

Similarly to foo_listenbrainz2, it would be nice if foo_discord_rich would have a query syntax to filter which songs it will consider as playing and therefore show as a rich presence.

foobar2000_2024-08-16_15-44-28

For example, with a query syntax like %_path% HAS "\music\", only files in my library which contain the \music\ string in their path would be considered as playing.

I tried something similar for the text fields using title formatting syntax but although I can stop the text fields from displaying text if the played item doesn't contain \music\ in its path, it results in blank fields and Discord still showing that I'm listening to something. Expected, but it's not really enough because, other than it looking a bit odd, the main disadvantage is that it doesn't stop a query being sent to MusicBrainz to fetch album art, which results in random album art when the file being played isn't a song, e.g. a podcast (which I store under a non-\music\ path).

If we could have a way to set a query syntax filter to limit what foo_discord_rich considers as a valid item to transmit as playing to Discord and query MuiscBrainz for album art for, that would be neat. This way for any personal files, miscellaneous files, etc that I don't consider music and worth sharing as a rich presence won't be shared. foo_discord_rich would assume foobar2000 is in a stopped state.

Thanks.

TheQwertiest commented 2 months ago

Not yet sure I want this feature, but I'll keep this open in case I change my mind

kam106 commented 2 months ago

This would definitely a better approach to the feature, as you can technically work around the issue very crudely by checking for a file tag then just hiding the real field text instead of displaying what it would, but that method doesn't actually disable rich presence and instead just hides the real text. It would definitely be an easier idea to just not show it entirely with a query syntax rather than just showing something like "Disabled" when playing a song matching a tag.

It would definitely be way cleaner of a solution, even if the implementation would take a bit to think about.