Fixed some issues to make the lib work

This commit is contained in:
RemixDev
2021-06-08 19:12:15 +02:00
parent 8b7417f8c4
commit 97cd903289
5 changed files with 17 additions and 14 deletions

View File

@ -8,7 +8,7 @@ class IDownloadObject:
self.artist = obj['artist']
self.cover = obj['cover']
self.explicit = obj.get('explicit', False)
self.size = obj['size']
self.size = obj.get('size', 0)
self.downloaded = obj.get('downloaded', 0)
self.failed = obj.get('failed', 0)
self.progress = obj.get('progress', 0)
@ -16,6 +16,7 @@ class IDownloadObject:
self.files = obj.get('files', [])
self.progressNext = 0
self.uuid = f"{self.type}_{self.id}_{self.bitrate}"
self.isCanceled = False
self.__type__ = None
def toDict(self):

View File

@ -11,7 +11,7 @@ class Lyrics:
syncLyricsJson = lyricsAPI["LYRICS_SYNC_JSON"]
timestamp = ""
milliseconds = 0
for line in enumerate(syncLyricsJson):
for line, _ in enumerate(syncLyricsJson):
if syncLyricsJson[line]["line"] != "":
timestamp = syncLyricsJson[line]["lrc_timestamp"]
milliseconds = int(syncLyricsJson[line]["milliseconds"])