diff options
author | lassulus <git@lassul.us> | 2023-06-19 03:25:39 +0200 |
---|---|---|
committer | lassulus <git@lassul.us> | 2023-06-19 03:25:39 +0200 |
commit | 139799c53cdaf55c362109e01be9dd96cc8700ed (patch) | |
tree | b1ce719ec8f62458bce2d9fe2191b8d004630f2a /makefu/2configs/home/ham/lib/default.nix | |
parent | cb8fbb09127392a17d698d91f78ede7ae46accb8 (diff) | |
parent | a766e88e7c8d87aa6bdbde796d3a454f7b5e546e (diff) |
Merge remote-tracking branch 'gum/master'
Diffstat (limited to 'makefu/2configs/home/ham/lib/default.nix')
-rw-r--r-- | makefu/2configs/home/ham/lib/default.nix | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/makefu/2configs/home/ham/lib/default.nix b/makefu/2configs/home/ham/lib/default.nix index cf1c32ab..0d89d1e9 100644 --- a/makefu/2configs/home/ham/lib/default.nix +++ b/makefu/2configs/home/ham/lib/default.nix @@ -27,12 +27,11 @@ in #} { delay.seconds = 1; } { delay = '' - {% set duration = state_attr("${entity}","media_duration") %} - {% set seconds = duration % 60 %} + {% set duration = state_attr("${entity}","media_duration") or 0 %} + {% set seconds = (duration % 60 ) %} {% set minutes = (duration / 60)|int % 60 %} {% set hours = (duration / 3600)|int %} {{ "%02i:%02i:%02i"|format(hours, minutes, seconds)}} - ''; } { |