YAMJ / yamj-v3

Main Project for YAMJ v3
11 stars 7 forks source link

wrong result with &include=newest-80-file #286

Closed jluc2808 closed 8 years ago

jluc2808 commented 8 years ago

i get wrong results when adding &include=newest-80-file (creation, and lastscan have the problem too)

api/index/video.json?type=movie,series&sortby=createTimestamp DESC and return the right selection beginning with "id": 596, "title": "Les Poings contre les murs", "originalTitle": "Starred Up", "watched": false, "videoType": "MOVIE", "sortTitle": "Poings contre les murs", "videoYear": 2013, "releaseDate": "2014-06-04" }, { "id": 597, "title": "Nos étoiles contraires", "originalTitle": "The Fault In Our Stars", "watched": false, "videoType": "MOVIE", "sortTitle": "Nos etoiles contraires", "videoYear": 2014, "releaseDate": "2014-08-20" }, { "id": 595, "title": "Eragon", "originalTitle": "Eragon", "watched": false, "videoType": "MOVIE", "sortTitle": "Eragon", "videoYear": 2006, "releaseDate": "2006-12-20" },

but when i add api/index/video.json?type=movie,series&sortby=createTimestamp DESC&include=newest-80-file

results is not what is expected (missing id: 597 to 592) "id": 591, "title": "Exposed", "originalTitle": "Exposed", "watched": false, "videoType": "MOVIE", "sortTitle": "Exposed", "videoYear": 2015, "newest": "2016-04-03 05:29:20" }, { "id": 588, "title": "Another World", "originalTitle": "Another World", "watched": false, "videoType": "MOVIE", "sortTitle": "Another World", "videoYear": 2014, "releaseDate": "2014-10-26", "newest": "2016-03-19 20:33:31" }, { "id": 586, "title": "Babysitting 2", "originalTitle": "Babysitting 2", "watched": false, "videoType": "MOVIE", "sortTitle": "Babysitting 2", "videoYear": 2014, "releaseDate": "2015-12-02", "newest": "2016-03-31 13:37:24" },

modmax commented 8 years ago

When you use "include=newest-80-file", then a new value named "newest" is established in the SQL query; this can be the "creation_timestamp" or the "last scanned date" or the "file_date" (in case of file). Also the 80 determines the "maximal 80 days for newest".

So if you you use "newest-80-file", then "newest" is the last file date for each video; and those values can be older than 80 days even if creation_timestamp is less then 80 days.

Also the sortby=creationTimestamp makes no sense; instead sortby=newest should be used; cause that is the value for which you want to get the videos on the newest index page.

jluc2808 commented 8 years ago

tested ok