3 if(doc.doc_type == "PodcastUserState")
5 var affected_devices = [];
7 for(var n in doc.actions)
9 var action = doc.actions[n];
10 if (affected_devices.indexOf(action.device) == -1)
12 affected_devices.push(action.device);
16 for(var n in affected_devices)
18 var device = affected_devices[n];
20 emit([device, doc.podcast], null);