recentmovies/recentepisodes descending/ascending by date issue
Closed this issue · 7 comments
Today I noticed that recentmovies won't update correctly:
I added a few movies to the library and the recentmoves still show old ones (20 items, unwatched). After one of them is watched, a newer one will appear in the list.
I disabled the "only unwatched" option and the issue is still there. Noticed on recentmovies/recentepisodes, can't say if it affects the other recent items, too.
It seems that the recent items are sorted in wrong direction (date descending/ascending issue). The newest one should be in Container.Position(0).
I'll try and look into this tomorrow, if no-one else gets there first. Just to be clear, are you using the script for widgets or for a library view, and are you using the reload parameter?
Yep, I'm using the reload paramenter.
I use it for widgets and some library views.
The script - with data sorted by 'dateadded' - is adding list items in the correct order here, with the newest item the first it adds and so on. Working for both widgets & library views, only tested for movies.
I'm not in a position to test adding media to see if that breaks anything, will try this weekend.
Okay thanks.
Note:
Tested it again on my other PC and it's the same issue. The newest one isn't the first item
Just tried to reproduce this with a new movie added on a library update - still no luck.
To be clear, I removed an item from my library, 'touch'ed it (to reset the modified date, which is what XBMC uses for the dateadded property that the recent lists all sort by) and re-scanned it into the library. The logging I added still show all items returned being added to the list in the correct date order, and the item appears first in the list.
The logging line I'm using (in parse_movies, just after full_liz.append) is
log( item[ "dateadded" ] + " " + item[ "title" ] )
If you want to check the order that they're being added to the list on your own system. Otherwise, aside from checking the date modified I can't think of much else that would be causing your issue. :(
Did it:
ibrary Data Provider: 2014-06-13 20:27:46 World Invasion: Battle Los Angeles
17:09:36 T:2156 DEBUG: Library Data Provider: 2014-06-13 20:19:33 Domino - Live fast, die young
17:09:36 T:2156 DEBUG: Library Data Provider: 2014-06-04 18:11:30 Homefront
17:09:36 T:2156 DEBUG: Library Data Provider: 2014-06-03 13:37:26 Die Brcke von Arnheim
17:09:36 T:2156 DEBUG: Library Data Provider: 2014-05-30 10:06:14 RoboCop
17:09:36 T:2156 DEBUG: Library Data Provider: 2014-05-26 15:31:40 Zulu
17:09:36 T:2156 DEBUG: Library Data Provider: 2014-05-22 07:57:55 Buddy
17:09:36 T:2156 DEBUG: Library Data Provider: 2014-05-16 22:56:23 Jack Ryan: Shadow Recruit
17:09:36 T:2156 DEBUG: Library Data Provider: 2014-05-16 21:27:49 12 Years a Slave
17:09:36 T:2156 DEBUG: Library Data Provider: 2014-05-07 11:28:13 Fack ju Ghte
17:09:36 T:2156 DEBUG: Library Data Provider: 2014-05-03 16:41:32 Monuments Men - Ungewhnliche Helden
17:09:36 T:2156 DEBUG: Library Data Provider: 2014-04-29 16:39:27 Machete Kills
17:09:36 T:2156 DEBUG: Library Data Provider: 2014-04-25 15:51:46 Tokarev - Die Vergangenheit stirbt niemals
17:09:36 T:2156 DEBUG: Library Data Provider: 2014-03-28 01:53:13 Malavita - The Family
17:09:36 T:2156 DEBUG: Library Data Provider: 2014-03-26 03:33:31 Smokin' Aces
17:09:36 T:2156 DEBUG: Library Data Provider: 2014-03-18 13:02:48 Bad Country
17:09:36 T:2156 DEBUG: Library Data Provider: 2014-03-08 11:28:35 Escape Plan
17:09:36 T:2156 DEBUG: Library Data Provider: 2014-03-07 08:05:57 Captain Phillips
17:09:36 T:2156 DEBUG: Library Data Provider: 2014-03-06 01:56:17 Rush - Alles fr den Sieg
17:09:36 T:2156 DEBUG: Library Data Provider: 2014-02-25 21:21:40 22 Bullets
I added "Smokin Aces" on the 1. July. But... I also noticed that the "Last modified" date (Windows Explorer) displays the same date that the script has fetched.
Which date does the script use? The date when it was added to the library OR the "last modified" date of the file in the system itself?
Edit:
Checked each recently added movie. All of them have older "last modified" dates. That's why the script won't display it. Can this be changed that the script will use the date when the item was added to the database?
The script sorts by the 'dateadded' property of the library item - XBMC sets that property to the modified date of the file when it's added to the library, nothing to do with the script, and I'm not aware of any 'dateaddedtolibrary' (for example) property that could be used instead.
As this doesn't appear to be a script issue, I'm going to go ahead and close this - feel free to reopen if you have more info on the problem, or find a situation where the script isn't sorting by the data provided by XBMC correctly :)