Mercurial > hg > camir-aes2014
comparison 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 |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:e9a9cd732c1e |
---|---|
1 function out = makro_import_magnatagatune_mbid_cleanupisrc(); | |
2 load db.mat | |
3 clip_info_proper_names | |
4 artists_mbid_map = containers.Map('KeyType', 'char', 'ValueType', 'char'); | |
5 artists_matched = containers.Map('KeyType', 'char', 'ValueType', 'char'); | |
6 cnt_workd = 0; | |
7 for i = 1:size(clip_info_proper,1) | |
8 if ~isempty(clip_info_proper{i,12}) | |
9 continue; | |
10 end | |
11 % --- | |
12 % ok, we have the isrc, lets get the artist id | |
13 % --- | |
14 % clip_info_proper{i,11} = annots_isrc{i}; | |
15 | |
16 if artists_mbid_map.isKey(clip_info_proper{i,4}) | |
17 % did we already process this artist? | |
18 if ~strcmp(artists_mbid_map(clip_info_proper{i,4}), '-'); | |
19 artist_mbid = artists_mbid_map(clip_info_proper{i,4}); | |
20 end | |
21 else | |
22 try | |
23 % no we didnt, get the artist mbid via album and artist name | |
24 [artist_mbid,artist_found, out] = mb_retrieve_artist_id_from_album_info(clip_info_proper{i,4},clip_info_proper{i,5}); | |
25 | |
26 if ~isempty(artist_mbid) | |
27 cprint(0,'loaded info for %s: found %s, %s',clip_info_proper{i,4},artist_found,artist_mbid); | |
28 | |
29 artists_matched(clip_info_proper{i,4}) = artist_found; | |
30 artists_mbid_map(clip_info_proper{i,4}) = artist_mbid; | |
31 cnt_workd = cnt_workd + 1; | |
32 else | |
33 artists_mbid_map(clip_info_proper{i,4}) = '-'; | |
34 end | |
35 pause(1) | |
36 catch | |
37 end | |
38 end | |
39 clip_info_proper{i,12} = artist_mbid; | |
40 | |
41 end | |
42 | |
43 % clip_info_proper_names{11} = 'isrc'; | |
44 clip_info_proper_names{12} = 'artist_mbid'; | |
45 clear annots_isrc; | |
46 clear artists_mbid_map; | |
47 clear i; | |
48 clear cnt_workd; | |
49 clear out; | |
50 save db_new.mat |