# put chunk in buffer
self.mass.create_task(
buffer.write(audio_chunk), wait_for_result=True,
- ignore_exception=BrokenPipeError)
+ ignore_exception=(BrokenPipeError,ConnectionResetError))
# all chunks received: streaming finished
if cancelled.is_set():
LOGGER.debug("stream single track interrupted for track %s on player %s" % (queue_item.name, player.name))
# indicate EOF if no more data
self.mass.create_task(
buffer.write_eof(), wait_for_result=True,
- ignore_exception=BrokenPipeError)
+ ignore_exception=(BrokenPipeError,ConnectionResetError))
LOGGER.debug("stream single track finished for track %s on player %s" % (queue_item.name, player.name))
def __get_queue_stream(self, player, buffer, cancelled):
break
if chunk and not cancelled.is_set():
self.mass.create_task(buffer.write(chunk),
- wait_for_result=True, ignore_exception=BrokenPipeError)
+ wait_for_result=True, ignore_exception=(BrokenPipeError,ConnectionResetError))
del chunk
# indicate EOF if no more data
if not cancelled.is_set():
self.mass.create_task(buffer.write_eof(),
- wait_for_result=True, ignore_exception=BrokenPipeError)
+ wait_for_result=True, ignore_exception=(BrokenPipeError,ConnectionResetError))
# start fill buffer task in background
fill_buffer_thread = threading.Thread(target=fill_buffer)
fill_buffer_thread.start()
from ..models import MusicProvider, MediaType, TrackQuality, \
AlbumType, Artist, Album, Track, Playlist
from ..constants import CONF_USERNAME, CONF_PASSWORD, CONF_ENABLED, \
- CONF_TYPE_PASSWORD, EVENT_PLAYBACK_STARTED, EVENT_PLAYBACK_STOPPED
+ CONF_TYPE_PASSWORD, EVENT_STREAM_STARTED, EVENT_PLAYBACK_STOPPED
PROV_ID = 'qobuz'
PROV_NAME = 'Qobuz'
self.http_session = aiohttp.ClientSession(
loop=self.mass.event_loop, connector=aiohttp.TCPConnector())
self.throttler = Throttler(rate_limit=2, period=1)
- await self.mass.add_event_listener(self.mass_event, EVENT_PLAYBACK_STARTED)
+ await self.mass.add_event_listener(self.mass_event, EVENT_STREAM_STARTED)
await self.mass.add_event_listener(self.mass_event, EVENT_PLAYBACK_STOPPED)
async def search(self, searchstring, media_types=List[MediaType], limit=5):
if not self.__user_auth_info:
return
# TODO: need to figure out if the streamed track is purchased by user
- if msg == EVENT_PLAYBACK_STARTED and msg_details["provider"] == self.prov_id:
+ if msg == EVENT_STREAM_STARTED and msg_details["provider"] == self.prov_id:
# report streaming started to qobuz
device_id = self.__user_auth_info["user"]["device"]["id"]
credential_id = self.__user_auth_info["user"]["credential"]["id"]