improving look and feel

This commit is contained in:
2025-04-14 20:47:26 -04:00
parent 29c358298b
commit 68ed19766d
12 changed files with 695 additions and 42 deletions

0
src/models/__init__.py Normal file
View File

View File

@@ -0,0 +1,23 @@
import os
import time
class FileMetadata:
def __init__(self, code, file_path, max_downloads=1, expiry_hours=24):
self.code = code
self.file_path = file_path
self.max_downloads = max_downloads
self.expiry_time = time.time() + (expiry_hours * 3600)
self.download_count = 0
def is_expired(self):
return time.time() > self.expiry_time
def increment_download_count(self):
self.download_count += 1
def can_download(self):
return self.download_count < self.max_downloads and not self.is_expired()
def delete_file(self):
if os.path.exists(self.file_path):
os.remove(self.file_path)