fix: download images
This commit is contained in:
parent
ebce90368c
commit
b3cda3e755
|
@ -75,6 +75,7 @@ proc toStickerDto*(jsonObj: JsonNode): StickerDto =
|
|||
discard jsonObj.getProp("hash", result.hash)
|
||||
discard jsonObj.getProp("packID", result.packId)
|
||||
discard jsonObj.getProp("url", result.url)
|
||||
result.url = result.url & "&download=true"
|
||||
|
||||
proc toStickerPackDto*(jsonObj: JsonNode): StickerPackDto =
|
||||
result = StickerPackDto()
|
||||
|
@ -86,6 +87,8 @@ proc toStickerPackDto*(jsonObj: JsonNode): StickerPackDto =
|
|||
|
||||
result.status = jsonObj{"status"}.getInt(0).toStickerPackStatus()
|
||||
result.price = jsonObj["price"].getStr().parse(Stuint[256])
|
||||
result.preview = result.preview & "&download=true"
|
||||
result.thumbnail = result.thumbnail & "&download=true"
|
||||
result.stickers = @[]
|
||||
for sticker in jsonObj["stickers"]:
|
||||
result.stickers.add(sticker.toStickerDto)
|
||||
|
|
|
@ -29,7 +29,7 @@ proc recent*(): RpcResponse[JsonNode] {.raises: [Exception].} =
|
|||
return core.callPrivateRPC("stickers_recent", payload)
|
||||
|
||||
proc addRecent*(packId: string, hash: string): RpcResponse[JsonNode] {.raises: [Exception].} =
|
||||
let payload = %* [{"packID": packId, "hash": hash}]
|
||||
let payload = %* [packId, hash]
|
||||
return core.callPrivateRPC("stickers_addRecent", payload)
|
||||
|
||||
proc stickerMarketAddress*(chainId: int): RpcResponse[JsonNode] {.raises: [Exception].} =
|
||||
|
|
Loading…
Reference in New Issue