@@ -121,7 +121,7 @@ def __init__(self, *args, **kwargs):
121121 # do not allow to proceed without a title
122122 self .lineEdit_authors .textChanged .connect (self .on_authors_edited )
123123 self .on_authors_edited ("" ) # initial state
124- # if the user changes the preset combobox text, offer him
124+ # if the user changes the preset combobox text, offer them
125125 # to save it as a preset
126126 self .comboBox_preset .editTextChanged .connect (
127127 self .on_preset_text_edited )
@@ -314,6 +314,24 @@ def on_proceed(self):
314314 "resource." )
315315 return
316316
317+ # If the user uploads A LOT of resources in a dataset, we should
318+ # warn them about possible performance penalties.
319+ max_num_res = 100
320+ if len (paths ) > max_num_res :
321+ choice = QtWidgets .QMessageBox .question (
322+ self , "Unusually large number of resources specified" ,
323+ f"You are attempting to upload { len (paths )} resources "
324+ f"in one single dataset. Be advised that adding more than "
325+ f"{ max_num_res } resources to a dataset might affect DCOR "
326+ f"performance (listing the resources can be slow).\n \n "
327+ f"Too many resources in one dataset may also impair the "
328+ f"ability of a human to grasp what you are attempting to "
329+ f"share.\n \n "
330+ f"Are you sure you want to upload { len (paths )} resources to "
331+ f"this dataset? Select 'Yes' to continue with the upload." )
332+ if choice != QtWidgets .QMessageBox .StandardButton .Yes :
333+ return
334+
317335 # Checking for duplicate resources is the responsibility of
318336 # DCOR-Aid, because we are skipping existing resources in
319337 # dcoraid.upload.job.UploadJob.task_upload_resources.
0 commit comments