- Added comprehensive documentation for the ViewIt Plugin System, detailing the plugin loading process, required methods, optional features, and community extension workflow. - Updated project notes to reflect the current structure, build process, search logic, and known issues. - Introduced new build scripts for installing the add-on and creating ZIP packages. - Added test scripts for TMDB API integration, including argument parsing and logging functionality. - Enhanced existing plugins with improved search logic and error handling.
56 lines
1.7 KiB
Python
56 lines
1.7 KiB
Python
#!/usr/bin/env python3
|
|
"""Gemeinsame Schnittstelle fuer Kodi-Plugins."""
|
|
|
|
from __future__ import annotations
|
|
|
|
from abc import ABC, abstractmethod
|
|
from typing import List, Optional, Set
|
|
|
|
|
|
class BasisPlugin(ABC):
|
|
"""Abstrakte Basisklasse fuer alle Integrationen."""
|
|
|
|
name: str
|
|
|
|
@abstractmethod
|
|
async def search_titles(self, query: str) -> List[str]:
|
|
"""Liefert eine Liste aller Treffer fuer die Suche."""
|
|
|
|
@abstractmethod
|
|
def seasons_for(self, title: str) -> List[str]:
|
|
"""Liefert alle Staffeln zu einem Titel."""
|
|
|
|
@abstractmethod
|
|
def episodes_for(self, title: str, season: str) -> List[str]:
|
|
"""Liefert alle Folgen zu einer Staffel."""
|
|
|
|
def stream_link_for(self, title: str, season: str, episode: str) -> Optional[str]:
|
|
"""Optional: Liefert den Stream-Link fuer eine konkrete Folge."""
|
|
return None
|
|
|
|
def resolve_stream_link(self, link: str) -> Optional[str]:
|
|
"""Optional: Folgt einem Stream-Link und liefert die finale URL."""
|
|
return None
|
|
|
|
def genres(self) -> List[str]:
|
|
"""Optional: Liefert eine Liste an Genres (falls verfügbar)."""
|
|
return []
|
|
|
|
def titles_for_genre(self, genre: str) -> List[str]:
|
|
"""Optional: Liefert alle Serientitel zu einem Genre."""
|
|
return []
|
|
|
|
def capabilities(self) -> Set[str]:
|
|
"""Optional: Liefert eine Menge an Features/Capabilities dieses Plugins.
|
|
|
|
Beispiele:
|
|
- `popular_series`: Plugin kann eine Liste beliebter Serien liefern.
|
|
"""
|
|
|
|
return set()
|
|
|
|
def popular_series(self) -> List[str]:
|
|
"""Optional: Liefert eine Liste beliebter Serien (als Titel-Strings)."""
|
|
|
|
return []
|