[Migration] remove unused imports
[mygpo.git] / couchdb / general / _design / podcasts / views / by_slug / map.js
blob738bc4f86e9e724ad4e31b4bcd64952a1cb8b5d3
1 function (doc)
3     function searchPodcast(podcast, podcast_id)
4     {
5         if(podcast.slug)
6         {
7             emit([podcast.slug, podcast_id], null);
8         }
10         if(podcast.merged_slugs)
11         {
12             for(var n in podcast.merged_slugs)
13             {
14                 emit([podcast.merged_slugs[n], podcast_id], null);
15             }
16         }
17     }
19     if(doc.doc_type == "Podcast")
20     {
21         searchPodcast(doc, doc._id);
22     }
23     else if(doc.doc_type == "PodcastGroup")
24     {
25         searchPodcast(doc, doc._id);
27         for(var n in doc.podcasts)
28         {
29             var podcast = doc.podcasts[n];
30             searchPodcast(podcast, podcast.id);
31         }
32     }