--- /dev/null
+"""Manage MediaItems of type Genre - Stub Implementation."""
+
+from __future__ import annotations
+
+from typing import TYPE_CHECKING
+
+from music_assistant_models.enums import MediaType
+from music_assistant_models.media_items import Genre, Track
+
+from .base import MediaControllerBase
+
+# NOTE: Genre support is not yet fully implemented.
+# This is a stub controller to prevent errors when Genre MediaType is encountered.
+
+if TYPE_CHECKING:
+ from music_assistant import MusicAssistant
+
+
+class GenreController(MediaControllerBase[Genre]):
+ """Stub controller for Genre MediaType - not yet fully implemented."""
+
+ db_table = "genres" # Not actually used yet
+ media_type = MediaType.GENRE
+ item_cls = Genre
+
+ def __init__(self, mass: MusicAssistant) -> None:
+ """Initialize class."""
+ super().__init__(mass)
+
+ async def _add_library_item(self, item: Genre, overwrite_existing: bool = False) -> int:
+ """Add a new item record to the database - stub implementation."""
+ raise NotImplementedError("Genre support is not yet implemented")
+
+ async def _update_library_item(
+ self, item_id: str | int, update: Genre, overwrite: bool = False
+ ) -> None:
+ """Update existing record in the database - stub implementation."""
+ raise NotImplementedError("Genre support is not yet implemented")
+
+ async def search(
+ self,
+ query: str,
+ provider_instance_id_or_domain: str | None = None,
+ limit: int = 25,
+ ) -> list[Genre]:
+ """Search for genres - stub implementation."""
+ return []
+
+ async def radio_mode_base_tracks(
+ self,
+ item_id: str,
+ provider_instance_id_or_domain: str,
+ limit: int = 25,
+ ) -> list[Track]:
+ """Get the list of base tracks from the controller - stub implementation."""
+ raise NotImplementedError("Genre support is not yet implemented")
+
+ async def match_providers(self, db_item: Genre) -> None:
+ """Try to find match on all providers - stub implementation."""
+ raise NotImplementedError("Genre support is not yet implemented")
from .media.albums import AlbumsController
from .media.artists import ArtistsController
from .media.audiobooks import AudiobooksController
+from .media.genres import GenreController
from .media.playlists import PlaylistController
from .media.podcasts import PodcastsController
from .media.radio import RadioController
self.playlists = PlaylistController(self.mass)
self.audiobooks = AudiobooksController(self.mass)
self.podcasts = PodcastsController(self.mass)
+ self.genres = GenreController(self.mass)
self.in_progress_syncs: list[SyncTask] = []
self._database: DatabaseConnection | None = None
self._sync_lock = asyncio.Lock()
| PlaylistController
| AudiobooksController
| PodcastsController
+ | GenreController
):
"""Return controller for MediaType."""
if media_type == MediaType.ARTIST:
return self.podcasts
if media_type == MediaType.PODCAST_EPISODE:
return self.podcasts
+ if media_type == MediaType.GENRE:
+ return self.genres
raise NotImplementedError
def get_unique_providers(self) -> set[str]: