Skip to content

Commit

Permalink
Cleanup some leftover code
Browse files Browse the repository at this point in the history
  • Loading branch information
marcelveldt committed Jan 13, 2025
1 parent a9e7d40 commit 3749351
Showing 1 changed file with 0 additions and 23 deletions.
23 changes: 0 additions & 23 deletions music_assistant/controllers/players.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@
from music_assistant.helpers.api import api_command
from music_assistant.helpers.tags import async_parse_tags
from music_assistant.helpers.throttle_retry import Throttler
from music_assistant.helpers.uri import parse_uri
from music_assistant.helpers.util import TaskManager, get_changed_values
from music_assistant.models.core_controller import CoreController
from music_assistant.models.player_provider import PlayerProvider
Expand Down Expand Up @@ -638,10 +637,6 @@ async def select_source(self, player_id: str, source: str) -> None:
- source: The ID of the source that needs to be activated/selected.
"""
player = self.get(player_id, True)
# handle source_id from source plugin
if "://plugin_source/" in source:
await self._play_plugin_source(player, source)
return
# basic check if player supports source selection
if PlayerFeature.SELECT_SOURCE not in player.supported_features:
raise UnsupportedFeaturedException(
Expand Down Expand Up @@ -1355,24 +1350,6 @@ async def _play_announcement(
self.logger.warning("Can not resume %s on %s", prev_item_id, player.display_name)
# TODO !!

async def _play_plugin_source(self, player: Player, source: str) -> None:
"""Handle playback of a plugin source on the player."""
_, provider_id, source_id = await parse_uri(source)
if not (provider := self.mass.get_provider(provider_id)):
raise PlayerCommandFailed(f"Invalid (plugin)source {source}")
player_source = await provider.get_source(source_id)
url = self.mass.streams.get_plugin_source_url(provider_id, source_id, player.player_id)
# create a PlayerMedia object for the plugin source so
# we can send a regular play-media call downstream
media = player_source.metadata or PlayerMedia(
uri=url,
media_type=MediaType.OTHER,
title=player_source.name,
custom_data={"source": source},
)
media.uri = url
await self.play_media(player.player_id, media)

async def _poll_players(self) -> None:
"""Background task that polls players for updates."""
while True:
Expand Down

0 comments on commit 3749351

Please sign in to comment.