-
Notifications
You must be signed in to change notification settings - Fork 0
/
GoogleAlbumMedia.py
48 lines (38 loc) · 999 Bytes
/
GoogleAlbumMedia.py
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
#!/usr/bin/env python3
# coding: utf8
from .BaseMedia import BaseMedia
class GoogleAlbumMedia(BaseMedia):
def __init__(self, media_json):
self.__media_json = media_json
super(GoogleAlbumMedia, self).__init__()
# ----- override Properties below -----
@property
def size(self):
try:
return int(self.__media_json["mediaItemsCount"])
except KeyError:
return 0
@property
def id(self):
return self.__media_json["id"]
@property
def description(self):
return self.orig_name
@property
def orig_name(self) -> str:
try:
return self.__media_json["title"]
except KeyError:
return "none"
@property
def create_date(self):
return None
@property
def modify_date(self):
return None
@property
def mime_type(self):
return "none"
@property
def url(self):
return self.__media_json["productUrl"]