mirror of
https://github.com/Radiquum/YAMPD.git
synced 2025-05-20 15:49:34 +05:00
add types and decouple packs functions from flask
This commit is contained in:
parent
ee133e9111
commit
f4d15c5eaf
7 changed files with 174 additions and 48 deletions
21
src/type/file.py
Normal file
21
src/type/file.py
Normal file
|
@ -0,0 +1,21 @@
|
|||
import json
|
||||
|
||||
|
||||
class ModFile:
|
||||
def __init__(
|
||||
self, version: str, hashes: dict[str, str], url: str, filename: str, size: int
|
||||
):
|
||||
self.version = version
|
||||
self.hashes = hashes
|
||||
self.url = url
|
||||
self.filename = filename
|
||||
self.size = size
|
||||
|
||||
def json(self):
|
||||
return {
|
||||
"version": self.version,
|
||||
"hashes": self.hashes,
|
||||
"url": self.url,
|
||||
"filename": self.filename,
|
||||
"size": self.size,
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue