From: Marcel van der Veldt Date: Sat, 8 Jun 2019 08:15:28 +0000 (+0200) Subject: Update http_streamer.py X-Git-Url: https://git.kitaultman.com/?a=commitdiff_plain;h=10e8ef2b0c7d0e29f769d9603d577fceedad8672;p=music-assistant-server.git Update http_streamer.py --- diff --git a/music_assistant/modules/http_streamer.py b/music_assistant/modules/http_streamer.py index 0d3a6fd5..0b2cc95c 100755 --- a/music_assistant/modules/http_streamer.py +++ b/music_assistant/modules/http_streamer.py @@ -327,21 +327,21 @@ class HTTPStreamer(): if os.path.isfile(cachefile): # get track length from cachefile args = 'soxi -d "%s"' % cachefile - process = await asyncio.create_subprocess_shell(args, - stderr=asyncio.subprocess.PIPE) + process = await asyncio.create_subprocess_shell(args, stdout=asyncio.subprocess.PIPE) stdout, stderr = await process.communicate() - hours = stderr.split(":")[0] - minutes = stderr.split(":")[1] - seconds = stderr.split(":")[2] + timestr = stdout.split()[0].decode() + hours = int(timestr.split(":")[0]) + minutes = int(timestr.split(":")[1]) + seconds = int(float(timestr.split(":")[2])) total_chunks = hours*60*60 + minutes*60 + seconds else: total_chunks = int(queue_track.duration) - cur_chunk = 0 - + # report start stream of current queue index self.mass.event_loop.create_task(self.mass.player.player_queue_stream_move(player_id, queue_index)) queue_index += 1 fade_in_part = b'' + cur_chunk = 0 async for chunk in self.__get_raw_audio(track_id, provider, sample_rate): cur_chunk += 1