Py3status: Deadbeef module not working anymore

Created on 1 Mar 2018  路  9Comments  路  Source: ultrabug/py3status

Hello,

It seems the deadbeef module stopped working with the latest changes regarding the FMT_SEPARATOR.

Using Deadbeef 0.7.2, status returns an empty string but if we change back the FMT_SEPARATOR to its old value from an earlier module version it's working again.

FMT_SEPARATOR = u'\u001e'

The record separator character seems to cause this issue, as soon as I revert it to:

FMT_SEPARATOR = u'楼'

The module is working again.

I remember that using the original character was an issue for some users, maybe choosing another unicode character such as FMT_SEPARATOR = u'\u1ac0' would be the proper way to fix this.

Thank you.

bug

All 9 comments

We could use (PY3) because I assume some titles (song/radio streaming) can contain . I don't remember which player... Either deadbeef and/or other players will use filename as title if it can't parse title so videos/songs from YouTube (and/or others) can have too.

I can't test deadbeef right now to confirm this. Feel free to make a PR with whatever you want.

I think the issue is here https://github.com/ultrabug/py3status/blob/master/py3status/modules/deadbeef.py#L119 looks like it should be

if out not in ['nothing', FMT_SEPARATOR]:

@mrt-prodz does that fix things?

@tobes , that's it. Works fine when specifying the variable FMT_SEPARATOR instead of the character.

>>> u'\u001e' == u'\x1e'
True
>>> u'\u001e' in [u'\x1e']
True
>>> u'\u001e' in [u'\u001e']
True 
>>> u'\x1e' in [u'\u001e']
True

Why did FMT_SEPARATOR work and not \x1e? Could it be a sleep_timeout-related issue? Slightly different topic: Does this work okay with py3status --gevent too? (Py2 + Py3)

fixed by #1296

@tobes , I'm terribly sorry to come back on this issue but as @lasers mentioned as well I wasn't understanding why just replacing if out not in ['nothing', FMT_SEPARATOR]: was solving the issue on my end.

Programming wise, it is indeed better to use the FMT_SEPARATOR variable instead of the hard coded value but I really couldn't understand why it would change anything.

So today the deadbeef module started causing issues again and I had another look at the output from the deadbeef binary by printing out, any character outside standard ASCII values was being replaced by _ in the output for some reason resulting in an empty output since the separator was not present.

Now I'm not saying this is the fix we should implement but it works fine on my end by doing the following:
https://github.com/ultrabug/py3status/blob/master/py3status/modules/deadbeef.py#L47
FMT_SEPARATOR = '\255'

and removing .decode('utf-8') from the check_output command:
https://github.com/ultrabug/py3status/blob/master/py3status/modules/deadbeef.py#L114
out = check_output(self.cmd, shell=True)

I tested various foreign songs (Greek titles) and I couldn't see any issue with this.

Any thoughts about this ?

@ultrabug Open this? @mrt-prodz Did you try the 0xDEADBEEF branch?

@lasers , I just replaced the deadbeef.py module using yours on branch 0xDEADBEEF and it works properly.

Was this page helpful?
0 / 5 - 0 ratings