Page 1 of 2

change default view to "newest"

PostPosted: Sat Mar 12, 2011 8:42 pm
by 3R3
Inspiration by various posters in a feature request here: Set default view to NEWEST instead of random

to have the suggested mod (newest view instead of random view in main tab) not only show up when manually navigating to home.view or when first logging in, but also when staying there refreshing as often as the randow view to keep the newest view almost updated in real-time, follow below instructions acurately!


Backup, stop server, edit files, restart server, clear browser cache, login!

[OPTIONAL]
(to make "newest" appear leftmost in the main tab)
In home.jsp in subsonic/jetty/xxxx/webapp/WEB-INF/jsp find:
Code: Select all
<c:forTokens items="random newest highest frequent recent users" delims=" " var="cat" varStatus="loopStatus">

replace with:
Code: Select all
<c:forTokens items="newest highest frequent recent random users" delims=" " var="cat" varStatus="loopStatus">

save!


[NEEDED]
in index.jsp find:
Code: Select all
<frame name="main" src="nowPlaying.view?" marginwidth="0" marginheight="0">

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

save!


in top.jsp find:
Code: Select all
<td class="logo" style="padding-right:2em"><a href="home.view?" target="main"><img src="<spring:theme code="logoImage"/>" title="${help}" alt=""></a></td>
    <c:if test="${not model.musicFoldersExist}">
        <td style="padding-right:2em">
            <p class="warning"><fmt:message key="top.missing"/></p>
        </td>
    </c:if>
    <td>
        <table><tr align="center">
            <td style="min-width:4em;padding-right:1.5em">
                <a href="home.view?" target="main"><img src="<spring:theme code="homeImage"/>" title="${home}" alt="${home}"></a><br>
                <a href="home.view?" target="main">${home}</a>

replace with:
Code: Select all
<td class="logo" style="padding-right:2em"><a href="home.view?listSize=10&listType=newest" target="main"><img src="<spring:theme code="logoImage"/>" title="${help}" alt=""></a></td>
    <c:if test="${not model.musicFoldersExist}">
        <td style="padding-right:2em">
            <p class="warning"><fmt:message key="top.missing"/></p>
        </td>
    </c:if>
    <td>
        <table><tr align="center">
            <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}"></a><br>
                <a href="home.view?listSize=10&listType=newest" target="main">${home}</a>

save!

DONE!
enjoy!

EDIT: works now! :-)
fixed error in code snipped

PostPosted: Tue Mar 15, 2011 8:09 pm
by benzubi
hey

I try to use this but I can't find the line

Code: Select all
<frame name="main" src="home.view?" marginwidth="0" marginheight="0">


in my index.jsp

weird :shock:

PostPosted: Tue Mar 15, 2011 8:17 pm
by 3R3
benzubi wrote:hey

I try to use this but I can't find the line

Code: Select all
<frame name="main" src="home.view?" marginwidth="0" marginheight="0">


in my index.jsp

weird :shock:

That IS weird, as this file defines the main frameset and only contains some 27 lines. Have you tried looking by hand/eye? In my case its line 16, you should really be able to find it.

PostPosted: Tue Mar 15, 2011 9:49 pm
by benzubi
Take a look at my file :oops:

/var/subsonic/jetty/2169/webapp/WEB-INF/jsp/index.jsp

MOD: Removed pic link as no longer showing correct image

Am I blind or did I miss somthing?

PostPosted: Wed Mar 16, 2011 1:16 am
by 3R3
nope I'm sorry. I was stupid and forgot I had edited the "nowPlaying.view" to "main.view". Use that line and it should work just fine. The line with "name="main" src="nowPlaying.view" it is.

PostPosted: Wed Mar 16, 2011 8:58 am
by benzubi
ok :)

works fine indeed.

this feature should be in the next release, it's so nice to have new stuff as home page when using it with friends!

PostPosted: Tue Apr 19, 2011 12:32 am
by cyclopes
Nice 8)

