keifufu / WebNowPlaying

WebNowPlaying browser extension. Provides support for browser-based players
MIT License
85 stars 10 forks source link

[Feature Request] expose "Supported features" to adapters #12

Closed reisir closed 1 year ago

reisir commented 1 year ago

A way to get the supported features of the current website. For example a way to see if the currently playing site supports ratings, so you can only show the like / dislike / favourite buttons when the user is using a site that supports them.

I only use the Rainmeter adapter so my examples are Rainmeter.

[MeasureSupportsRating]
Measure=Plugin
Plugin=WebNowPlaying
PlayerType=SupportsRatings
; Measure values would be 0 or 1 (maybe -1 or 2 for the favourite or "like only" systems that soundcloud and others use), numbers so it's easy to use them without substituting

I'd imagine other adapters could just parse a string of supported features but that's hard to do in Rainmeter. Doable but harder than just getting the value.

[MeasureSupportsRating]
Measure=Plugin
Plugin=WebNowPlaying
PlayerType=SupportedFeatures
RegexSubstitute=1
Substitute=.*ratings=(\d).*:"\1"
; Unsubstituted measure value would be something like "progress=1;ratings=1;art=0" idk you're the wnp devs
keifufu commented 1 year ago

Added in v2.0.0