Skip to content

Commit

Permalink
updated upload api, added creation and invite buttons
Browse files Browse the repository at this point in the history
  • Loading branch information
Andcool-Systems committed Feb 4, 2024
1 parent b49168f commit 0a5bf6c
Show file tree
Hide file tree
Showing 9 changed files with 829 additions and 488 deletions.
2 changes: 1 addition & 1 deletion imports.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@
import bcrypt
import random

rate_limit_exceeded_handler = _rate_limit_exceeded_handler
rate_limit_exceeded_handler = _rate_limit_exceeded_handler
927 changes: 602 additions & 325 deletions main.py

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ generator db {
model file {
id Int @id @default(autoincrement())
user_id Int @default(-1)
group_id BigInt @default(-1)
created_date String @default("")
url String @default("")
filename String @default("")
Expand Down
3 changes: 2 additions & 1 deletion utils.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import random


def generate_token(length):
base = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ123456789-+="
return "".join([random.choice(base) for x in range(length)])


def calculate_size(size: int):
units = ["B", "KB", "MB", "GB", "TB"]
unit_iteration = 0
Expand All @@ -14,4 +16,3 @@ def calculate_size(size: int):
unit_iteration += 1

return f"{round(calculated_size, 2)}{units[unit_iteration]}"

Loading

0 comments on commit 0a5bf6c

Please sign in to comment.