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,16 @@
from worthless.classes.installer.latest import Latest
from worthless.classes.installer.diff import Diff
class Game:
def __init__(self, latest, diffs, raw):
self.latest = latest
self.diffs = diffs
self.raw = raw
@staticmethod
def from_dict(data):
diffs = []
for diff in data['diffs']:
diffs.append(Diff.from_dict(diff))
return Game(Latest.from_dict(data['latest']), diffs, data)