view core/magnatagatune/makro_import_magnatagatune_mbid_cleanupisrc.m @ 0:e9a9cd732c1e tip

first hg version after svn
author wolffd
date Tue, 10 Feb 2015 15:05:51 +0000
parents
children
line wrap: on
line source
function out = makro_import_magnatagatune_mbid_cleanupisrc();
load db.mat
clip_info_proper_names
artists_mbid_map = containers.Map('KeyType', 'char', 'ValueType', 'char');
artists_matched = containers.Map('KeyType', 'char', 'ValueType', 'char');
cnt_workd = 0;
for i = 1:size(clip_info_proper,1)
        if ~isempty(clip_info_proper{i,12})
            continue;
        end
        % ---
        % ok, we have the isrc, lets get the artist id
        % ---
        % clip_info_proper{i,11} = annots_isrc{i};
        
        if artists_mbid_map.isKey(clip_info_proper{i,4})
            % did we already process this artist?
            if ~strcmp(artists_mbid_map(clip_info_proper{i,4}), '-');
                artist_mbid = artists_mbid_map(clip_info_proper{i,4});
            end
        else
            try
                % no we didnt, get the artist mbid via album and artist name
                [artist_mbid,artist_found, out] = mb_retrieve_artist_id_from_album_info(clip_info_proper{i,4},clip_info_proper{i,5});

                if ~isempty(artist_mbid)
                    cprint(0,'loaded info for %s: found %s, %s',clip_info_proper{i,4},artist_found,artist_mbid);
                    
                    artists_matched(clip_info_proper{i,4}) = artist_found;
                    artists_mbid_map(clip_info_proper{i,4}) = artist_mbid;
                    cnt_workd = cnt_workd + 1;
                else
                     artists_mbid_map(clip_info_proper{i,4}) = '-';
                end
                pause(1)
            catch
            end
        end
        clip_info_proper{i,12} = artist_mbid;
  
end
        
% clip_info_proper_names{11} = 'isrc';
clip_info_proper_names{12} = 'artist_mbid';
clear annots_isrc; 
clear artists_mbid_map; 
clear i; 
clear cnt_workd;
clear out;
save db_new.mat