summaryrefslogtreecommitdiff
path: root/plugin.video.vrt.nu/resources/lib/vrtplayer/metadatacreator.py
blob: 44a3c358ab2bc14b7e27f827c0e0376d8a2fe85a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
import time


class MetadataCreator:

    def __init__(self):
        self._duration = None
        self._plot = None
        self._datetime = None

    @property
    def duration(self):
        return self._duration

    @duration.setter
    def duration(self, value):
        self._duration = value

    @property
    def plot(self):
        return self._plot

    @plot.setter
    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

        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