logger.info(f"Start opening and parsing instrument metadata from {baseSamplePath}")
checkForDuplicateLibraryFiles=set()#lib ids. only one lib with the same id is allowed.
forfinbasePath.glob('*.tar'):
iff.is_file()andf.suffix==".tar":
#First load the library (this is .ini parsing, not sample loading, so it is cheap) and create a library object
@ -113,6 +116,15 @@ class Data(TemplateData):
exceptPermissionErrorase:
logger.error(f"Library {f} could not be loaded. The reason follows: {e}")
continue
#Check for duplication error.
iflib.idincheckForDuplicateLibraryFiles:
logger.error(f"Library {f} with id {lib.id} has a duplicate library id and will not be loaded. This only happens when manually copying and duplicating files in the sample dir. Don't do that, please.")
continue
else:
checkForDuplicateLibraryFiles.add(lib.id)
#Then compare if this is actually a file we already knew:
#we loaded this before and it still exists. We will NOT delete it below.