move categories into own database
[mygpo.git] / couchdb / general / _design / podcasts / views / by_oldid / map.js
blob307512e985f7cac5c873a104df558b2a8e2e11a2
1 function (doc)
3     function searchPodcast(podcast)
4     {
5         if(podcast.oldid)
6         {
7             emit(podcast.oldid, null);
8         }
10         for(var n in podcast.merged_oldids)
11         {
12             emit(podcast.merged_oldids[n], null);
13         }
14     }
16     if(doc.doc_type == "Podcast")
17     {
18         searchPodcast(doc);
19     }
20     else if(doc.doc_type == "PodcastGroup")
21     {
22         for(var i in doc.podcasts)
23         {
24             searchPodcast(doc.podcasts[i]);
25         }
26     }