PostPosted: Sun Jul 24, 2011 6:00 pm
by Hellscream
Awesome work working fine +1 :D

PostPosted: Tue Jul 26, 2011 10:27 pm
by mudsharkymon
Does this tweak :

1) Differentiate NEW from MODIFIED? If I select New I do not want to see modified entries come up!
2) work on version 3.7?

Thx!

PostPosted: Tue Jul 26, 2011 10:38 pm
by Hellscream
If you modify files inside folders nothing will be registered, but if you change folder it will be shown as new in your library. About version 3.7 i think it will work fine just back up before u change anything.

Re: change default view to "newest"

PostPosted: Wed Nov 30, 2011 5:00 am
by boognish43
does this still work? I cant find the code in the top.jsp

Re: change default view to "newest"

PostPosted: Wed Nov 30, 2011 2:23 pm
by BKKKPewsey
boognish43 wrote:does this still work? I cant find the code in the top.jsp

Where does it say edit top.jsp :?

Re: change default view to "newest"

PostPosted: Wed Nov 30, 2011 4:52 pm
by boognish43
3R3 wrote:Inspiration by various posters in a feature request here: Set default view to NEWEST instead of random

in top.jsp find:
Code: Select all
<td class="logo" style="padding-right:2em"><a href="home.view?" target="main"><img src="<spring:theme code="logoImage"/>" title="${help}" alt=""></a></td>
    <c:if test="${not model.musicFoldersExist}">
        <td style="padding-right:2em">
            <p class="warning"><fmt:message key="top.missing"/></p>
        </td>
    </c:if>
    <td>
        <table><tr align="center">
            <td style="min-width:4em;padding-right:1.5em">
                <a href="home.view?" target="main"><img src="<spring:theme code="homeImage"/>" title="${home}" alt="${home}"></a><br>
                <a href="home.view?" target="main">${home}</a>

replace with:
Code: Select all
<td class="logo" style="padding-right:2em"><a href="home.view?listSize=10&listType=newest" target="main"><img src="<spring:theme code="logoImage"/>" title="${help}" alt=""></a></td>
    <c:if test="${not model.musicFoldersExist}">
        <td style="padding-right:2em">
            <p class="warning"><fmt:message key="top.missing"/></p>
        </td>
    </c:if>
    <td>
        <table><tr align="center">
            <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}"></a><br>
                <a href="home.view?listSize=10&listType=newest" target="main">${home}</a>

save!

DONE!
enjoy!

EDIT: works now! :-)
fixed error in code snipped


In the original post.. am I missing something?

Re: change default view to "newest"

PostPosted: Wed Nov 30, 2011 5:05 pm
by BKKKPewsey
:P I think we both need new glasses 8)
Yes you are right but I just checked my top.jsp file (4.6beta2) and the code is there.

Code: Select all
<td class="logo" style="padding-right:2em"><a href="help.view?" target="main"><img src="<spring:theme code="logoImage"/>" title="${help}" alt=""></a></td>

    <c:if test="${not model.musicFoldersExist}">
        <td style="padding-right:2em">
            <p class="warning"><fmt:message key="top.missing"/></p>
        </td>
    </c:if>

    <td>
        <table><tr align="center">
            <td style="min-width:4em;padding-right:1.5em">
                <a href="home.view?" target="main"><img src="<spring:theme code="homeImage"/>" title="${home}" alt="${home}"></a><br>
                <a href="home.view?" target="main">${home}</a>
            </td>
            <td style="min-width:4em;padding-right:1.5em">
                <a href="nowPlaying.view?" target="main"><img src="<spring:theme code="nowPlayingImage"/>" title="${nowPlaying}" alt="${nowPlaying}"></a><br>
                <a href="nowPlaying.view?" target="main">${nowPlaying}</a>
            </td>


:mrgreen:

Re: change default view to "newest"

PostPosted: Tue Dec 06, 2011 8:11 pm
by inajar
Thanks a lot for this!