fetch "all_podcasts" from PostgreSQL
[mygpo.git] / couchdb / general / _design / podcasts / views / license / map.js
blob1157005e83896fd2ec1e330aea5db2180f9d47c5
1 function(doc)
3     if (doc.doc_type == 'Podcast')
4     {
5         if(doc.license)
6         {
7             emit(doc.license, null);
8         }
9     }
10     else if(doc.doc_type == 'PodcastGroup')
11     {
12         for(var n in doc.podcasts)
13         {
14             var podcast = doc.podcasts[n];
15             if (podcast.license)
16             {
17                 emit(podcast.license, null);
18                 return;
19             }
20         }
21     }