now_playing icon indicating copy to clipboard operation
now_playing copied to clipboard

Display substitute text for non-playing session

Open xMorioh opened this issue 1 year ago • 1 comments

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 :)

xMorioh avatar Oct 05 '24 18:10 xMorioh

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

rsp4jack avatar Oct 06 '24 12:10 rsp4jack

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.

rsp4jack avatar Oct 12 '24 15:10 rsp4jack

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

xMorioh avatar Oct 13 '24 08:10 xMorioh