fix: download images

This commit is contained in:
Richard Ramos 2022-03-28 10:59:04 -04:00 committed by Iuri Matias
parent ebce90368c
commit b3cda3e755
2 changed files with 4 additions and 1 deletions

View File

@ -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)

View File

@ -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].} =