Wrap game resource info from the server

Also add function to get the diff archive (for faster updating)

Download function soon, although I can't make sure that the download function will work properly (like pause, resume download etc.)
This commit is contained in:
2022-02-16 22:18:56 +07:00
parent 81fbdec553
commit da3ee30ab1
14 changed files with 227 additions and 84 deletions

View File

@ -0,0 +1,21 @@
from worthless.classes.installer.voicepack import Voicepack
class Diff:
def __init__(self, name, version, path, size, md5, is_recommended_update, voice_packs, raw):
self.name = name
self.version = version
self.path = path
self.size = size
self.md5 = md5
self.is_recommended_update = is_recommended_update
self.voice_packs = voice_packs
self.raw = raw
@staticmethod
def from_dict(data):
voice_packs = []
for v in data['voice_packs']:
voice_packs.append(Voicepack.from_dict(v))
return Diff(data["name"], data["version"], data["path"], data["size"], data["md5"],
data["is_recommended_update"], voice_packs, data)