Created
          November 23, 2014 08:38 
        
      - 
      
 - 
        
Save kyu999/006e1e158b88f64847ea to your computer and use it in GitHub Desktop.  
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | def findWeeklyContents(page: Int = 1, amount: Int = 8): List[LightContent] = { | |
| toLightContents(coll.find("date" $gt get_last_week()).take(amount)) | |
| } | |
| def findMonthlyContents(page: Int = 1, amount: Int = 8): List[LightContent] | |
| = toLightContents(coll.find("date" $gt get_last_month()).take(amount)) | |
| def findWeeklyPopularContents(page: Int = 1, amount: Int = 8): List[LightContent] | |
| = toLightContents(coll.find("date" $gt get_last_week()).sort(DBObject("views" -> -1))) | |
| def findMonthlyPopularContents(page: Int = 1, amount: Int = 8): List[LightContent] | |
| = toLightContents(coll.find("date" $gt get_last_month()).sort(DBObject("views" -> -1)).take(amount)) | |
| // manga | |
| def findRecentMangas(page: Int = 1, amount: Int = 12): List[LightContent] = { | |
| val (start, end) = pageToIndex(page) | |
| toLightContents(coll.find("date" $gt get_last_month()).sort(DBObject("date" -> -1)).slice(start, end).take(amount)) | |
| } | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment