wolffd@0: % --- wolffd@0: % import isrcs via albums for magnatune clips wolffd@0: wolffd@0: % now, we load the new file and search for the information on the wolffd@0: % actual excerpts we have wolffd@0: % --- wolffd@0: clip_info_proper = db_MTTClip.clip_info_proper; wolffd@0: wolffd@0: wolffd@0: db = adodb_connect('Driver={MySQL ODBC 5.1 Driver}; Server=10.2.165.196; Database=test; UID=daniel; PWD=wucity;',2000); wolffd@0: sql = 'SELECT download_mp3, artist, albumname, isrc, download_mp3lofi FROM `magnatune_song_info` where 1'; % 401 times not found wolffd@0: [res,resformat] = adodb_query(db, sql); wolffd@0: wolffd@0: wolffd@0: % these are for keeping book of missing items wolffd@0: not_found = []; wolffd@0: isrc = cell(numel(db_MTTClip.annots_ids),1); wolffd@0: for i = 1:numel(db_MTTClip.annots_ids) wolffd@0: % --- wolffd@0: % identify the clip by url wolffd@0: % --- wolffd@0: % convert search string wolffd@0: s = db_MTTClip.clip_info_proper{i,9}; wolffd@0: wolffd@0: idx = strcellfind(res.download_mp3,s); wolffd@0: if isempty(idx) wolffd@0: idx = strcellfind(res.download_mp3lofi,s); wolffd@0: end wolffd@0: wolffd@0: % we'll have to loosen the search wolffd@0: if isempty(idx) | idx < 1 wolffd@0: % warning(sprintf('! %s, album %s, artist %s!',clip_info_proper{i,1},... wolffd@0: % clip_info_proper{i,5},clip_info_proper{i,4})); wolffd@0: wolffd@0: % make note ... wolffd@0: not_found = cat(1,not_found,[str2num(clip_info_proper{i,1}), 0]); wolffd@0: wolffd@0: not_found(end,2) = 1; wolffd@0: % --- wolffd@0: % ok, no problem, lets look for the album and artist! wolffd@0: % --- wolffd@0: s = char(clip_info_proper{i,5}); wolffd@0: idx = strcellfind(res.albumname,s); wolffd@0: end wolffd@0: wolffd@0: wolffd@0: if isempty(idx) | idx < 1 wolffd@0: warning(sprintf('-- Album not found %s, album %s, artist %s!',clip_info_proper{i,1},... wolffd@0: clip_info_proper{i,5},clip_info_proper{i,4})); wolffd@0: wolffd@0: not_found(end,2) = 2; wolffd@0: % --- wolffd@0: % search for artist wolffd@0: % --- wolffd@0: s = char(clip_info_proper{i,4}); wolffd@0: idx = strcellfind(res.artist,s); wolffd@0: end wolffd@0: wolffd@0: if isempty(idx) | idx < 0 wolffd@0: warning(sprintf(' ---- Artist not found %s, album %s, artist %s!',clip_info_proper{i,1},... wolffd@0: clip_info_proper{i,5},clip_info_proper{i,4})); wolffd@0: not_found(end,2) = 3; wolffd@0: % % --- wolffd@0: % % this is the last try to get hold of such artists wolffd@0: % % they may be noted as a trackname or description substring in a compilation wolffd@0: % % --- wolffd@0: % s = char(clip_info_proper{i,4}); wolffd@0: % idx = substrcellfind(tmp(:,2),s); wolffd@0: else wolffd@0: isrc{i} = char(res.isrc{idx}); wolffd@0: end wolffd@0: wolffd@0: wolffd@0: % report new location/info of album wolffd@0: wolffd@0: % --- wolffd@0: % save genre wolffd@0: % --- wolffd@0: %clip_info_extra = cat(1,clip_info_extra,{clip_info_proper{i,1},tmp{idx,rel_cols}}); wolffd@0: wolffd@0: end wolffd@0: wolffd@0: