Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
bpd plugin should return integer times for status command #2394
Beets' bpd plugin should return integer values for the
def time(self): """Returns a tuple containing (position, length) where both values are integers in seconds. If no stream is available, returns (0, 0). """ fmt = Gst.Format(Gst.Format.TIME) try: posq = self.player.query_position(fmt) if not posq: raise QueryError("query_position failed") pos = posq / (10 ** 9) lengthq = self.player.query_duration(fmt) if not lengthq: raise QueryError("query_duration failed") length = lengthq / (10 ** 9) self.cached_time = (pos, length) return (pos, length) # ...
However this file has
It turns out that most clients can cope with this just fine, but at least one crashes since it expects an integer. The mpd protocol does seem to require integers, at least that's what the reference implementation does.