PlexConnect icon indicating copy to clipboard operation
PlexConnect copied to clipboard

Sort All Movies By Descending Year

Open canzone opened this issue 10 years ago • 4 comments

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

canzone avatar Sep 21 '16 03:09 canzone

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

ghost avatar Oct 04 '16 22:10 ghost

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 (&#58;) but nothing worked. Still looking for a solution.

canzone avatar Oct 05 '16 03:10 canzone

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

carlsteinhilber avatar Oct 05 '16 05:10 carlsteinhilber

Hello,

?sort=year%3Adesc did the trick! Worked like a charm!

Thanks a lot for the hint!!

canzone avatar Oct 05 '16 21:10 canzone