From bacf25487dfac171ac43855c62d3510687ea7966 Mon Sep 17 00:00:00 2001 From: maria-amey <88752001+maria-amey@users.noreply.github.com> Date: Fri, 13 Aug 2021 01:54:49 +0100 Subject: [PATCH] Update video_playlist.py --- python/src/video_playlist.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/python/src/video_playlist.py b/python/src/video_playlist.py index 5836da4a..dfb79609 100644 --- a/python/src/video_playlist.py +++ b/python/src/video_playlist.py @@ -3,3 +3,24 @@ class Playlist: """A class used to represent a Playlist.""" + + def __init__(self, name): + self._name = name + self._videos = deque([]) + + def get_name(self): + """Returns the name of playlist.""" + return self._name + + def get_all_videos(self): + """Returns all the videos.""" + return self._videos + + def add_video(self, video_id): + self._videos.append(video_id) + + def remove_video(self, video_id): + self._videos.remove(video_id) + + def clear_videos(self): + self._videos.clear()