mirror of
https://github.com/beetbox/beets.git
synced 2025-12-26 10:34:09 +01:00
bpd: provide precision time in status
This commit is contained in:
parent
4be2e1b5e6
commit
28db7d3d33
2 changed files with 8 additions and 6 deletions
|
|
@ -1045,10 +1045,12 @@ class Server(BaseServer):
|
|||
|
||||
(pos, total) = self.player.time()
|
||||
yield (
|
||||
u'time: ' + six.text_type(pos) + u':' + six.text_type(total),
|
||||
# TODO provide elapsed and duration with higher precision
|
||||
u'elapsed: ' + six.text_type(float(pos)),
|
||||
u'duration: ' + six.text_type(float(total)),
|
||||
u'time: {}:{}'.format(
|
||||
six.text_type(int(pos)),
|
||||
six.text_type(int(total)),
|
||||
),
|
||||
u'elapsed: ' + u'{:.3f}'.format(pos),
|
||||
u'duration: ' + u'{:.3f}'.format(total),
|
||||
)
|
||||
|
||||
# Also missing 'updating_db'.
|
||||
|
|
|
|||
|
|
@ -177,12 +177,12 @@ class GstPlayer(object):
|
|||
posq = self.player.query_position(fmt)
|
||||
if not posq[0]:
|
||||
raise QueryError("query_position failed")
|
||||
pos = posq[1] // (10 ** 9)
|
||||
pos = posq[1] / (10 ** 9)
|
||||
|
||||
lengthq = self.player.query_duration(fmt)
|
||||
if not lengthq[0]:
|
||||
raise QueryError("query_duration failed")
|
||||
length = lengthq[1] // (10 ** 9)
|
||||
length = lengthq[1] / (10 ** 9)
|
||||
|
||||
self.cached_time = (pos, length)
|
||||
return (pos, length)
|
||||
|
|
|
|||
Loading…
Reference in a new issue