From 6848f08448644ee54c9f431586ef42b69c8a141a Mon Sep 17 00:00:00 2001 From: kokarare1212 Date: Fri, 21 May 2021 12:32:15 +0900 Subject: [PATCH] Resolve conflicts during import. --- librespot/audio/AbsChunkedInputStream.py | 13 ++++++------- librespot/audio/cdn/CdnFeedHelper.py | 2 +- librespot/audio/cdn/CdnManager.py | 2 +- librespot/audio/cdn/__init__.py | 2 +- librespot/audio/decrypt/AesAudioDecrypt.py | 2 +- librespot/core/Session.py | 6 +++--- librespot/player/PlayerConfiguration.py | 2 +- 7 files changed, 14 insertions(+), 15 deletions(-) diff --git a/librespot/audio/AbsChunkedInputStream.py b/librespot/audio/AbsChunkedInputStream.py index 8d278ce..61de4dd 100644 --- a/librespot/audio/AbsChunkedInputStream.py +++ b/librespot/audio/AbsChunkedInputStream.py @@ -1,5 +1,4 @@ from librespot.audio.HaltListener import HaltListener -from librespot.audio.storage import ChannelManager from librespot.standard.InputStream import InputStream import math import threading @@ -64,7 +63,7 @@ class AbsChunkedInputStream(InputStream, HaltListener): raise IOError("Stream is closed!") self._pos = where - self.check_availability(int(self._pos / ChannelManager.CHUNK_SIZE), + self.check_availability(int(self._pos / (128 * 1024)), False, False) def skip(self, n: int) -> int: @@ -78,7 +77,7 @@ class AbsChunkedInputStream(InputStream, HaltListener): k = n self._pos += k - chunk = int(self._pos / ChannelManager.CHUNK_SIZE) + chunk = int(self._pos / (128 * 1024)) self.check_availability(chunk, False, False) return k @@ -170,8 +169,8 @@ class AbsChunkedInputStream(InputStream, HaltListener): i = 0 while True: - chunk = int(self._pos / ChannelManager.CHUNK_SIZE) - chunk_off = int(self._pos % ChannelManager.CHUNK_SIZE) + chunk = int(self._pos / (128 * 1024)) + chunk_off = int(self._pos % (128 * 1024)) self.check_availability(chunk, True, False) @@ -191,10 +190,10 @@ class AbsChunkedInputStream(InputStream, HaltListener): if self._pos >= self.size(): return -1 - chunk = int(self._pos / ChannelManager.CHUNK_SIZE) + chunk = int(self._pos / (128 * 1024)) self.check_availability(chunk, True, False) - b = self.buffer()[chunk][self._pos % ChannelManager.CHUNK_SIZE] + b = self.buffer()[chunk][self._pos % (128 * 1024)] self._pos = self._pos + 1 return b diff --git a/librespot/audio/cdn/CdnFeedHelper.py b/librespot/audio/cdn/CdnFeedHelper.py index 9e3e96e..bcfb7fe 100644 --- a/librespot/audio/cdn/CdnFeedHelper.py +++ b/librespot/audio/cdn/CdnFeedHelper.py @@ -31,7 +31,7 @@ class CdnFeedHelper: streamer = session.cdn().stream_file(file, key, url, halt_listener) input_stream = streamer.stream() - normalization_data = NormalizationData.read(input_stream) + normalization_data = NormalizationData.NormalizationData.read(input_stream) if input_stream.skip(0xa7) != 0xa7: raise IOError("Couldn't skip 0xa7 bytes!") return PlayableContentFeeder.PlayableContentFeeder.LoadedStream( diff --git a/librespot/audio/cdn/CdnManager.py b/librespot/audio/cdn/CdnManager.py index 7ad33be..a964669 100644 --- a/librespot/audio/cdn/CdnManager.py +++ b/librespot/audio/cdn/CdnManager.py @@ -159,7 +159,7 @@ class CdnManager: else: self._expiration = -1 - class Streamer(GeneralAudioStream, GeneralWritableStream): + class Streamer(GeneralAudioStream.GeneralAudioStream, GeneralWritableStream.GeneralWritableStream): _session: Session = None _streamId: StreamId = None _executorService = concurrent.futures.ThreadPoolExecutor() diff --git a/librespot/audio/cdn/__init__.py b/librespot/audio/cdn/__init__.py index 3eed8a6..da8fa1d 100644 --- a/librespot/audio/cdn/__init__.py +++ b/librespot/audio/cdn/__init__.py @@ -1,2 +1,2 @@ from librespot.audio.cdn.CdnFeedHelper import CdnFeedHelper -from librespot.audio.cdn.CdnManager import ChannelManager +from librespot.audio.cdn.CdnManager import CdnManager diff --git a/librespot/audio/decrypt/AesAudioDecrypt.py b/librespot/audio/decrypt/AesAudioDecrypt.py index 09fd17f..a35a7d4 100644 --- a/librespot/audio/decrypt/AesAudioDecrypt.py +++ b/librespot/audio/decrypt/AesAudioDecrypt.py @@ -1,6 +1,6 @@ from Crypto.Cipher import AES from Crypto.Util import Counter -from librespot.audio.storage.ChannelManager import ChannelManager +from librespot.audio.storage import ChannelManager from librespot.audio.decrypt.AudioDecrypt import AudioDecrypt import time diff --git a/librespot/core/Session.py b/librespot/core/Session.py index 22e3ecc..e4751e2 100644 --- a/librespot/core/Session.py +++ b/librespot/core/Session.py @@ -241,11 +241,11 @@ class Session(Closeable, SubListener, DealerClient.MessageListener): with self._authLock: self._mercuryClient = MercuryClient(self) self._tokenProvider = TokenProvider.TokenProvider(self) - self._audioKeyManager = AudioKeyManager(self) + self._audioKeyManager = AudioKeyManager.AudioKeyManager(self) self._channelManager = ChannelManager(self) self._api = ApiClient.ApiClient(self) - self._cdnManager = CdnManager.CdnManager(self) - self._contentFeeder = PlayableContentFeeder(self) + self._cdnManager = CdnManager(self) + self._contentFeeder = PlayableContentFeeder.PlayableContentFeeder(self) self._cacheManager = CacheManager(self) self._dealer = DealerClient(self) self._search = SearchManager.SearchManager(self) diff --git a/librespot/player/PlayerConfiguration.py b/librespot/player/PlayerConfiguration.py index 22da8e4..a7ab309 100644 --- a/librespot/player/PlayerConfiguration.py +++ b/librespot/player/PlayerConfiguration.py @@ -30,7 +30,7 @@ class PlayerConfiguration: self.volume_steps = volume_steps class Builder: - preferred_quality: AudioQuality = AudioQuality.AudioQuality.NORMAL + preferred_quality: AudioQuality = AudioQuality.NORMAL enable_normalisation: bool = True normalisation_pregain: float = 3.0 autoplay_enabled: bool = True