wolffd@0: function out = makro_import_magnatagatune_mbtags(); wolffd@0: load db.mat wolffd@0: clip_info_proper_names wolffd@0: cnt_workd = 0; wolffd@0: wolffd@0: mbtagdb = AnnotDB(); wolffd@0: wolffd@0: failedartists = []; wolffd@0: wolffd@0: for i = 1:size(clip_info_proper,1) wolffd@0: % --- wolffd@0: % get internal artist id wolffd@0: % --- wolffd@0: artistintid = artistdb.get_annot_id(lower(clip_info_proper{i,4})); wolffd@0: wolffd@0: % do we have an mbid if not skip? wolffd@0: if isempty(clip_info_proper{i,12}) || strcmp(clip_info_proper{i,12}, '-') wolffd@0: continue; wolffd@0: end wolffd@0: wolffd@0: % do we have tags for this artist? wolffd@0: if ~isempty( mbtagdb.annotids_for_owner(artistintid)) || sum(failedartists== artistintid)> 0; wolffd@0: continue wolffd@0: end wolffd@0: wolffd@0: try wolffd@0: % --- wolffd@0: % ok, lets get the tags wolffd@0: % --- wolffd@0: [tags,count, out] = mb_retrieve_tags_for_artist_id(clip_info_proper{i,12}); wolffd@0: wolffd@0: if ~isempty(tags) wolffd@0: cprint(0,'loaded info for %s: found %s, %s',clip_info_proper{i,4},artist_found,artist_mbid); wolffd@0: wolffd@0: % --- wolffd@0: % TODO: save tags in map wolffd@0: % --- wolffd@0: for i=1:numel(tags) wolffd@0: mbtagdb.add_pair(artistintid, tags{i}, count(i)); wolffd@0: end wolffd@0: cnt_workd = cnt_workd + 1; wolffd@0: wolffd@0: else wolffd@0: cprint(0,'no tags received for %s:%s',clip_info_proper{i,4}); wolffd@0: % TODO: mark no tags received for this wolffd@0: failedartists(end+1) = artistintid; wolffd@0: end wolffd@0: pause(1) wolffd@0: catch wolffd@0: end wolffd@0: wolffd@0: end wolffd@0: wolffd@0: failedartists wolffd@0: numel(failedartists); wolffd@0: clear failedartists wolffd@0: save ('db.mat','mbtagdb','-append')