http://wiki.webos-internals.org/index.php?title=Patch_MediaPlayer_Ignore_%27A%27,_%27An%27,_and_%27The%27_In_Artist_and_Album_names&feed=atom&action=history
Patch MediaPlayer Ignore 'A', 'An', and 'The' In Artist and Album names - Revision history
2024-03-29T02:07:39Z
Revision history for this page on the wiki
MediaWiki 1.35.1
http://wiki.webos-internals.org/index.php?title=Patch_MediaPlayer_Ignore_%27A%27,_%27An%27,_and_%27The%27_In_Artist_and_Album_names&diff=6637&oldid=prev
Jhoff80 at 21:45, 23 October 2009
2009-10-23T21:45:47Z
<p></p>
<table class="diff diff-contentalign-left diff-editfont-monospace" data-mw="interface">
<col class="diff-marker" />
<col class="diff-content" />
<col class="diff-marker" />
<col class="diff-content" />
<tr class="diff-title" lang="en">
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">← Older revision</td>
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">Revision as of 21:45, 23 October 2009</td>
</tr><tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l219" >Line 219:</td>
<td colspan="2" class="diff-lineno">Line 219:</td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div></nowiki></pre></div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div></nowiki></pre></div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td></tr>
<tr><td class='diff-marker'>−</td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>Old Patches, line numbers incorrect for 1.2.1</div></td><td class='diff-marker'>+</td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins class="diffchange diffchange-inline">'''</ins>Old Patches, line numbers incorrect for 1.2.1<ins class="diffchange diffchange-inline">'''</ins></div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>Thankfully, a few simple code changes fix this.</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>Thankfully, a few simple code changes fix this.</div></td></tr>
</table>
Jhoff80
http://wiki.webos-internals.org/index.php?title=Patch_MediaPlayer_Ignore_%27A%27,_%27An%27,_and_%27The%27_In_Artist_and_Album_names&diff=6636&oldid=prev
Jhoff80 at 21:31, 23 October 2009
2009-10-23T21:31:02Z
<p></p>
<a href="http://wiki.webos-internals.org/index.php?title=Patch_MediaPlayer_Ignore_%27A%27,_%27An%27,_and_%27The%27_In_Artist_and_Album_names&diff=6636&oldid=5979">Show changes</a>
Jhoff80
http://wiki.webos-internals.org/index.php?title=Patch_MediaPlayer_Ignore_%27A%27,_%27An%27,_and_%27The%27_In_Artist_and_Album_names&diff=5979&oldid=prev
Jhoff80 at 07:34, 29 September 2009
2009-09-29T07:34:36Z
<p></p>
<table class="diff diff-contentalign-left diff-editfont-monospace" data-mw="interface">
<col class="diff-marker" />
<col class="diff-content" />
<col class="diff-marker" />
<col class="diff-content" />
<tr class="diff-title" lang="en">
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">← Older revision</td>
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">Revision as of 07:34, 29 September 2009</td>
</tr><tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l1" >Line 1:</td>
<td colspan="2" class="diff-lineno">Line 1:</td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>{{template:patch}}</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>{{template:patch}}</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td></tr>
<tr><td class='diff-marker'>−</td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>'''Works in 1.<del class="diffchange diffchange-inline">1</del>, but <del class="diffchange diffchange-inline">might </del>need to check line numbers. I instead used the context of the patch to get this working.'''</div></td><td class='diff-marker'>+</td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>'''Works in 1.<ins class="diffchange diffchange-inline">2</ins>, but need to check line numbers<ins class="diffchange diffchange-inline">, which are incorrect</ins>. I instead used the context of the patch to get this working.'''</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>The Pre's default music player does not treat artists and albums beginning with 'A', 'An', or 'The' with any special consideration. Thus 'The Killers' shows up under the 'T' section in your list of artists, or an album such as 'The Colour and The Shape' also resides under 'T' in an album title listing.</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>The Pre's default music player does not treat artists and albums beginning with 'A', 'An', or 'The' with any special consideration. Thus 'The Killers' shows up under the 'T' section in your list of artists, or an album such as 'The Colour and The Shape' also resides under 'T' in an album title listing.</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td></tr>
</table>
Jhoff80
http://wiki.webos-internals.org/index.php?title=Patch_MediaPlayer_Ignore_%27A%27,_%27An%27,_and_%27The%27_In_Artist_and_Album_names&diff=4246&oldid=prev
Hopspitfire: Ignore 'A', 'An', and 'The' In Artist and Album names moved to Patch MediaPlayer Ignore 'A', 'An', and 'The' In Artist and Album names: app specific patch
2009-08-12T04:08:33Z
<p><a href="/wiki/Ignore_%27A%27,_%27An%27,_and_%27The%27_In_Artist_and_Album_names" class="mw-redirect" title="Ignore 'A', 'An', and 'The' In Artist and Album names">Ignore 'A', 'An', and 'The' In Artist and Album names</a> moved to <a href="/wiki/Patch_MediaPlayer_Ignore_%27A%27,_%27An%27,_and_%27The%27_In_Artist_and_Album_names" title="Patch MediaPlayer Ignore 'A', 'An', and 'The' In Artist and Album names">Patch MediaPlayer Ignore 'A', 'An', and 'The' In Artist and Album names</a>: app specific patch</p>
<table class="diff diff-contentalign-left diff-editfont-monospace" data-mw="interface">
<tr class="diff-title" lang="en">
<td colspan="1" style="background-color: #fff; color: #202122; text-align: center;">← Older revision</td>
<td colspan="1" style="background-color: #fff; color: #202122; text-align: center;">Revision as of 04:08, 12 August 2009</td>
</tr><tr><td colspan="2" class="diff-notice" lang="en"><div class="mw-diff-empty">(No difference)</div>
</td></tr></table>
Hopspitfire
http://wiki.webos-internals.org/index.php?title=Patch_MediaPlayer_Ignore_%27A%27,_%27An%27,_and_%27The%27_In_Artist_and_Album_names&diff=4195&oldid=prev
Jhoff80 at 03:30, 11 August 2009
2009-08-11T03:30:22Z
<p></p>
<table class="diff diff-contentalign-left diff-editfont-monospace" data-mw="interface">
<col class="diff-marker" />
<col class="diff-content" />
<col class="diff-marker" />
<col class="diff-content" />
<tr class="diff-title" lang="en">
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">← Older revision</td>
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">Revision as of 03:30, 11 August 2009</td>
</tr><tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l1" >Line 1:</td>
<td colspan="2" class="diff-lineno">Line 1:</td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>{{template:patch}}</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>{{template:patch}}</div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;"></ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;">'''Works in 1.1, but might need to check line numbers. I instead used the context of the patch to get this working.'''</ins></div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>The Pre's default music player does not treat artists and albums beginning with 'A', 'An', or 'The' with any special consideration. Thus 'The Killers' shows up under the 'T' section in your list of artists, or an album such as 'The Colour and The Shape' also resides under 'T' in an album title listing.</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>The Pre's default music player does not treat artists and albums beginning with 'A', 'An', or 'The' with any special consideration. Thus 'The Killers' shows up under the 'T' section in your list of artists, or an album such as 'The Colour and The Shape' also resides under 'T' in an album title listing.</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td></tr>
</table>
Jhoff80
http://wiki.webos-internals.org/index.php?title=Patch_MediaPlayer_Ignore_%27A%27,_%27An%27,_and_%27The%27_In_Artist_and_Album_names&diff=3678&oldid=prev
Hopspitfire at 08:56, 3 August 2009
2009-08-03T08:56:06Z
<p></p>
<table class="diff diff-contentalign-left diff-editfont-monospace" data-mw="interface">
<col class="diff-marker" />
<col class="diff-content" />
<col class="diff-marker" />
<col class="diff-content" />
<tr class="diff-title" lang="en">
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">← Older revision</td>
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">Revision as of 08:56, 3 August 2009</td>
</tr><tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l1" >Line 1:</td>
<td colspan="2" class="diff-lineno">Line 1:</td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;">{{template:patch}}</ins></div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>The Pre's default music player does not treat artists and albums beginning with 'A', 'An', or 'The' with any special consideration. Thus 'The Killers' shows up under the 'T' section in your list of artists, or an album such as 'The Colour and The Shape' also resides under 'T' in an album title listing.</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>The Pre's default music player does not treat artists and albums beginning with 'A', 'An', or 'The' with any special consideration. Thus 'The Killers' shows up under the 'T' section in your list of artists, or an album such as 'The Colour and The Shape' also resides under 'T' in an album title listing.</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td></tr>
</table>
Hopspitfire
http://wiki.webos-internals.org/index.php?title=Patch_MediaPlayer_Ignore_%27A%27,_%27An%27,_and_%27The%27_In_Artist_and_Album_names&diff=1417&oldid=prev
Hopspitfire: New page: The Pre's default music player does not treat artists and albums beginning with 'A', 'An', or 'The' with any special consideration. Thus 'The Killers' shows up under the 'T' section in you...
2009-07-21T22:33:31Z
<p>New page: The Pre's default music player does not treat artists and albums beginning with 'A', 'An', or 'The' with any special consideration. Thus 'The Killers' shows up under the 'T' section in you...</p>
<p><b>New page</b></p><div>The Pre's default music player does not treat artists and albums beginning with 'A', 'An', or 'The' with any special consideration. Thus 'The Killers' shows up under the 'T' section in your list of artists, or an album such as 'The Colour and The Shape' also resides under 'T' in an album title listing.<br />
<br />
Thankfully, a few simple code changes fix this.<br />
<br />
You will need a rooted Pre to apply this patch.<br />
<br />
Start by making the file system writable:<br />
<br />
<pre><nowiki><br />
rootfs_open -w<br />
</nowiki></pre><br />
<br />
We'll begin by change code related to artist names.<br />
<br />
The patch for /usr/palm/applications/com.palm.app.musicplayer/app/views/artists/artist-entry.html<br />
<br />
<pre><nowiki><br />
--- artist-entry.html.bak Tue Jun 16 20:52:00 2009<br />
+++ artist-entry.html Sun Jul 5 03:12:29 2009<br />
@@ -9,7 +9,7 @@<br />
</div><br />
<div class="single-album-art-shill"></div><br />
<div class="title"><br />
- <div class="truncating-text artist-name">#{artistNameFormatted}</div><br />
+ <div class="truncating-text artist-name">#{artistDisplayNameFormatted}</div><br />
</div><br />
</div><br />
</div> <br />
</nowiki></pre><br />
<br />
The patch for /usr/palm/applications/com.palm.app.musicplayer/app/controllers/artists-assistant.js<br />
<br />
<pre><nowiki><br />
--- artists-assistant.js.bak Tue Jun 16 20:52:00 2009<br />
+++ artists-assistant.js Sun Jul 5 03:30:02 2009<br />
@@ -23,7 +23,8 @@<br />
lookahead: 100,<br />
fixedHeightItems: true,<br />
formatters: {<br />
- artistName: Util.artistFormatter<br />
+ artistName: Util.artistFormatter,<br />
+ artistDisplayName: Util.artistFormatter<br />
}<br />
};<br />
this.controller.setupWidget('artistslist', model);<br />
@@ -141,8 +142,15 @@<br />
}.bind(this));<br />
},<br />
<br />
+<br />
translateResults: function(filter, widget, offset, response){<br />
<br />
+ function sortByArtistDisplayName(a,b) {<br />
+ var x = a.artistDisplayName.toLowerCase();<br />
+ var y = b.artistDisplayName.toLowerCase();<br />
+ return ((x < y) ? -1 : ((x > y) ? 1 : 0));<br />
+ }<br />
+<br />
if(response.artistsTotal == 0){<br />
this.controller.get('no-items-message').innerHTML = AppAssistant.noItems;<br />
this.controller.get('no-items-message').show();<br />
@@ -155,7 +163,25 @@<br />
var ret = {};<br />
ret.list = response.artists;<br />
ret.total = parseInt(response.artistsTotal);<br />
-<br />
+ for (i = 0; i < ret.list.length; i++) {<br />
+ var artistName = ret.list[i].artistName;<br />
+ if (artistName.toUpperCase().indexOf('THE ') == 0) {<br />
+ ret.list[i].artistDisplayName = artistName.substring(4) + ', ' + artistName.substr(0,3);<br />
+ }<br />
+ else<br />
+ if (artistName.toUpperCase().indexOf('A ') == 0) {<br />
+ ret.list[i].artistDisplayName = artistName.substring(2) + ', ' + artistName.substr(0,1);<br />
+ }<br />
+ else<br />
+ if (artistName.toUpperCase().indexOf('AN ') == 0) {<br />
+ ret.list[i].artistDisplayName = artistName.substring(3) + ', ' + artistName.substr(0,2);<br />
+ }<br />
+ else {<br />
+ ret.list[i].artistDisplayName = artistName;<br />
+ }<br />
+ //Mojo.Log.info(ret.list[i].artistDisplayName);<br />
+ }<br />
+ ret.list.sort(sortByArtistDisplayName);<br />
widget.mojo.noticeUpdatedItems(offset, ret.list);<br />
widget.mojo.setCount(ret.total);<br />
widget.mojo.setLength(ret.total);<br />
@@ -188,7 +214,7 @@<br />
},<br />
<br />
getAlphaGroup: function(item){<br />
- return Util.getAlphaGroup(item.artistName);<br />
+ return Util.getAlphaGroup(item.artistDisplayName);<br />
},<br />
<br />
THUMB_WIDTH: 80, <br />
</nowiki></pre><br />
<br />
Now we'll patch the files necessary for album names.<br />
<br />
The patch for /usr/palm/applications/com.palm.app.musicplayer/app/views/allalbums/album-entry.html<br />
<br />
<pre><nowiki><br />
--- album-entry.html.bak Sun Jul 5 16:22:02 2009<br />
+++ album-entry.html Sun Jul 5 16:22:27 2009<br />
@@ -8,7 +8,7 @@<br />
</div><br />
<div class="single-album-art-shill"></div><br />
<div class="all-albums title"><br />
- <div class="truncating-text all-albums-album-title">#{albumTitleFormatted}</div><br />
+ <div class="truncating-text all-albums-album-title">#{albumDisplayTitleFormatted}</div><br />
<div class="truncating-text all-albums-album-artist">#{albumArtistFormatted}</div><br />
</div><br />
</div> <br />
</nowiki></pre><br />
<br />
A similar patch for /usr/palm/applications/com.palm.app.musicplayer/app/views/albums/album-entry.html<br />
<br />
<pre><nowiki><br />
--- album-entry.html.bak Sun Jul 5 16:01:02 2009<br />
+++ album-entry.html Sun Jul 5 16:01:25 2009<br />
@@ -7,7 +7,7 @@<br />
</div><br />
<div class="single-album-art-shill"></div><br />
<div class="title"><br />
- <div class="truncating-text albums-album-title">#{albumTitleFormatted}</div><br />
+ <div class="truncating-text albums-album-title">#{albumDisplayTitleFormatted}</div><br />
<!-- <div class="truncating-text albums-album-song-count">#{albumCount}</div> --><br />
</div><br />
</div> <br />
</nowiki></pre><br />
<br />
For /usr/palm/applications/com.palm.app.musicplayer/app/controllers/albums-assistant.js<br />
<br />
<pre><nowiki><br />
--- albums-assistant.js.bak Sun Jul 5 16:01:46 2009<br />
+++ albums-assistant.js Sun Jul 5 16:14:41 2009<br />
@@ -24,6 +24,7 @@<br />
fixedHeightItems : true,<br />
formatters: {<br />
albumTitle: Util.albumFormatter,<br />
+ albumDisplayTitle: Util.albumFormatter,<br />
albumPictureUrl: Util.albumArtListUrlFormatter<br />
}<br />
};<br />
@@ -118,6 +119,12 @@<br />
<br />
<br />
translateResults : function(filter, widget, offset, response){<br />
+<br />
+ function sortByAlbumDisplayTitle(a,b) {<br />
+ var x = a.albumDisplayTitle.toLowerCase();<br />
+ var y = b.albumDisplayTitle.toLowerCase();<br />
+ return ((x < y) ? -1 : ((x > y) ? 1 : 0));<br />
+ }<br />
<br />
if(response.albums.length == 0){<br />
this.controller.get('playAllAlbums').hide();<br />
@@ -132,6 +139,26 @@<br />
var ret = {};<br />
ret.list = response.albums;<br />
ret.total = parseInt(response.albumsTotal);<br />
+<br />
+ for (i = 0; i < ret.list.length; i++) {<br />
+ var albumTitle = ret.list[i].albumTitle;<br />
+ if (albumTitle.toUpperCase().indexOf('THE ') == 0) {<br />
+ ret.list[i].albumDisplayTitle = albumTitle.substring(4) + ', ' + albumTitle.substr(0,3);<br />
+ }<br />
+ else<br />
+ if (albumTitle.toUpperCase().indexOf('A ') == 0) {<br />
+ ret.list[i].albumDisplayTitle = albumTitle.substring(2) + ', ' + albumTitle.substr(0,1);<br />
+ }<br />
+ else<br />
+ if (albumTitle.toUpperCase().indexOf('AN ') == 0) {<br />
+ ret.list[i].albumDisplayTitle = albumTitle.substring(3) + ', ' + albumTitle.substr(0,2);<br />
+ }<br />
+ else {<br />
+ ret.list[i].albumDisplayTitle = albumTitle;<br />
+ }<br />
+ //Mojo.Log.info(ret.list[i].albumDisplayTitle);<br />
+ }<br />
+ ret.list.sort(sortByAlbumDisplayTitle);<br />
<br />
Util.setZOrder(ret.list, offset); <br />
</nowiki></pre><br />
<br />
For /usr/palm/applications/com.palm.app.musicplayer/app/controllers/allalbums-assistant.js<br />
<br />
<pre><nowiki><br />
--- allalbums-assistant.js.bak Sun Jul 5 16:23:16 2009<br />
+++ allalbums-assistant.js Sun Jul 5 16:26:22 2009<br />
@@ -26,6 +26,7 @@<br />
fixedHeightItems : true,<br />
formatters: {<br />
albumTitle: Util.albumFormatter,<br />
+ albumDisplayTitle: Util.albumFormatter,<br />
albumArtist: Util.artistFormatter,<br />
albumPictureUrl: Util.albumArtListUrlFormatter<br />
}<br />
@@ -181,6 +182,12 @@<br />
<br />
<br />
translateResults : function(filter, widget, offset, response){<br />
+<br />
+ function sortByAlbumDisplayTitle(a,b) {<br />
+ var x = a.albumDisplayTitle.toLowerCase();<br />
+ var y = b.albumDisplayTitle.toLowerCase();<br />
+ return ((x < y) ? -1 : ((x > y) ? 1 : 0));<br />
+ }<br />
<br />
if(response.albums.length == 0){<br />
this.controller.get('no-items-message').innerHTML = AppAssistant.noItems;<br />
@@ -193,6 +200,26 @@<br />
var ret = {};<br />
ret.list = response.albums;<br />
ret.total = parseInt(response.albumsTotal);<br />
+<br />
+ for (i = 0; i < ret.list.length; i++) {<br />
+ var albumTitle = ret.list[i].albumTitle;<br />
+ if (albumTitle.toUpperCase().indexOf('THE ') == 0) {<br />
+ ret.list[i].albumDisplayTitle = albumTitle.substring(4) + ', ' + albumTitle.substr(0,3);<br />
+ }<br />
+ else<br />
+ if (albumTitle.toUpperCase().indexOf('A ') == 0) {<br />
+ ret.list[i].albumDisplayTitle = albumTitle.substring(2) + ', ' + albumTitle.substr(0,1);<br />
+ }<br />
+ else<br />
+ if (albumTitle.toUpperCase().indexOf('AN ') == 0) {<br />
+ ret.list[i].albumDisplayTitle = albumTitle.substring(3) + ', ' + albumTitle.substr(0,2);<br />
+ }<br />
+ else {<br />
+ ret.list[i].albumDisplayTitle = albumTitle;<br />
+ }<br />
+ //Mojo.Log.info(ret.list[i].albumDisplayTitle);<br />
+ }<br />
+ ret.list.sort(sortByAlbumDisplayTitle);<br />
<br />
Util.setZOrder(ret.list, offset);<br />
<br />
@@ -211,7 +238,7 @@<br />
},<br />
<br />
getAlphaGroup: function(item){<br />
- return Util.getAlphaGroup(item.albumTitle);<br />
+ return Util.getAlphaGroup(item.albumDisplayTitle);<br />
}<br />
}); <br />
</nowiki></pre><br />
<br />
<br />
That's it!<br />
<br />
Now lock the file system:<br />
<br />
<pre><nowiki><br />
mount -o remount,ro /<br />
</nowiki></pre><br />
<br />
And restart LunaSysMgr to apply the changes:<br />
<br />
<pre><nowiki><br />
luna-send -n 1 palm://com.palm.applicationManager/rescan {}<br />
</nowiki></pre></div>
Hopspitfire