Resolve conflicts during import.

This commit is contained in:
kokarare1212 2021-05-21 12:32:15 +09:00
parent 8d86accf48
commit 6848f08448
7 changed files with 14 additions and 15 deletions

View File

@ -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

View File

@ -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(

View File

@ -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()

View File

@ -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

View File

@ -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

View File

@ -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)

View File

@ -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