Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gene1wood/73805f1bf1d4fd8909f9 to your computer and use it in GitHub Desktop.
Save gene1wood/73805f1bf1d4fd8909f9 to your computer and use it in GitHub Desktop.
This will patch Subsonic 4.9 to change the default view from Random to Recently Added
mkdir workspace
cd workspace
sudo cp /usr/share/subsonic/subsonic.war /usr/share/subsonic/subsonic.war.orig
unzip /usr/share/subsonic/subsonic.war
dos2unix WEB-INF/jsp/top.jsp # These dos2unix and unix2dos steps are needed because the files have DOS
dos2unix WEB-INF/jsp/index.jsp # line endings and the patches, if copy/pasted have UNIX line endings
cat > change-default-view-to-newest.patch <<'End-of-message'
diff -ru orig/WEB-INF/jsp/index.jsp new/WEB-INF/jsp/index.jsp
--- orig/WEB-INF/jsp/index.jsp 2014-01-23 23:07:04.000000000 -0800
+++ new/WEB-INF/jsp/index.jsp 2014-08-11 09:59:33.000000000 -0700
@@ -13,7 +13,7 @@
<frameset rows="75%,25%" border="0" framespacing="0" frameborder="0">
<frameset cols="*,${model.showRight ? 235 : 0}" border="0" framespacing="0" frameborder="0">
- <frame name="main" src="nowPlaying.view?" marginwidth="0" marginheight="0" class="bgcolor1">
+ <frame name="main" src="home.view?listSize=10&listType=newest" marginwidth="0" marginheight="0" class="bgcolor1">
<frame name="right" src="right.view?" class="bgcolor1">
</frameset>
<frame name="playQueue" src="playQueue.view?" class="bgcolor2">
@@ -23,4 +23,4 @@
</frameset>
-</html>
\ No newline at end of file
+</html>
diff -ru orig/WEB-INF/jsp/top.jsp new/WEB-INF/jsp/top.jsp
--- orig/WEB-INF/jsp/top.jsp 2013-12-14 22:24:56.000000000 -0800
+++ new/WEB-INF/jsp/top.jsp 2014-08-11 09:59:56.000000000 -0700
@@ -38,8 +38,8 @@
<a href="help.view?" target="main"><img src="<spring:theme code="logoImage"/>" title="${help}" alt=""></a>
</td>
<td style="min-width:4em;padding-right:2em;text-align: center">
- <a href="home.view?" target="main"><img src="<spring:theme code="homeImage"/>" title="${home}" alt="${home}"></a>
- <div class="topHeader"><a href="home.view?" target="main">${home}</a></div>
+ <a href="home.view?listSize=10&listType=newest" target="main"><img src="<spring:theme code="homeImage"/>" title="${home}" alt="${home}"></a>
+ <div class="topHeader"><a href="home.view?listSize=10&listType=newest" target="main">${home}</a></div>
</td>
<td style="min-width:4em;padding-right:2em;text-align: center">
<a href="nowPlaying.view?" target="main"><img src="<spring:theme code="nowPlayingImage"/>" title="${nowPlaying}" alt="${nowPlaying}"></a>
@@ -100,4 +100,4 @@
</tr></table>
-</body></html>
\ No newline at end of file
+</body></html>
End-of-message
patch -p1 -i change-default-view-to-newest.patch && rm change-default-view-to-newest.patch
unix2dos WEB-INF/jsp/top.jsp
unix2dos WEB-INF/jsp/index.jsp
sudo /sbin/service subsonic stop
sudo zip -r /usr/share/subsonic/subsonic.war ./
sudo /sbin/service subsonic start
@gene1wood
Copy link
Author

Tested and works on

  • Subsonic 4.9
  • Subsonic 5.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment