playerctl
playerctl copied to clipboard
`mpris:length` returns an `s` when i think it should return whatever `x` is
The player I am using is [io].
playerctl metadata --format "Total length: {{ duration(mpris:length) }}"
This command (mentioned in the readme) returns an error on my machine Specifically, this one :-
Could not execute command: function duration can only be called on track position values
i'm using it to rice my waybar to make a player widget from scratch
Looks like this was mostly-fixed? With playerctl v2.4.1, I'm getting correct responses for mpris:length:
$ playerctl metadata
vlc mpris:trackid '/org/videolan/vlc/playlist/4'
vlc xesam:url xxREDACTEDxx
vlc vlc:time 670
vlc mpris:length 670112000
vlc vlc:length 670112
vlc vlc:publisher 5
$ playerctl metadata --format '{{ duration(mpris:length) }}'
11:10
$ playerctl metadata --format '{{ duration(position) }}'
4:47
It is still a bit odd, though. The man page claims duration() only works for position and mpris:length. However, I can call it on vlc:length as well... it just gets the value wrong, due to the different scaling:
$ playerctl metadata --format '{{ duration(vlc:length) }}'
0:00