move categories into own database
[mygpo.git] / couchdb / general / _design / listeners / views / by_podcast / map.js
blob2798c54d09c9d56a9a75328ae8d83a9a22f02c77
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                 var day = action.timestamp.slice(0, 10);
11                 emit([doc.podcast, day], doc.user);
12                 return;
13             }
14         }
15     }