X-Git-Url: https://git.cweiske.de/enigma2.git/blobdiff_plain/56ac7a4a764a4251a851778df09967405aa9a930..adad9e85aa49169991a7edffbbc01479e8761a82:/lib/python/Components/Converter/RemainingToText.py diff --git a/lib/python/Components/Converter/RemainingToText.py b/lib/python/Components/Converter/RemainingToText.py index 4249e30a..66897579 100644 --- a/lib/python/Components/Converter/RemainingToText.py +++ b/lib/python/Components/Converter/RemainingToText.py @@ -5,6 +5,7 @@ class RemainingToText(Converter, object): DEFAULT = 0 WITH_SECONDS = 1 NO_SECONDS = 2 + IN_SECONDS = 3 def __init__(self, type): Converter.__init__(self, type) @@ -12,6 +13,8 @@ class RemainingToText(Converter, object): self.type = self.WITH_SECONDS elif type == "NoSeconds": self.type = self.NO_SECONDS + elif type == "InSeconds": + self.type = self.IN_SECONDS else: self.type = self.DEFAULT @@ -33,6 +36,11 @@ class RemainingToText(Converter, object): return "+%d:%02d" % (remaining / 3600, (remaining / 60) - ((remaining / 3600) * 60)) else: return "%02d:%02d" % (duration / 3600, (duration / 60) - ((duration / 3600) * 60)) + elif self.type == self.IN_SECONDS: + if remaining is not None: + return str(remaining) + else: + return str(duration) elif self.type == self.DEFAULT: if remaining is not None: return "+%d min" % (remaining / 60)