Fixed conversion logging
This commit is contained in:
parent
13efa2bc90
commit
8be934fb42
|
@ -185,7 +185,7 @@ class Spotify(Plugin):
|
||||||
}
|
}
|
||||||
return cachedAlbum
|
return cachedAlbum
|
||||||
|
|
||||||
def convertTrack(self, dz, downloadObject, track, pos, conversion, conversionNext, cache, listener):
|
def convertTrack(self, dz, downloadObject, track, pos, conversion, cache, listener):
|
||||||
if downloadObject.isCanceled: return
|
if downloadObject.isCanceled: return
|
||||||
trackAPI = None
|
trackAPI = None
|
||||||
cachedTrack = None
|
cachedTrack = None
|
||||||
|
@ -236,18 +236,17 @@ class Spotify(Plugin):
|
||||||
deezerTrack['_EXTRA_TRACK'] = trackAPI
|
deezerTrack['_EXTRA_TRACK'] = trackAPI
|
||||||
deezerTrack['POSITION'] = pos+1
|
deezerTrack['POSITION'] = pos+1
|
||||||
|
|
||||||
conversionNext += (1 / downloadObject.size) * 100
|
conversion['next'] += (1 / downloadObject.size) * 100
|
||||||
if round(conversionNext) != conversion and round(conversionNext) % 2 == 0:
|
if round(conversion['next']) != conversion['now'] and round(conversion['next']) % 2 == 0:
|
||||||
conversion = round(conversionNext)
|
conversion['now'] = round(conversion['next'])
|
||||||
if listener: listener.send("updateQueue", {'uuid': downloadObject.uuid, 'conversion': conversion})
|
if listener: listener.send("updateQueue", {'uuid': downloadObject.uuid, 'conversion': conversion['now']})
|
||||||
|
|
||||||
return deezerTrack
|
return deezerTrack
|
||||||
|
|
||||||
def convert(self, dz, downloadObject, settings, listener=None):
|
def convert(self, dz, downloadObject, settings, listener=None):
|
||||||
cache = self.loadCache()
|
cache = self.loadCache()
|
||||||
|
|
||||||
conversion = 0
|
conversion = { 'now': 0, 'next': 0 }
|
||||||
conversionNext = 0
|
|
||||||
|
|
||||||
collection = [None] * len(downloadObject.conversion_data)
|
collection = [None] * len(downloadObject.conversion_data)
|
||||||
if listener: listener.send("startConversion", downloadObject.uuid)
|
if listener: listener.send("startConversion", downloadObject.uuid)
|
||||||
|
@ -256,7 +255,7 @@ class Spotify(Plugin):
|
||||||
collection[pos] = executor.submit(self.convertTrack,
|
collection[pos] = executor.submit(self.convertTrack,
|
||||||
dz, downloadObject,
|
dz, downloadObject,
|
||||||
track, pos,
|
track, pos,
|
||||||
conversion, conversionNext,
|
conversion,
|
||||||
cache, listener
|
cache, listener
|
||||||
).result()
|
).result()
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue