add filter generic/is_types
[mygpo.git] / couchdb / general / _design / podcast_states / views / by_device / map.js
blob4b4cf2672187503ad5146d389e7f349dcd32b0aa
1 function(doc)
3     if(doc.doc_type == "PodcastUserState")
4     {
5         var affected_devices = [];
7         for(var n in doc.actions)
8         {
9             var action = doc.actions[n];
10             if (affected_devices.indexOf(action.device) == -1)
11             {
12                 affected_devices.push(action.device);
13             }
14         }
16         for(var n in affected_devices)
17         {
18             var device = affected_devices[n];
20             emit([device, doc.podcast], null);
21         }
22     }