joolswills / plugin.video.iplayer

This plugin is broken.
10 stars 4 forks source link

Sort category listing by episode number #164

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Go to Categories / Drama / Crime for example
2.
3.

What is the expected output? What do you see instead?
The episodes within a series are not always sorted by episode number. Not a big 
deal of course, but I do enjoy watching a series in the right order...

Debug log output (http://pastebin.com/)
n/a

What version of the plugin are you using? On what OS?
2.6.10 on raspberry pi (raspbmc kernel 3.2.31)

Please provide any additional information below.

The attached patch is a diff over version 2.6.10:
* lib/listparser.py: include episode number in the title (e.g. "Antiques 
Roadshow: Series 30: 24. De La Warr"), store season number in the "series" field
* default.py: include season number in the XBMC media info, enable sorting by 
title on category listing

I couldn't use XBMC's episode sort method, because then we lose the 
alphabetical order for the series. So instead I included the episode number in 
the title and enabled the sorting by title. Interestingly, XBMC does the right 
and shows episode 10 between 9 and 11, where standing a-z sorting would put it 
between 1 and 2.

One side effect of this is that the channels (BBC1, BBC2 etc) were displayed at 
the top in the category listings, which wasn't very user friendly. So I 
disabled the generation of the channel folders for these listings, there may be 
a better solution.

Original issue reported on code.google.com by blaise.s...@gmail.com on 30 Nov 2014 at 6:24

Attachments:

GoogleCodeExporter commented 9 years ago
thanks for the patch. that was why the sorting was disabled due to the channel 
lists. there is a bug that the channels dont work currently I need to fix - ie, 
when you go to a category, the idea is you can drill it down further by channel.

it might be an idea if removing the channels to add by category to the main 
channel lists as we do with date.

I'm not sure about this solution currently though - it's a lot of additional 
logic for a minor issue imho. I'll have a think about it. 

Original comment by exob...@gmail.com on 30 Nov 2014 at 6:30

GoogleCodeExporter commented 9 years ago
I think I will go with your patch at least partially - we could add a sort 
field though and sort by that by default also. shame xbmc doesn't have a sort 
by series + episode which would mean we don't need to rewrite the titles.

I'm working on some other changes right now, so I'll get back to you. thanks 
again.

Original comment by exob...@gmail.com on 30 Nov 2014 at 8:49

GoogleCodeExporter commented 9 years ago
Great thanks. Now that I think about it, xbmc may well be able to sort as we'd 
like if we set both the "season" and "tvshowtitle" fields in the ItemInfo and 
use the "sort by episode" method. It would still mean some extra logic in 
listparser.py but it may be more palatable. I'll experiment and let you know.

Original comment by blaise.s...@gmail.com on 1 Dec 2014 at 9:33

GoogleCodeExporter commented 9 years ago
In the end I went for a completely different approach. The feeds from Auntie 
are actually properly sorted by series and episode (in descending order); the 
problem is that the block_type=episode parameter loses the episode order. So I 
removed the block_type parameter and added a bit of code to parse the resulting 
json. NB: I didn't update the XML parser as it appears to be dead code. Could 
we remove it? Otherwise I'll refactor listparser accordingly.

I also changed the sort method for the series listings from "episode" to 
"unsorted", since "unsorted" is now sorted thanks to Auntie. Without this 
change, you get "series 2, episode 1"; "series 3, episode 1"; "series 2, 
episode 2" etc.

The attached should patch cleanly into 2.6.10.

Original comment by blaise.s...@gmail.com on 5 Dec 2014 at 8:44

Attachments:

joolswills commented 9 years ago

thanks!