From 0b73a22d9f37ce3c331c9cba2e6d3dfa863e05dd Mon Sep 17 00:00:00 2001 From: pietje666 Date: Fri, 21 Jul 2017 00:42:20 +0200 Subject: [plugin.video.vrt.nu] 0.0.4 (#1331) --- .../resources/lib/vrtplayer/metadatacreator.py | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'plugin.video.vrt.nu/resources/lib/vrtplayer/metadatacreator.py') diff --git a/plugin.video.vrt.nu/resources/lib/vrtplayer/metadatacreator.py b/plugin.video.vrt.nu/resources/lib/vrtplayer/metadatacreator.py index 7a05913..44a3c35 100644 --- a/plugin.video.vrt.nu/resources/lib/vrtplayer/metadatacreator.py +++ b/plugin.video.vrt.nu/resources/lib/vrtplayer/metadatacreator.py @@ -1,8 +1,12 @@ +import time + + class MetadataCreator: def __init__(self): self._duration = None self._plot = None + self._datetime = None @property def duration(self): @@ -20,11 +24,25 @@ class MetadataCreator: def plot(self, value): self._plot = value.strip() + @property + def datetime(self): + return self._datetime + + @datetime.setter + def datetime (self, value): + self._datetime = value + def get_video_dictionary(self): video_dictionary = dict() + if self.plot is not None: video_dictionary["plot"] = self.plot + if self.duration is not None: video_dictionary["duration"] = self.duration - return video_dictionary + if self.datetime is not None: + video_dictionary["date"] = time.strftime("%d.%m.%Y", self.datetime) + video_dictionary["shortdate"] = time.strftime("%d/%m", self.datetime) + + return video_dictionary -- cgit v1.2.3