provide file type statistics for admins
[mygpo.git] / couchdb / _design / episode_stats / views / filetypes / map.js
blobeadb4a932f6401323530986a6407bd1270aebef0
1 function(doc)
3     if(doc.doc_type == "Episode")
4     {
5         for(var n in doc.urls)
6         {
7             var url = doc.urls[n];
8             var i = url.lastIndexOf(".");
10             if(i >= 0)
11             {
12                 /* exclude the dot */
13                 var ext = url.substr(i+1);
15                 /* make sure we exclude obvious non-extensions */
16                 if (ext.length < 10)
17                 {
18                     emit(ext.toLowerCase(), url);
19                 }
20             }
21         }
22     }