Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions toolbox/db/db_load_protocol.m
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,26 @@
% Reload protocol
if isReload
db_reload_database(iProtocols(i));
% TODO: CHECK BROKEN LINKS TO RAW DATA
% - Get all raw data files (data_0raw....)
% - Check which ones are links to external data:
% (Not .mat, and dir is diff from dir for the raw data file)
% - Make a list of broken links (absolute path to file exist)
% - IF brokenlist NOT empty
% - Try to fix first path as in in_bst_data L131
% (Maybe expose that code part, so it can return the fixed_path)
% - IF path was fixed
% - Remove it from brokenlist
% - FOR broken IN brokenlist
% - Apply same fix to other broken links, when suitable
% - IF path was fixed
% - Remove it from brokenlist
% - WHILE brokenlist NOT empty AND numel(brokenlist) < SomeReasonableNumberOfLinksToFix
% - Ask user if they want to fix broken links NOW
% - Ask User to select the new path for first broken link
% - IF path was fixed
% - Apply same fix to other broken links, remove them from brokenlist

% Protocol loaded successfully: Copy protoco.mat fields in memory
else
GlobalData.DataBase.ProtocolInfo(iProtocols(i)).iStudy = ProtocolMat.ProtocolInfo.iStudy;
Expand Down