rsp4jack / now_playing

OBS Script to display now playing
18 stars 5 forks source link

Display substitute text for non-playing session #9

Closed xMorioh closed 1 week ago

xMorioh commented 2 weeks ago

Hey rsp4jack,

i was looking for a Music Stream grabber just like yours that runs fully locally and doesn't obfuscate it's code in js so thank you for providing your repo, works like a charm :)

I just had one issue with it, when i pause or close my music player then i'd want the data to get erased so that the data isn't displayed or in other words the data property doesn't have the fields populated anymore. Is that a possibility ? I'm currently doing this by adding those 3 Lines below Line 557 in your script:

if data['playback_status'] != 'Playing':
            data['artist'] = ''
            data['title'] = ''

Also is there a way to add an application whitelist to SMTC so not all my applications are being read by the script ?

Thank you in advance :)

rsp4jack commented 2 weeks ago

Glad to know you like this work :smiley_cat: and I will check it out soon later.

rsp4jack commented 1 week ago

Just customize the display expr, like:

'NO MEDIA' if not data else \
'' if data.get('playback_status') != 'Playing' else \
''.join([
    f'{artist} - {title} ',
    *(
        ['\n', f'{fmttd(roundtd(predictedpos()))}/{fmttd(roundtd(end_time))}']
        if posavail() else
        []
    )
])

This will not display anything when not playing.

xMorioh commented 1 week ago

ah that seems pretty simple and works like a charm actually, thank you :)