Fix year in playlist

Third-party modifications and add-ons, Apps and Clients

Moderator: moderators

Fix year in playlist

Postby ytechie » Sun Jan 22, 2012 3:28 pm

I don't know if anyone else has the occasional long year (includes date and time) in the playlist, but here is how to limit the year to four places.

We are going to edit playlist.jsp. Here is the part we are going to edit:

Code: Select all
if ($("genre" + id)) {
   dwr.util.setValue("genre" + id, song.genre);
}
if ($("year" + id)) {
   dwr.util.setValue("year" + id, song.year);
}
if ($("bitRate" + id)) {
   dwr.util.setValue("bitRate" + id, song.bitRate);
}


replace the year with

Code: Select all
if ($("year" + id)) {
   if (song.year) {
      dwr.util.setValue("year" + id, song.year.substring(0,4));
   } else {
      dwr.util.setValue("year" + id, song.year);
   }
}


Hope this helps! :D
User avatar
ytechie
 
Posts: 547
Joined: Sun Dec 12, 2010 5:05 am
Location: Manhattan, New York

Re: Fix year in playlist

Postby BKKKPewsey » Sun Jan 22, 2012 5:16 pm

If I remember my substring arguments correctly that will be ok for American users but for the more civilised nations :roll:
who use the dd/mm/yyyy format methinks that will not work :?
Everyone is entitled to be stupid, Image but some abuse the privilege!

Due to the confusion from too many genres of music, we have decided to put both country music and rap music into the genre of Crap music.
User avatar
BKKKPewsey
 
Posts: 2080
Joined: Mon May 23, 2011 12:16 pm
Location: United Kingdom

Re: Fix year in playlist

Postby ytechie » Sun Jan 22, 2012 5:52 pm

Actually, in America we generally use the mm/dd/yyyy format, but I think subsonic deals with UTC timestamps. Check this out: http://en.wikipedia.org/wiki/ISO_8601.
User avatar
ytechie
 
Posts: 547
Joined: Sun Dec 12, 2010 5:05 am
Location: Manhattan, New York

Re: Fix year in playlist

Postby BKKKPewsey » Sun Jan 22, 2012 6:58 pm

Yep it would appear that the tagging programs (well mine is :) ) are using the UTC format when writing the tag info.
So the Mediaplayer/Tagging programs are doing locale conversion automatically - well I'm impressed :D
Hence the tag info - and therefore SS should have the year first so your mod should work for any locale.
I always strip the dd/mm info from my tags at source so it doesn't effect me 8)
Also with 4.6 I notice that SS seems to be stripping the dd/mm info off the year info so perhaps Sindre's beaten you to it :?
Everyone is entitled to be stupid, Image but some abuse the privilege!

Due to the confusion from too many genres of music, we have decided to put both country music and rap music into the genre of Crap music.
User avatar
BKKKPewsey
 
Posts: 2080
Joined: Mon May 23, 2011 12:16 pm
Location: United Kingdom

Re: Fix year in playlist

Postby ytechie » Sun Jan 22, 2012 7:20 pm

Sindre probably has beaten me to it. I still use 4.5, and I actually removed the mod after a few minutes. I like to see the date if it's there. It doesn't really bother me.

Since you're using 4.6, can you tell me if the double track bug still bites?

When you add the same track to the webplayer playlist twice, does the player loop to the first track when finishing the second?
User avatar
ytechie
 
Posts: 547
Joined: Sun Dec 12, 2010 5:05 am
Location: Manhattan, New York

Re: Fix year in playlist

Postby BKKKPewsey » Sun Jan 22, 2012 11:27 pm

Yes it does :(
I notice that if I enter the same track twice in the same playlist the now playing icon appears next to both the duplicated tracks.
So as already described if you have duplicate tracks say in position 1 & 3 it will play track 1 then 2 then 3 then back to 2 (or forward from 1 :? ).
I have never noticed that as my memory isn't that bad :lol: but if you are in the habit of making very long playlists it could be become a problem.
Fortunately for me I use MM to create my playlists and I have it set for no dups even for the auto playlists :)
Everyone is entitled to be stupid, Image but some abuse the privilege!

Due to the confusion from too many genres of music, we have decided to put both country music and rap music into the genre of Crap music.
User avatar
BKKKPewsey
 
Posts: 2080
Joined: Mon May 23, 2011 12:16 pm
Location: United Kingdom

Re: Fix year in playlist

Postby ytechie » Sun Jan 22, 2012 11:44 pm

Unfortunately, I tried to figure out how to fix this issue, but it is not very simple. I know exactly why it happens, but because of the way everything works together, this is difficult to fix. For now. I haven't given up.
User avatar
ytechie
 
Posts: 547
Joined: Sun Dec 12, 2010 5:05 am
Location: Manhattan, New York


Return to Mods, Apps and Clients

Who is online

Users browsing this forum: No registered users and 2 guests