Song now represents if it has any problems

This commit is contained in:
Rafael Vargas 2021-12-30 20:35:54 -04:00
parent 17e265c8da
commit e13f19efb9

View File

@ -11,6 +11,7 @@ class Song(ISong):
"""Create a song with only the URL to the youtube song""" """Create a song with only the URL to the youtube song"""
self.__identifier = identifier self.__identifier = identifier
self.__info = {} self.__info = {}
self.__problematic = False
self.__playlist: IPlaylist = playlist self.__playlist: IPlaylist = playlist
def finish_down(self, info: dict) -> None: def finish_down(self, info: dict) -> None:
@ -55,10 +56,14 @@ class Song(ISong):
def identifier(self) -> str: def identifier(self) -> str:
return self.__identifier return self.__identifier
@property
def problematic(self) -> bool:
return self.__problematic
def destroy(self) -> None: def destroy(self) -> None:
"""Destroy the song from the playlist due to any type of error""" """Mark this song with problems and removed from the playlist due to any type of error"""
self.__problematic = True
self.__playlist.destroy_song(self) self.__playlist.destroy_song(self)
del self
def embed(self, title: str) -> Embed: def embed(self, title: str) -> Embed:
"""Configure the embed to show the song information""" """Configure the embed to show the song information"""