Page 1 of 1

How can you set the random screen's default number of albums

PostPosted: Mon Aug 10, 2009 1:36 pm
by othello
I would like to set 15 or 20 instead of 10.

any help?

PostPosted: Sat Aug 15, 2009 10:31 pm
by 3R3
I'm not at home right now to check the path, so this is not completely acurate but take a look at "main.jsp" somewhere in your subsonic folder (cant remember the exact path right now, maybe someone else could help me out?)

look for an input field with the value 10 (the current default) and a fitting name (random time etc, dunno)

would the mod please delete this vague post if someone else posts something more acurate? thanks

PostPosted: Sun Aug 23, 2009 7:11 pm
by othello
that didn't turn anything up. the only values that were ten were
onclick="top.playlist.onPlayRandom('${path}', 10)">

and a cell width param. and changing the above to 15 didn't change anything as far as i could tell. i don't think it's main.jsp?

PostPosted: Thu Aug 27, 2009 11:32 pm
by 3R3
sorry for the long wait but its summer^^
now for the real answer...
in "home.jsp" look for
Code: Select all
<c:forTokens items="10 15 20 30 40 50" delims=" " var="size">


subsonic simply uses the first entry of this list as default value, in this case 10.
just reorder it to your liking and you are set. just note that it has to be a power of 5 and not smaller 10, else it will just default to displaying 10 again.

bye

PostPosted: Thu Jul 22, 2010 4:19 am
by othello
sorry it took so long to see your reply- i had given up.

I went into Home.jsp and found this line, but mine read "5 10 15 20 ..." and ten is the default... i tried your fix anyway and then home page still only loaded up ten at a time on random, though the dropdown started at 15 now. i clicked the "see more" link and it loaded up ten again, even though the dropdown was set to 15!

Re: How can you set the random screen's default number of al

PostPosted: Thu Jul 22, 2010 1:48 pm
by precipitous
othello wrote:I would like to set 15 or 20 instead of 10.

any help?


The following information was copied from another forum posting, and covers changing the default view, and the number of albums displayed:

How about an option (global or per user) to change the default view to NEWEST (or whatever other view a user likes) rather than RANDOM.


I don't know if you tried this, but I changed it to "Newest" by modifying "index.jsp" (sorry, previous edit had the wrong file listed) - exchange line 16 with

Code:
<frame name="main" src="home.view?listSize=10&listType=newest" marginwidth="0" marginheight="0">


Where the number after listSize equals the amount of albums shown per page. Granted, this is quick and dirty, but it does the job until this gets included as a feature.

Additionally you could change the reference of the "home" icon on the very top by changing line 30 of "top.jsp" into:

Code:
<td style="min-width:4em;padding-right:1.5em"><a href="home.view?listSize=10&listType=newest" target="main"><img src="<spring:theme code="homeImage"/>" title="${home}" alt="${home}"><br>${home}</a></td>


Also granted, if your user selects a different per page amount using the drop-down menu he/she will always be reverted back to 10 or whatever you set it to when he/she clicks on "home". If you can fiddle a bit with the scripting you can actually use the variable for this option, but that was too much of a headache for me right now... . Shocked

Make sure you make backups and know what you're doing. Smile

Your instructions worked perfectly... Thanks!
I wanted to display the top 15 most frequently played albums, though, so I made a slight edit, and used the following:
Code:

<frame name="main" src="home.view?listSize=15&listType=frequent" marginwidth="0" marginheight="0">

Once again-Thank You!


I hope this helps you...

PostPosted: Thu Jul 22, 2010 5:55 pm
by othello
Neither of these worked. Am I correct to change the listType to "listType=random"? that is what i am doing instead of newest.


it still shows ten albums every time i reload the page or click on home.

PostPosted: Thu Jul 22, 2010 5:59 pm
by othello
ok crucial bit of info left off-

unlike when you change the % on the screen split there, you need to logout and then log back in to see this change take effect.

PostPosted: Thu Dec 23, 2010 11:17 pm
by swocoom
This is actually something that must be changed in the source code. If you know what you are doing, you can edit the HomeController.java file. The listSize variable contains DEFAULT_LIST_SIZE. By default it is set to 10. After you have changed the default size, recompile and replace HomeController.class with the one you just compiled. Make sure you make a backup in case you messed up.

PostPosted: Sun Dec 26, 2010 1:11 am
by othello
OR you can just do what i figured out here and do it without having to recompile anything or dick around with the java.

Re: How can you set the random screen's default number of al

PostPosted: Wed Sep 22, 2021 7:21 pm
by operat0r
So I think the listSize used to work but now it does not as far as I can tell. I can’t tell you how frustrating it is to only have max 50 songs when you have almost 100K songs… I tried in like 15 places for like 4+ hours and it passes the listSize parameter but does nothing… the only solution I found was to use complicated jamstash.com option (not really under active development and I didn’t want to complicate things further..) or the ‘more’ button on the left navigation menu and replace the ‘Shuffle play’ default value 20 with my own…

Replace the 1000 with how ever many you want to load.. This still does not solve the problem of “recent” with more then 50 albums but that’s manageable ..

# script
find / -iname "more.jsp" -exec sed 's/value="20"/value="1000"/g' -i".bk.$RANDOM" '{}' \;

# example changes

https://github.com/freeload101/SCRIPTS/ ... 3615105cea

Things I tried:
• Used Web developer plugin to clear cookies
• Went into settings and deleted all the players
• Restarted subsonic
• It could be a java/class/jsp thing but I don’t want to have to compile any java just for more then 50 songs …

Re: How can you set the random screen's default number of al

PostPosted: Sun Dec 26, 2021 11:24 pm
by thechez
To tack on to this question: is it possible to change the amount of time the random albums display on the main page? They seem to disappear a bit too quick for my taste (or old brain).