Merge pull request #2 from codenift/artwork

Artwork
This commit is contained in:
Codenift 2019-09-20 13:38:46 -04:00 committed by GitHub
commit 9f3badd1e0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
30 changed files with 913 additions and 173 deletions

View file

@ -126,10 +126,29 @@ function updatePlaybar(){
}
if (currentSong !== null && !master_dj_on_air && !live_dj_on_air){
if (currentSong.record == "1")
if (currentSong.record == "1") {
$('#current').html("<span style='color:red; font-weight:bold'>"+$.i18n._("Recording:")+"</span>"+currentSong.name+",");
else
} else {
$('#current').text(currentSong.name+",");
if (currentSong.metadata.artwork_data) {
var check_current_song = Cookies.get('current_track');
var loaded = Cookies.get('loaded');
if (check_current_song != currentSong.name) {
$('#now-playing-artwork_containter').html("<img height='75' width='75' class'artwork' src='"+ currentSong.metadata.artwork_data +"' />");
Cookies.remove('current_track');
Cookies.set('current_track', currentSong.name);
}
// makes sure it stays updated with current track if page loads
if (loaded != UNIQID) {
Cookies.remove('current_track');
Cookies.remove('loaded');
Cookies.set('loaded', UNIQID);
}
}
}
}else{
if (master_dj_on_air) {
if (showName) {

View file

@ -53,7 +53,8 @@ var AIRTIME = (function(AIRTIME) {
"year" : "n",
"owner_id" : "s",
"info_url" : "s",
"replay_gain" : "n"
"replay_gain" : "n",
"artwork" : "s"
};
if (AIRTIME.library === undefined) {
@ -575,6 +576,7 @@ var AIRTIME = (function(AIRTIME) {
/* ftype */ { "sTitle" : "" , "mDataProp" : "ftype" , "bSearchable" : false , "bVisible" : false },
/* Checkbox */ { "sTitle" : "" , "mDataProp" : "checkbox" , "bSortable" : false , "bSearchable" : false , "sWidth" : "16px" , "sClass" : "library_checkbox" },
/* Type */ { "sTitle" : "" , "mDataProp" : "image" , "bSortable" : false , "bSearchable" : false , "sWidth" : "16px" , "sClass" : "library_type" , "iDataSort" : 0 },
/* Artwork */ { "sTitle" : "" , "mDataProp" : "artwork" , "bSortable" : false , "bSearchable" : false , "sWidth" : "28px" , "sClass" : "library_artwork" , "iDataSort" : 0 },
/* Is Scheduled */ { "sTitle" : $.i18n._("Scheduled") , "mDataProp" : "is_scheduled" , "bVisible" : false , "bSearchable" : false , "sWidth" : "90px" , "sClass" : "library_is_scheduled" },
///* Is Playlist */ { "sTitle" : $.i18n._("Playlist / Block") , "mDataProp" : "is_playlist" , "bSearchable" : false , "sWidth" : "110px" , "sClass" : "library_is_playlist"} ,
/* Title */ { "sTitle" : $.i18n._("Title") , "mDataProp" : "track_title" , "sClass" : "library_title" , "sWidth" : "170px" },
@ -613,7 +615,7 @@ var AIRTIME = (function(AIRTIME) {
);
}
var colExclude = onDashboard ? [0, 1, 2, 32] : [0, 1, 2];
var colExclude = onDashboard ? [0, 1, 2, 33] : [0, 1, 2];
/* ############################################
DATATABLES
@ -767,6 +769,11 @@ var AIRTIME = (function(AIRTIME) {
// add audio preview image/button
if (aData.ftype === "audioclip") {
$(nRow).find('td.library_type').html('<img title="' + $.i18n._("Track preview") + '" src="' + baseUrl + 'css/images/icon_audioclip.png">');
if (aData.artwork_data) {
$(nRow).find('td.library_artwork').html('<img class="img_small" id="'+ aData.id +'" width="28" height="28" src="'+ aData.artwork_data +'">');
} else {
$(nRow).find('td.library_artwork').html('<img class="img_small" width="28" height="28" src="' + baseUrl + 'css/images/no-cover.jpg">');
}
} else if (aData.ftype === "playlist") {
$(nRow).find('td.library_type').html('<img title="' + $.i18n._("Playlist preview") + '" src="' + baseUrl + 'css/images/icon_playlist.png">');
} else if (aData.ftype === "block") {
@ -1589,6 +1596,7 @@ var validationTypes = {
"track_title" : "s",
"track_number" : "i",
"info_url" : "s",
"artwork" : "s",
"year" : "i"
};

View file

@ -5,6 +5,7 @@
$(document).ready(function() {
var aoColumns = [
/* Artwork */ { "sTitle" : $.i18n._("Artwork") , "mDataProp" : "artwork" , "bVisible" : false , "sClass" : "library_artwork" , "sWidth" : "150px" },
/* Title */ { "sTitle" : $.i18n._("Title") , "mDataProp" : "track_title" , "sClass" : "library_title" , "sWidth" : "170px" },
/* Creator */ { "sTitle" : $.i18n._("Creator") , "mDataProp" : "artist_name" , "sClass" : "library_creator" , "sWidth" : "160px" },
/* Upload Time */ { "sTitle" : $.i18n._("Uploaded") , "mDataProp" : "utime" , "bVisible" : false , "sClass" : "library_upload_time" , "sWidth" : "155px" },