vcinema/vcinema_utils/VCinemaFilm.py

38 lines
950 B
Python
Raw Normal View History

2022-12-23 16:36:49 +00:00
from vcinema_utils.VCinemaUtils import *
2022-12-18 17:15:47 +00:00
from vcinema_utils.Viewing import Viewing
class VCinemaFilm:
2022-12-19 22:26:38 +00:00
def __init__(self, title, imdb_id):
self._title = title
self._imdb_id = imdb_id
self._viewings = []
self._imdb_data = {}
2022-12-18 17:15:47 +00:00
def add_viewing(self, date, season, rating):
viewing = Viewing(date, season, rating)
2022-12-19 22:26:38 +00:00
self._viewings.append(viewing)
def add_imdb_data(self, field, value):
self._imdb_data[field] = value
def get_imdb_data(self, field):
if field in self._imdb_data:
return self._imdb_data[field]
else:
return None
def get_imdb_url(self):
return "https://www.imdb.com/title/tt{}/".format(self._imdb_id)
def get_imdb_link(self):
2022-12-23 16:36:49 +00:00
return generate_markdown_link(self._title, self.get_imdb_url())
2022-12-19 22:26:38 +00:00
def get_title(self):
return self._title
def get_imdb_id(self):
return self._imdb_id