739b3231a7c8bdf655ab863a89bea4521b475345
[mygpo.git] / couchdb / general / _design / listeners / views / by_user_podcast / map.js
blob739b3231a7c8bdf655ab863a89bea4521b475345
1 function(doc)
3     if(doc.doc_type == "EpisodeUserState")
4     {
5         for(var n=doc.actions.length-1; n>=0; n--)
6         {
7             var action = doc.actions[n];
8             if(action.action == "play")
9             {
10                 emit([doc.user, doc.podcast], doc.episode);
11                 return;
12             }
13         }
14     }