|
|
|
@ -8,6 +8,7 @@ from typing import (
|
|
|
|
|
Callable,
|
|
|
|
|
Mapping,
|
|
|
|
|
Optional,
|
|
|
|
|
Set,
|
|
|
|
|
TypeVar,
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
@ -130,6 +131,17 @@ class CollectionExtractor(GeneralExtractor[MediaCollection, T]):
|
|
|
|
|
)
|
|
|
|
|
return element
|
|
|
|
|
|
|
|
|
|
def _remove_older_episodes(
|
|
|
|
|
self,
|
|
|
|
|
collection: MediaCollection,
|
|
|
|
|
current_set: Set[MediaElement],
|
|
|
|
|
) -> None:
|
|
|
|
|
all_set = {link.element for link in collection.media_links}
|
|
|
|
|
missing_set = all_set - current_set
|
|
|
|
|
for elem in missing_set:
|
|
|
|
|
if not elem.skip_over:
|
|
|
|
|
elem.delete()
|
|
|
|
|
|
|
|
|
|
def _sort_episodes(self, coll: MediaCollection) -> None:
|
|
|
|
|
sorting_methods: Mapping[int, Callable[[MediaCollectionLink], Any]] = {
|
|
|
|
|
1: lambda l: l.element.release_date,
|
|
|
|
|