Small fixes V1.0.4

This commit is contained in:
Patryk Mazur
2026-04-22 19:55:25 +02:00
parent 03b90d1316
commit d89780a0ad
2 changed files with 5 additions and 2 deletions
+4 -1
View File
@@ -5,7 +5,10 @@ import hashlib
def rotate_downloads(downloads_dir: str):
MAX_FILES = os.getenv('MAX_FILES')
if not MAX_FILES.isnumeric():
return {'status': 'error', 'message': f'MAX_FILES: {MAX_FILES} - nie jest cyfrą.'}
MAX_FILES = int(MAX_FILES)
files = [
os.path.join(downloads_dir, f)
for f in os.listdir(downloads_dir)
@@ -23,7 +26,7 @@ def rotate_downloads(downloads_dir: str):
def download_video(yt_url: str) -> dict:
MAX_DUR = os.getenv('MAX_DURATION')
if not MAX_DUR.isnumeric():
return {'status': 'error', 'message': f'MAX_DUR: {MAX_DUR} nie jest cyfrą.'}
return {'status': 'error', 'message': f'MAX_DUR: {MAX_DUR} - nie jest cyfrą.'}
MAX_DUR = int(MAX_DUR)
BASE_DIR = os.path.dirname(os.path.abspath(__file__))