-
Notifications
You must be signed in to change notification settings - Fork 0
/
match.py
29 lines (26 loc) · 986 Bytes
/
match.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
class Match:
def __init__(self, slug, timestamp) -> None:
self.slug = slug # Unique match identifier within match_key
self.timestamp = timestamp # Timestamp of the start of the match from twitch vod
pass
def __str__(self):
if self.slug[:2] == "qm":
return "Qualification " + self.slug[2:]
# Quarterfinal
elif self.slug[:2] == "qf":
return "Quarterfinal " + self.slug[2] + " Match " + self.slug[-1:]
# Semifinal
elif self.slug[:2] == "sf":
return "Semifinal " + self.slug[2] + " Match " + self.slug[-1:]
# Final
elif self.slug[0] == "f":
return "Final " + self.slug[1] + " Match " + self.slug[-1:]
return None
def getName(slug):
match = Match(slug, "")
return match.__str__()
class Playlist:
def __init__(self, matches, video_id) -> None:
self.matches = matches
self.video_id = video_id
pass