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

Need help? Post your questions here.

Moderator: moderators

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

Postby othello » Mon Aug 10, 2009 1:36 pm

I would like to set 15 or 20 instead of 10.

any help?
User avatar
othello
 
Posts: 14
Joined: Fri Feb 06, 2009 7:33 pm
Location: Charlotte

Postby 3R3 » Sat Aug 15, 2009 10:31 pm

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
User avatar
3R3
 
Posts: 332
Joined: Mon May 04, 2009 2:09 pm
Location: Germany

Postby othello » Sun Aug 23, 2009 7:11 pm

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?
User avatar
othello
 
Posts: 14
Joined: Fri Feb 06, 2009 7:33 pm
Location: Charlotte

Postby 3R3 » Thu Aug 27, 2009 11:32 pm

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
User avatar
3R3
 
Posts: 332
Joined: Mon May 04, 2009 2:09 pm
Location: Germany

Postby othello » Thu Jul 22, 2010 4:19 am

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!
User avatar
othello
 
Posts: 14
Joined: Fri Feb 06, 2009 7:33 pm
Location: Charlotte

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

Postby precipitous » Thu Jul 22, 2010 1:48 pm

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...
User avatar
precipitous
 
Posts: 91
Joined: Fri Aug 14, 2009 6:43 pm
Location: Santa Barbara CA USA

Postby othello » Thu Jul 22, 2010 5:55 pm

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.
User avatar
othello
 
Posts: 14
Joined: Fri Feb 06, 2009 7:33 pm
Location: Charlotte

Postby othello » Thu Jul 22, 2010 5:59 pm

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.
User avatar
othello
 
Posts: 14
Joined: Fri Feb 06, 2009 7:33 pm
Location: Charlotte

Postby swocoom » Thu Dec 23, 2010 11:17 pm

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.
swocoom
 
Posts: 11
Joined: Wed May 19, 2010 2:52 pm

Postby othello » Sun Dec 26, 2010 1:11 am

OR you can just do what i figured out here and do it without having to recompile anything or dick around with the java.
User avatar
othello
 
Posts: 14
Joined: Fri Feb 06, 2009 7:33 pm
Location: Charlotte

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

Postby operat0r » Wed Sep 22, 2021 7:21 pm

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 …
operat0r
 
Posts: 18
Joined: Thu Aug 07, 2014 3:20 am

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

Postby thechez » Sun Dec 26, 2021 11:24 pm

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).
thechez
 
Posts: 11
Joined: Sun Dec 28, 2014 2:43 am


Return to Help

Who is online

Users browsing this forum: No registered users and 4 guests