Generate artwork images for audio using ID3.

This commit is contained in:
Codenift 2019-09-19 20:07:50 -04:00
parent 24dd71ad33
commit 45dbf84750
30 changed files with 939 additions and 199 deletions

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" },
@ -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"
};