Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bitrate field #13

Open
podly opened this issue Sep 3, 2014 · 0 comments
Open

bitrate field #13

podly opened this issue Sep 3, 2014 · 0 comments

Comments

@podly
Copy link

podly commented Sep 3, 2014

{bitrate} filed show nice value, but only for three digits bitrates like 128k. If you try to see bitrate of high density flac with bitrate over 1000kbps you will see only last 3 digits. Easy to correct in display_fields.py

@register_field
class BitRateField(Field):
    base_name = 'bitrate'
    target_hooks = ['status']

    def _format_bitrate(self, bitrate=0):
        bitrate = int(bitrate)
        return '%4d' % bitrate

    def __init__(self, **kwargs):
        width = len(self._format_bitrate())
        super(BitRateField, self).__init__(width=width, **kwargs)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant