-
Notifications
You must be signed in to change notification settings - Fork 8
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
Total duration instead of system time #52
Comments
This is not currently configurable, though it would be trivial to modify your local copy of replace system clock time with file durationdiff --git a/progressbar.lua b/progressbar.lua
index 2792376..83633ce 100644
--- a/progressbar.lua
+++ b/progressbar.lua
@@ -2304,11 +2304,11 @@ do
end,
redraw = function(self)
if self.active then
- local systemTime = os.time()
- if systemTime ~= self.lastTime then
+ local duration = math.floor(mp.get_property_number('duration', 0))
+ if duration ~= self.lastTime then
local update = true
- self.line[4] = os.date(timeFormat, systemTime)
- self.lastTime = systemTime
+ self.line[4] = ('%d:%02d:%02d'):format(math.floor(duration / 3600), math.floor((duration / 60) % 60), math.floor(duration % 60))
+ self.lastTime = duration
self.needsUpdate = true
end
end replace time remaining with file durationdiff --git a/progressbar.lua b/progressbar.lua
index 2792376..220763a 100644
--- a/progressbar.lua
+++ b/progressbar.lua
@@ -1905,7 +1905,7 @@ do
redraw = function(self)
if self.active then
_class_0.__parent.__base.redraw(self)
- local timeRemaining = math.floor(mp.get_property_number('playtime-remaining', 0))
+ local timeRemaining = math.floor(mp.get_property_number('duration', 0))
if timeRemaining ~= self.lastTime then
local update = true
self.line[4] = ('–%d:%02d:%02d'):format(math.floor(timeRemaining / 3600), math.floor((timeRemaining / 60) % 60), math.floor(timeRemaining % 60)) I have some bigger plans long term to improve configurability in this regard, but I've been quite busy recently and I'm not sure when I'll have time to really dig into that. |
Thank you very very much! It |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
How to display total duration instead of system time?
(Or replace the remaining time with the total time)
The text was updated successfully, but these errors were encountered: