Skip to content
Snippets Groups Projects
Commit e6c74396 authored by Nes, Egbert van's avatar Nes, Egbert van
Browse files

Update 2 files

- /makedatabase.m
- /bin/restore_database.m
parent 00bb3899
No related branches found
No related tags found
No related merge requests found
......@@ -8,6 +8,9 @@ function [changedsettings] = restore_database(currfolder)
if ~isfield(bird_settings, 'recs') %for compatibility
bird_settings.recs = [];
end
if nargin == 0
currfolder = bird_settings.currfolder;
end
else
if nargin == 0
currfolder = 'curr';
......@@ -31,7 +34,7 @@ function [changedsettings] = restore_database(currfolder)
changedsettings = true;
bird_settings.filerec = cell2table(cell(0,4),'VariableNames',{ 'id', 'mp3file', 'score', 'selected'} );
end
currfolder = bird_settings.currfolder;
%currfolder = bird_settings.currfolder;
filerec = [dir([currfolder , filesep , '*.mp3']); dir(['tmp', filesep, '*.mp3']); ...
dir([currfolder, filesep, '*.wav']); dir(['tmp', filesep, '*.wav'])];
%tmp = regexp({filedata(:).name}, '( - )|[.]', 'split');
......
......@@ -29,7 +29,7 @@ function makedatabase(varargin)
load bird_settings bird_settings
else
bird_settings = struct( 'deletedrecs', [], 'language', 'Dutch', 'currfolder', 'curr', ...
'filerec', []);
'filerec', [], 'recs', []);
save bird_settings bird_settings
end
......@@ -50,6 +50,11 @@ function makedatabase(varargin)
else
addmode='add';
end
if strcmpi(addmode,'add')&&~isempty(bird_settings.recs)
%do not add the same ids that are already downloaded
opts(:,end+1)={'~id';bird_settings.recs.id};
end
ndx = strcmpi(opts(1, :), 'ignore_exist');
if any(ndx)
ignore_exist = opts{2, ndx};
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment