-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
33 changed files
with
3,347 additions
and
1,153 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,128 @@ | ||
# Byte-compiled / optimized / DLL files | ||
__pycache__/ | ||
*.py[cod] | ||
*$py.class | ||
|
||
# Folder | ||
bin | ||
lib64 | ||
*__pycache__ | ||
pyvenv.cfg | ||
.idea | ||
|
||
# Project specific | ||
videos/ | ||
tmp/ | ||
debug.log | ||
run.exe | ||
# C extensions | ||
*.so | ||
|
||
# Distribution / packaging | ||
.Python | ||
build/ | ||
develop-eggs/ | ||
dist/ | ||
downloads/ | ||
eggs/ | ||
.eggs/ | ||
lib/ | ||
lib64/ | ||
parts/ | ||
sdist/ | ||
var/ | ||
wheels/ | ||
share/python-wheels/ | ||
*.egg-info/ | ||
.installed.cfg | ||
*.egg | ||
MANIFEST | ||
|
||
# PyInstaller | ||
*.manifest | ||
*.spec | ||
|
||
# Installer logs | ||
pip-log.txt | ||
pip-delete-this-directory.txt | ||
|
||
# Unit test / coverage reports | ||
htmlcov/ | ||
.tox/ | ||
.nox/ | ||
.coverage | ||
.coverage.* | ||
.cache | ||
nosetests.xml | ||
coverage.xml | ||
*.cover | ||
*.py,cover | ||
.hypothesis/ | ||
.pytest_cache/ | ||
cover/ | ||
|
||
# Translations | ||
*.mo | ||
*.pot | ||
|
||
# Django stuff: | ||
*.log | ||
local_settings.py | ||
db.sqlite3 | ||
db.sqlite3-journal | ||
|
||
# Flask stuff: | ||
instance/ | ||
.webassets-cache | ||
|
||
# Scrapy stuff: | ||
.scrapy | ||
|
||
# Sphinx documentation | ||
docs/_build/ | ||
|
||
# PyBuilder | ||
.pybuilder/ | ||
target/ | ||
|
||
# Jupyter Notebook | ||
.ipynb_checkpoints | ||
|
||
# IPython | ||
profile_default/ | ||
ipython_config.py | ||
.pdm.toml | ||
|
||
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm | ||
__pypackages__/ | ||
|
||
# Celery stuff | ||
celerybeat-schedule | ||
celerybeat.pid | ||
|
||
# SageMath parsed files | ||
*.sage.py | ||
|
||
# Environments | ||
.env | ||
.venv | ||
env/ | ||
venv/ | ||
ENV/ | ||
env.bak/ | ||
venv.bak/ | ||
|
||
# Spyder project settings | ||
.spyderproject | ||
.spyproject | ||
|
||
# Rope project settings | ||
.ropeproject | ||
|
||
# mkdocs documentation | ||
/site | ||
|
||
# mypy | ||
.mypy_cache/ | ||
.dmypy.json | ||
dmypy.json | ||
|
||
# Pyre type checker | ||
.pyre/ | ||
|
||
# pytype static type analyzer | ||
.pytype/ | ||
|
||
# Cython debug symbols | ||
cython_debug/ | ||
|
||
# Other | ||
Video |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
# 03.03.24 | ||
|
||
from typing import Dict, Any, List | ||
|
||
class Episode: | ||
def __init__(self, data: Dict[str, Any]): | ||
""" | ||
Initialize an Episode object. | ||
Args: | ||
data (Dict[str, Any]): A dictionary containing data for the episode. | ||
""" | ||
self.id: int = data.get('id', '') | ||
self.number: int = data.get('number', '') | ||
self.name: str = data.get('name', '') | ||
self.plot: str = data.get('plot', '') | ||
self.duration: int = data.get('duration', '') | ||
self.scws_id: int = data.get('scws_id', '') | ||
self.season_id: int = data.get('season_id', '') | ||
self.created_by: str = data.get('created_by', '') | ||
self.created_at: str = data.get('created_at', '') | ||
self.updated_at: str = data.get('updated_at', '') | ||
|
||
class EpisodeManager: | ||
def __init__(self): | ||
""" | ||
Initialize an EpisodeManager object. | ||
""" | ||
self.episodes: List[Episode] = [] | ||
|
||
def add_episode(self, episode_data: Dict[str, Any]): | ||
""" | ||
Add a new episode to the manager. | ||
Args: | ||
episode_data (Dict[str, Any]): A dictionary containing data for the new episode. | ||
""" | ||
episode = Episode(episode_data) | ||
self.episodes.append(episode) | ||
|
||
def get_episode_by_index(self, index: int) -> Episode: | ||
""" | ||
Get an episode by its index. | ||
Args: | ||
index (int): Index of the episode to retrieve. | ||
Returns: | ||
Episode: The episode object. | ||
""" | ||
return self.episodes[index] | ||
|
||
def get_length(self) -> int: | ||
""" | ||
Get the number of episodes in the manager. | ||
Returns: | ||
int: Number of episodes. | ||
""" | ||
return len(self.episodes) |
Oops, something went wrong.