This commit is contained in:
Hellow2
2023-05-23 13:59:24 +02:00
parent da0fa2c8dc
commit ab7f414125
9 changed files with 94 additions and 26 deletions

View File

@@ -1,4 +1,5 @@
from ..utils.enums import album
from .option import Options
from . import (
song,
metadata,
@@ -28,5 +29,4 @@ Album = song.Album
FormattedText = formatted_text.FormattedText
Options = option.Options
Collection = collection.Collection

View File

@@ -1,4 +1,4 @@
from typing import TYPE_CHECKING, List
from typing import TYPE_CHECKING, List, Iterable
if TYPE_CHECKING:
from .parents import DatabaseObject
@@ -14,6 +14,13 @@ class Options:
def __iter__(self):
for database_object in self._data:
yield database_object
def append(self, element: 'DatabaseObject'):
self._data.append(element)
def extend(self, iterable: Iterable['DatabaseObject']):
for element in iterable:
self.append(element)
def get_next_options(self, index: int) -> 'Options':
if index >= len(self._data):