MediaBrowser/MediaBrowser — pull request #825 by timhobbs (2014-05-20 06:30:45+00:00)
Title: "Latest" grouping

![image](https://cloud.githubusercontent.com/assets/1144817/3023497/4efb39ac-dfe7-11e3-8402-faf4d70b7899.png)

This groups like media together under the "Latest Media" section. The above image is from the latest TV shows, but I only used that as an example because I don't have a series or album for my home page latest section.

I tried to make sure I tested it out well, but it may not be perfect. Right now, a series will link to the first season page, so that could possibly be a bit confusing if someone adds multiple seasons at once. However, for those that are complaining, I think they'll prefer this. Also, if you want to watch, you probably want to start at the "beginning" for whatever you added

For music it will link to the album. This should be okay, but I did not have a way to test out to make sure the latest album stuff works (again, nothing in my latest). So this is only theoretical support at this time, but maybe we can get it in for a dev release to have the testers bang on it.

Oh yeah, the grouping stuff could potentially make layout off, as in the pic above (only 5 rather than 6 shows). This is because we don't know up front about how many episodes/songs we'll get back that are the same show/album, but we don't want to pull back _too many_ results or it slows things down. So, I pull back a couple hundred or so and then perform the grouping. If there is no need for grouping, it will only hit the first N results in the for loop, then return that list (where N = limit specified).

It seems to perform pretty well with the numbers I put in. Check it out and see what you think.