dsdude123 / GroovyRP

Groove Music rich presence for Discord
MIT License
35 stars 5 forks source link

All media is being shown, Groove Music only displays when tabbed in. #28

Open Kasey-py opened 2 years ago

Kasey-py commented 2 years ago

When it launches with Groove Music it seems to be set to display any media file being played, as when I tabbed out it showed what i last played on Youtube instead. (Screenshot was taken quickly, it would switch back to And Ever when tabbing into Groove.) https://cdn.discordapp.com/attachments/877967862113923072/908546540841349150/unknown.png

dsdude123 commented 1 year ago

Unfortunately, this is due to how the Windows API works. There is no way to differentiate between applications of what is playing. Only real way to resolve this is to go back to the old method of inspecting file handles and reading metadata from the media tracks themselves (GroovyRP used to do this pre version 1.0 but it required administrative rights).

No plans to fix this at this time.

jojo2357 commented 1 year ago

If you filter out the media with a null album, you can reduce the chances of this

dsdude123 commented 1 year ago

@jojo2357 What about media that is partially missing metadata (i.e. has only title and artist)? Wouldn't that exclude those too?

jojo2357 commented 1 year ago

As I recall, those came in as empty strings, non null

jojo2357 commented 1 year ago

Or, you could do what I did and accept the first one, then search for a "better" media that has an album, and then accept that only if the first one was null.

See here: https://github.com/jojo2357/Music-Discord-Rich-Presence/blob/f2f224106ca4a74dd5c0b285dbc84f910273d5c7/MDRP/util/Functions.cs#L106-L148

dsdude123 commented 1 year ago

I'll look into it further at some point. Thanks.