brothom 177 Posted July 8, 2025 Posted July 8, 2025 (edited) I'm not sure a feature request for this already exists but I couldn't find any, so here goes. Currently we have sections like "Resume viewing", "Recent movies", "Latest media", etc but these are mostly based on the latest / most recently added items. I would like to see a section based on a specific (or preferably random) genre such as "Best rated Western", "Unwatched Adventure", etc. Looking at the current Search function this should be possible using existing queries. For example: Genres can be fetched using: /Genres?IncludeItemTypes=Movie&Fields=BasicSyncInfo%2CCanDelete%2CCanDownload%2CPrimaryImageAspectRatio&StartIndex=0&SortBy=SortName&SortOrder=Ascending&ParentId=9&EnableImageTypes=Primary%2CBackdrop%2CThumb&ImageTypeLimit=1&Recursive=true&Limit=50 A random Genre ID can be picked using: var items = res.Items; if (res.Items.length) { var randomGenre = res.Items[Math.floor(Math.random()*items.length)]; randomGenre.Id // 51229 } else { // no genres to pick from } Use the random genre name and ID to add sections to the home screen: Sorted Unwatched Science Fiction by Release (Latest Movies in Science Fiction) /Items?IncludeItemTypes=Movie&Fields=BasicSyncInfo%2CCanDelete%2CCanDownload%2CPrimaryImageAspectRatio%2CProductionYear%2CStatus%2CEndDate&StartIndex=0&SortBy=ProductionYear%2CPremiereDate%2CSortName&SortOrder=Descending&ParentId=9&EnableImageTypes=Primary%2CBackdrop%2CThumb&ImageTypeLimit=1&Recursive=true&GenreIds=51229&Filters=IsUnplayed&Limit=50 Sorted Unwatched Science Fiction random (Unwatched Movies in Science Fiction) /Items?IncludeItemTypes=Movie&Fields=BasicSyncInfo%2CCanDelete%2CCanDownload%2CPrimaryImageAspectRatio%2CProductionYear%2CStatus%2CEndDate&StartIndex=0&SortBy=Random&SortOrder=Ascending&ParentId=9&EnableImageTypes=Primary%2CBackdrop%2CThumb&ImageTypeLimit=1&Recursive=true&GenreIds=51229&Filters=IsUnplayed&RandomSeed=5315211&Limit=50 Edited July 8, 2025 by brothom Formatting, making subject and solution more clear.
brothom 177 Posted July 8, 2025 Author Posted July 8, 2025 I've managed to add a new section to the homesections.js called "randommediabygenre". This section first gets the collections and then outputs a slider section for each collection given a random genre id. I'm not sure if it's ok for me to add the section to this forum considering I had to unminify the source and manually set the first section to "always" be the new section.
ebr 16169 Posted July 8, 2025 Posted July 8, 2025 Hi, there's already an open request for this or something functionally equivalent. Please join in and contribute to the existing discussion at:
Recommended Posts