/
/
/
1"""Manage MediaItems of type Genre - Stub Implementation."""
2
3from __future__ import annotations
4
5from typing import TYPE_CHECKING
6
7from music_assistant_models.enums import MediaType
8from music_assistant_models.media_items import Genre, Track
9
10from .base import MediaControllerBase
11
12# NOTE: Genre support is not yet fully implemented.
13# This is a stub controller to prevent errors when Genre MediaType is encountered.
14
15if TYPE_CHECKING:
16 from music_assistant import MusicAssistant
17
18
19class GenreController(MediaControllerBase[Genre]):
20 """Stub controller for Genre MediaType - not yet fully implemented."""
21
22 db_table = "genres" # Not actually used yet
23 media_type = MediaType.GENRE
24 item_cls = Genre
25
26 def __init__(self, mass: MusicAssistant) -> None:
27 """Initialize class."""
28 super().__init__(mass)
29
30 async def _add_library_item(self, item: Genre, overwrite_existing: bool = False) -> int:
31 """Add a new item record to the database - stub implementation."""
32 raise NotImplementedError("Genre support is not yet implemented")
33
34 async def _update_library_item(
35 self, item_id: str | int, update: Genre, overwrite: bool = False
36 ) -> None:
37 """Update existing record in the database - stub implementation."""
38 raise NotImplementedError("Genre support is not yet implemented")
39
40 async def search(
41 self,
42 query: str,
43 provider_instance_id_or_domain: str | None = None,
44 limit: int = 25,
45 ) -> list[Genre]:
46 """Search for genres - stub implementation."""
47 return []
48
49 async def radio_mode_base_tracks(
50 self,
51 item: Genre,
52 preferred_provider_instances: list[str] | None = None,
53 ) -> list[Track]:
54 """
55 Get the list of base tracks from the controller - stub implementation.
56
57 :param item: The Genre to get base tracks for.
58 :param preferred_provider_instances: List of preferred provider instance IDs to use.
59 """
60 raise NotImplementedError("Genre support is not yet implemented")
61
62 async def match_providers(self, db_item: Genre) -> None:
63 """Try to find match on all providers - stub implementation."""
64 raise NotImplementedError("Genre support is not yet implemented")
65