|
@@ -19,8 +19,8 @@ def save_qr(qr: bytes, _b32:str , directory: str) -> str:
|
|
|
f.write(qr)
|
|
|
|
|
|
|
|
|
-def save(content: bytes, location: str, root='rest/static/files') -> str:
|
|
|
- _bytes = blake(content, person='clip'.encode('utf-8'))
|
|
|
+def save(content: bytes, tool: str, location: str, root='rest/static/files') -> str:
|
|
|
+ _bytes = blake(content, person=tool.encode('utf-8'))
|
|
|
_b32 = bytes_to_base32(_bytes)
|
|
|
directory = f'{root}/{_b32}'
|
|
|
try:
|
|
@@ -31,7 +31,7 @@ def save(content: bytes, location: str, root='rest/static/files') -> str:
|
|
|
with open(fd, "wb") as f:
|
|
|
f.write(content)
|
|
|
|
|
|
- link = f'{location}/clip/{_b32}'
|
|
|
+ link = f'{location}/{tool}/{_b32}'
|
|
|
svg = get_qr_code(content, fallback=link)
|
|
|
save_qr(svg, _b32, directory)
|
|
|
return _b32
|