This is a fix for something that has bugged me ever since I use XBMC. When I'm e.g. in the tvshow view and have "Hide Watched" enabled and there's only a single episode left in a season (or the whole show) and I either watch that episode or mark it as watched, the item is removed from the list leaving me with an empty view. With this change we go to the parent folder until we find a list that is not empty. It also solves the problem described in #634 but in a more general approach (i.e. not tvshow/season specific).
A few notes:
@jmarshallnz I added an additional check of empty paths before calling GoParentFolder() recursively.
Squashed down and waiting for sign-off.
media library: avoid empty listings after an update/refresh by going …
…one level up in the hierarchy
Is it correct when I'm at TV SHOWs and it does an "up one level" to MOVIES when list is empty?
It should up on level to tv show, isn't? Not to movies
That sounds odd. Can you provide a log? Please create a thread in the forum and post the problem + the debug log there and post the URL to the thread here.
Oh, I could’t reproduce it anymore
When I did happen my movie library was empty (only tv-shows).
Now there’s movies and that didn't happened again
When a tv-show with only 1 episode ends, I shows the episode detail with a “seen” mark and don’t go back to the list of TV-shows. I have no filters. I'm using media-info view.
Is this what is supposed to do?
This happened to me once as well (episode being marked as watched but not vanishing) but wasn't able to reproduce. I think the watched filter isn't properly applied in that case and obviously the logic from this PR doesn't kick in as long as there's at least one item in the list so that is not a problem with this logic but with either the update or the hide watched logic.
Why don't you force a update/refresh/hide watched process on the tv-show in your code/logic?
Your idea is great.
That wouldn't make any sense. This logic is written to be invoked whenever an update/refresh has just been performed. Triggering an update/refresh in this logic is a) the wrong place and b) might result in an infinite loop.