fix: handle missing download URL for primary file in metadata

This commit is contained in:
Will Miao
2025-09-13 09:03:34 +08:00
parent d05076d258
commit 125fdecd61

View File

@@ -294,6 +294,8 @@ class DownloadManager:
file_info = next((f for f in version_info.get('files', []) if f.get('primary')), None) file_info = next((f for f in version_info.get('files', []) if f.get('primary')), None)
if not file_info: if not file_info:
return {'success': False, 'error': 'No primary file found in metadata'} return {'success': False, 'error': 'No primary file found in metadata'}
if not file_info.get('downloadUrl'):
return {'success': False, 'error': 'No download URL found for primary file'}
# 3. Prepare download # 3. Prepare download
file_name = file_info['name'] file_name = file_info['name']