summaryrefslogtreecommitdiff
path: root/plugin.video.vrt.nu/resources/lib/vrtplayer/metadatacreator.py
diff options
context:
space:
mode:
authorpietje666 <martijn.moreel@gmail.com>2017-07-21 00:42:20 +0200
committerenen92 <enen92@users.noreply.github.com>2017-07-20 23:42:20 +0100
commit0b73a22d9f37ce3c331c9cba2e6d3dfa863e05dd (patch)
tree622a589dccd9cb58ca181005bad88ebcdf3c0c2b /plugin.video.vrt.nu/resources/lib/vrtplayer/metadatacreator.py
parentee5d9eb6634db117d8d5c05ff86737299fcc3383 (diff)
[plugin.video.vrt.nu] 0.0.4 (#1331)
Diffstat (limited to 'plugin.video.vrt.nu/resources/lib/vrtplayer/metadatacreator.py')
-rw-r--r--plugin.video.vrt.nu/resources/lib/vrtplayer/metadatacreator.py20
1 files changed, 19 insertions, 1 deletions
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