Add support for displaying the year; put the album in italics. (Feature request...
authorJoshua Wise <joshua@h2so4.joshuawise.com>
Tue, 23 Mar 2010 02:06:50 +0000 (22:06 -0400)
committerJoshua Wise <joshua@h2so4.joshuawise.com>
Tue, 23 Mar 2010 02:06:50 +0000 (22:06 -0400)
player/index.php
std/base.css
std/command.js

index 56588e7..fa6d768 100644 (file)
@@ -63,7 +63,7 @@
        <div class='pc_artist' >
                <p class='disp'><span id='disp_title'></span><br/></p>
                <p class='disp' ><span id='disp_artist'></span><br/></p>
-               <p class='disp'><span id='disp_album'></span><br/></p>
+               <p class='disp'><span id='disp_album'></span> <span id='disp_year'></span><br/></p>
        </div>
 
        <div class='pc_ci' >
index 074ddb5..cbfc3cb 100644 (file)
@@ -6,11 +6,15 @@ a {
        text-decoration: none;
 }
 
-tr, td, #disp_artist, #disp_album, #disp_info, p.disp, img.thumbnailart {
+tr, td, #disp_artist, #disp_album, #disp_info, #disp_year, p.disp, img.thumbnailart {
        padding: 0px;
        margin: 0px;
 }
 
+#disp_album {
+       font-style: italic;
+}
+
 .main_container {
        padding-left: 5px;
        padding-bottom: 10px; 
index 7d7bd33..8db64d1 100644 (file)
@@ -41,6 +41,7 @@ playing.pl_size = 0;
 playing.size = 0;
 playing.artist = "";
 playing.album = "";
+playing.year = "";
 playing.title = "";
 playing.image = "";    // 
 playing.asin = "";     
@@ -66,6 +67,7 @@ playing.pp_button = null;
 playing.disp_artist = null;
 playing.disp_title = null; 
 playing.disp_album = null;
+playing.disp_year = null;
 playing.albumart = null;
 
 var last_pl_selected = true;
@@ -127,6 +129,7 @@ function init_player() {
                playing.disp_artist = document.getElementById('disp_artist');
                playing.disp_title = document.getElementById('disp_title');
                playing.disp_album = document.getElementById('disp_album');
+               playing.disp_year = document.getElementById('disp_year');
                playing.albumart = document.getElementById("albumart");
                playing.pp_button = document.getElementById("pp_button");
 
@@ -474,11 +477,14 @@ function request_song_info() {
                remove_children(playing.disp_artist);
                remove_children(playing.disp_title);
                remove_children(playing.disp_album);
+               if(playing.disp_year)
+                       remove_children(playing.disp_year);
                if(playing.albumart)
                        remove_children(playing.albumart);
                playing.artist = "";
                playing.title = "";
                playing.album = "";
+               playing.year = "";
                playing.image = "";
                playing.asin = "";
                playing.length = "";
@@ -495,9 +501,11 @@ function update_current_song(info) {
        var artist = info[ "Artist"];
        var title = info["Title"];
        var album = info[ "Album"];
+       var year = (info["Year"] == null) ? info["Date"] : info["Year"];
        var a = playing.disp_artist;
        var t = playing.disp_title;
        var alb = playing.disp_album;
+       var y = playing.disp_year;
        var new_thumb = false;
 
        if(typeof(title)=='undefined')
@@ -506,6 +514,10 @@ function update_current_song(info) {
                album = "";
        if(typeof(artist)=='undefined')
                artist = "";
+       if(typeof(year)=='undefined')
+               year = "";
+       else
+               year = "["+year+"]";
 
        if(artist!=playing.artist) {
                playing.artist = artist;
@@ -519,6 +531,12 @@ function update_current_song(info) {
                remove_children(alb);
                alb.appendChild(create_txt(album));
        }
+       if((playing.year != year) && y) {
+               playing.year = year;
+               new_thumb = true;
+               remove_children(y);
+               y.appendChild(create_txt(year));
+       }
 
        if(typeof(info['file'])!='undefined') {
                var f = info['file'];
This page took 0.019029 seconds and 4 git commands to generate.