-
Notifications
You must be signed in to change notification settings - Fork 3
/
content.py
146 lines (136 loc) · 4.55 KB
/
content.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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
import utils
class Content: # TODO try and consolidate into one single content class!!!
# TODO add program_ID to __init__
def __init__(self,
content_name,
episode_title,
content_type,
content_description,
content_rating,
genres,
language,
channel_name,
channel_number,
tribune_ID,
time_string,
cast,
qualifiers):
self.name = content_name
self.type = content_type
self.episode_title = episode_title
self.description = content_description
self.rating = content_rating
self.genres = genres
self.language = language
self.channel = [channel_name, channel_number]
self.channel_name = channel_name
self.channel_number = channel_number
self.tribune_ID = tribune_ID
datetime_obj = utils.parseSearchTime(time_string)
self.duration = datetime_obj[1]
self.start = utils.adjustTimeFromGMT(datetime_obj[0]) # TODO should be datetime object
self.end = utils.addSeconds(self.start, int(self.duration)) # TODO should be datetime object
self.cast = cast
self.qualifiers = qualifiers
class VideoOnDemand:
def __init__(self,
args):
# do stuff here
pass
class RecordedContent:
def __init__(self,
title,
description,
genres,
end_time,
tv_rating,
sub_rating,
mpaa_rating,
critic_rating,
release_date,
callsign,
channel_number,
start_time,
tribune_id,
episode_title,
episode_number,
season_number,
qualifiers,
cast):
pass
class ScheduledContent:
def __init__(self,
title,
description,
genres,
end_time,
tv_rating,
sub_rating,
MPAA_rating,
critic_rating,
release_date,
callsign,
channel_number,
start_time,
tribune_ID,
episode_title,
episode_number,
season_number,
qualifiers,
cast):
self.title = title
self.description = description
self.genres = genres.split(",")
self.end_time = utils.genDatetimeObjFromScheduled(end_time)
self.ratings = {}
self.ratings["TV"] = tv_rating
self.ratings["Sub"] = sub_rating
self.ratings["MPAA"] = MPAA_rating
self.ratings["Critic"] = critic_rating
self.release_date = utils.genDatetimeObjFromReleaseDate(release_date)
self.callsign = callsign
self.channel_number = channel_number
self.start_time = utils.genDatetimeObjFromScheduled(start_time)
self.tribune_ID = tribune_ID
self.episode_title = episode_title
self.episode_number = episode_number
self.season_number = season_number
self.qualifiers = qualifiers
if cast:
self.cast = cast.split(",")
else:
self.cast = cast
class BestBet:
def __init__(self,
positive_content,
program_title,
program_id,
program_service_id,
program_service_name,
event_id,
air_date_time,
duration,
language,
channel_number,
program_type,
tv_rating,
mpaa_rating,
callsign,
media_caption=None):
self.positive_content = positive_content
self.title = program_title
self.program_ID = program_id
self.provider_ID = program_service_id
self.provider_name = program_service_name
self.event_ID = event_id
self.air_date_time = air_date_time
self.duration = duration
self.end = False
self.language = language
self.channel_number = channel_number
self.type = program_type
self.ratings = {}
self.ratings["TV"] = tv_rating
self.ratings["MPAA"] = mpaa_rating
self.callsign = callsign
self.media_caption = media_caption