Sort All Movies By Descending Year
Hello,
This is not exactly an issue, but I noticed that people were adding enhancement requests here so I took my chances.
My movie library is really huge and I add content every day. Obviously I tend to watch new released movies first, so I wanted to find a way to show the "All Movies" grid sorted by descending year.
After hacking a little I discovered that the URL to show all movies descending is http://server/library/sections/number/all?sort=year:desc
I figured that there was a /all in assets/templates/Movie/NavigationBar.xml so I changed the /all to /all?sort=year and it worked (movies sorted by year), but those were ascending, not descending.
I did not find a way to add :desc because the : is a kind of argument divider (I'm a former developer in really, really old languages :-).
Can someone help me? I found several other ones searching for a way to sort by date and this would help a lot.
Thank you all
f = urllib2.urlopen("http://server/library/sections/number/all?sort=year:desc") should do the trick... maybe?
Pulled from http://stackoverflow.com/questions/12704526/how-do-i-fetch-htmlcode-from-a-url-with-a-colon-in-the-url
Thanks!
Unfortunately the problem I mentioned is within an XML (line 13 of assets/templates/Movie/NavigationBar.xml), not the python code itself. The line is:
<url>{{URL(key::/all:PlexConnect=Movie_{{EVAL('{{VAL($movieview)}}'.replace(' ', ''))}})}}</url>
I cannot add ?sort=year:desc after /all because it "rejects" the colon.
I tried putting everything between single quotes, tried escaping the colon with a backslash, tried replacing the colon with its entity (:) but nothing worked. Still looking for a solution.
I don't know if it will work in this situation, but typically you would use a character's hex value in URL parameters, rather than it's entiry or dec.
Try ?sort=year%3Adesc
Hello,
?sort=year%3Adesc did the trick! Worked like a charm!
Thanks a lot for the hint!!