Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: WSH Panel Mod script discussion/help (Read 1394917 times) previous topic - next topic
0 Members and 3 Guests are viewing this topic.

WSH Panel Mod script discussion/help

Reply #3525
i just uploaded a bugfix for my Thumbs script. setting a default image would cause the Open containing folder feature to crash the script. this has now been fixed. right click>Update script.

WSH Panel Mod script discussion/help

Reply #3526
sorry, i forgot all about checking this out. i'm also seeing problems with google even using the last version you posted. i see this in the console:

Code: [Select]
Thumbs: HTTP error: 0undefined


it's also retrying on some sort of timer which is not good. i'd remove that if i were you. i'm not even going to try and pick apart what you've done. i might take a look if you post an updated common8 version with that template i gave you.

Yes, timer should be changed, i will post script with common8 later.
''0undefined'' mean that you didn't change google domain in properties?
Or your browser redirecting page to use ''http'' instead of ''https'' or something like that?

@mire777

If you port the old script (Biography Photos) to common8 here's a mod that gets artwork from fanart.tv instead of google.
If you like it you can include it in your new script.

Code: [Select]
// ==PREPROCESSOR==
// @name "Fanart Photos"
// @author "zeremy"
// @feature "v1.4"
// @feature "watch-metadb"
// ==/PREPROCESSOR==
 

// Paths
var fbfolder = (fb.ProfilePath + "Artist_fanart");
var lfm_folder = window.GetProperty("Custom folder", fbfolder);

//Image download size
size = window.GetProperty("Download quality","medium");

//Download server
server = window.GetProperty("Download  source", "fanart.tv");

//Search terms(google)
terms = window.GetProperty("Custom search terms", "");

//Cycle
cycle2 = window.GetProperty("Image cycle", 10);

//Fanart Type
fanart_type = window.GetProperty("Fanart Type", "musiclogo");
fanart_type_musiclogo_limit = window.GetProperty("Fanart Type - musiclogo", "3");
fanart_type_artistbackground_limit = window.GetProperty("Fanart Type - artistbackground", "0");
fanart_type_cdart_limit = window.GetProperty("Fanart Type - cdart", "0");
fanart_type_albumcover_limit = window.GetProperty("Fanart Type - albumcover", "0");
fanart_type_artistthumb_limit = window.GetProperty("Fanart Type - artistthumb", "0");
fanart_type_musicbanner_limit = window.GetProperty("Fanart Type - musicbanner", "0");


var MF_GRAYED = 0x00000001;
var MF_STRING = 0x00000000;
var IDC_ARROW = 32512;
var IDC_HAND = 32649;


function on_colors_changed() {
p.colors_changed();
}

function on_font_changed() {
//p.font_changed();
}

function on_selection_changed() {
p.item_focus_change();
}

function on_playlist_switch() {
p.item_focus_change();
}

function on_playback_new_track() {
p.item_focus_change();
}

function on_playback_dynamic_info_track() {
p.item_focus_change();
}

function on_playback_stop() {
p.item_focus_change();
}

function on_item_focus_change() {
p.item_focus_change();
}

function on_mouse_rbtn_up(x, y) {
p.rbtn_up(x, y);
return true;
}

//Start Futures
function panel(name, features) {
this.item_focus_change = function() {
if (!this.metadb_func) return;
  switch(this.selection_mode) {
  case 0:
this.metadb = fb.GetSelection();
break;
  case 1:
this.metadb = fb.IsPlaying ? fb.GetNowPlaying() : fb.GetFocusItem();
break;
  case 2:
this.metadb = fb.GetFocusItem();
break;
}
if (this.metadb) on_metadb_changed();
}

//Size
this.size = function() {
this.w = window.Width;
this.h = window.Height;
}

//Move
this.move = function(x, y) {
this.mx = x;
this.my = y;
}

//Menu
this.rbtn_up = function(x, y) {
var _menu = window.CreatePopupMenu();

var idx;
switch(true) {
case typeof a == "object" && a.trace(x, y):

_menu.AppendMenuItem(MF_STRING, 17, "adjust");
_menu.AppendMenuItem(MF_STRING, 18, "Stretch");
_menu.CheckMenuRadioItem(15, 18, a.type == "centre" ? 15 : a.type == "top" ? 16 : a.type == "adjust" ? 17 : 18);
_menu.AppendMenuSeparator();
break;

case typeof th == "object":
case typeof im == "object" && im.trace(x, y):

var _settings = window.CreatePopupMenu();
var _auto_cycle = window.CreatePopupMenu();
var _download_source = window.CreatePopupMenu();
var _download_limit = window.CreatePopupMenu();
var _download_quality = window.CreatePopupMenu();
var _thumbs = window.CreatePopupMenu();
var _fanart_type = window.CreatePopupMenu();
var MF_POPUP = 0x00000010;  

_menu.AppendMenuItem(MF_STRING, 403, "Refresh");
_menu.AppendMenuSeparator();

//Settings Menu
_menu.AppendMenuItem(MF_STRING | MF_POPUP, _settings.ID, "Settings");
_menu.AppendMenuSeparator();
_settings.AppendMenuItem(MF_STRING | MF_POPUP, _auto_cycle.ID, "Auto Cycle");

_auto_cycle.AppendMenuItem(MF_STRING, 415, "05 sec");
_auto_cycle.AppendMenuItem(MF_STRING, 420, "10 sec");
_auto_cycle.AppendMenuItem(MF_STRING, 425, "15 sec");
_auto_cycle.AppendMenuItem(MF_STRING, 430, "20 sec");
_auto_cycle.AppendMenuItem(MF_STRING, 410, "Off");
_auto_cycle.CheckMenuRadioItem(410, 430, cycle2 + 410);


_settings.AppendMenuItem(MF_STRING | MF_POPUP, _download_source.ID, "Download Source");

_download_source.AppendMenuItem(MF_STRING, 1902, "Last.fm");
_download_source.AppendMenuItem(MF_STRING, 1903, "fanart.tv");
_download_source.CheckMenuRadioItem(1902, 1904, server == "last.fm" ? 1902 : server == "fanart.tv" ? 1903 : 1903);

_settings.AppendMenuItem(MF_STRING | MF_POPUP, _download_limit.ID, "Download Limit");
 
_download_limit.AppendMenuItem(MF_STRING, 1905, "1x");
_download_limit.AppendMenuItem(MF_STRING, 1906, "2x");
_download_limit.AppendMenuItem(MF_STRING, 1907, "3x");
_download_limit.AppendMenuItem(MF_STRING, 1908, "4x");
_download_limit.AppendMenuItem(MF_STRING, 1909, "5x");
_download_limit.AppendMenuItem(MF_STRING, 1910, "6x");
_download_limit.CheckMenuRadioItem(1905, 1910, im.limit + 1904);


if (server=="last.fm") _settings.AppendMenuItem(MF_STRING | MF_POPUP, _download_quality.ID, "Download Quality");
_download_quality.AppendMenuItem(MF_STRING, 1911, "Low");
_download_quality.AppendMenuItem(MF_STRING, 1912, "Medium");
_download_quality.AppendMenuItem(MF_STRING, 1913, "High");
_download_quality.CheckMenuRadioItem(1911, 1913, size == "low" ? 1911 : size == "medium" ? 1912 : size == "high" ? 1913 : 1913);

if (server=="fanart.tv") _settings.AppendMenuItem(MF_STRING | MF_POPUP, _fanart_type.ID, "Fanart Type");
_fanart_type.AppendMenuItem(MF_STRING, 4000, "Logo");
_fanart_type.AppendMenuItem(MF_STRING, 4001, "Artist Background");
_fanart_type.AppendMenuItem(MF_STRING, 4002, "CD Art");
_fanart_type.AppendMenuItem(MF_STRING, 4003, "Album Cover");
_fanart_type.AppendMenuItem(MF_STRING, 4004, "Artist Thumb");
_fanart_type.AppendMenuItem(MF_STRING, 4005, "Music Banner");
_fanart_type.CheckMenuRadioItem(4000, 4005, fanart_type == "musiclogo" ? 4000 : fanart_type == "artistbackground" ? 4001 : fanart_type == "cdart" ? 4002 : fanart_type == "albumcover" ? 4003 : fanart_type == "artistthumb" ? 4004 : fanart_type == "musicbanner" ? 4005: 4005);


_settings.AppendMenuItem(MF_STRING | MF_POPUP, _thumbs.ID, "Thumbs");

_thumbs.AppendMenuItem(MF_STRING, 1201, "Left");
_thumbs.AppendMenuItem(MF_STRING, 1202, "Right");
_thumbs.AppendMenuItem(MF_STRING, 1203, "Top");
_thumbs.AppendMenuItem(MF_STRING, 1204, "Bottom");
_thumbs.AppendMenuItem(MF_STRING, 1205, "Off");
_thumbs.CheckMenuRadioItem(1200, 1205, th.mode == "grid" ? 1200 : th.mode == "left" ? 1201 : th.mode == "right" ? 1202 : th.mode == "top" ? 1203 : th.mode == "bottom" ? 1204 : 1205);

if (th.mode == "left" | th.mode == "right" | th.mode == "top" | th.mode == "bottom")
{
_thumbs.AppendMenuSeparator();
_thumbs.AppendMenuItem(MF_STRING, 1240, "40px");
_thumbs.AppendMenuItem(MF_STRING, 1250, "50px");
_thumbs.AppendMenuItem(MF_STRING, 1260, "60px");
_thumbs.AppendMenuItem(MF_STRING, 1270, "70px");
_thumbs.AppendMenuItem(MF_STRING, 1280, "80px");
_thumbs.AppendMenuItem(MF_STRING, 1290, "90px");
_thumbs.AppendMenuItem(MF_STRING, 1300, "100px");
_thumbs.AppendMenuItem(MF_STRING, 1350, "150px");
_thumbs.AppendMenuItem(MF_STRING, 1400, "200px");
_thumbs.AppendMenuItem(MF_STRING, 1450, "250px");
_thumbs.AppendMenuItem(MF_STRING, 1500, "300px");
_thumbs.CheckMenuRadioItem(1240, 1500, th.px + 1200);
}
  {
_menu.AppendMenuItem(MF_STRING, 400, "Open Folder");
if (server=="last.fm") _menu.AppendMenuItem(MF_STRING, 21, "Open Last.fm");
if (server=="fanart.tv")  _menu.AppendMenuItem(MF_STRING, 21, "Open fanart.tv");
//_menu.AppendMenuItem(MF_STRING, 402, "Delete image");
_menu.AppendMenuSeparator();
_menu.AppendMenuItem(MF_STRING, 405, "Top");
_menu.AppendMenuItem(MF_STRING, 404, "Centre");
_menu.AppendMenuItem(MF_STRING, 406, "Adjust");
_menu.AppendMenuItem(MF_STRING, 407, "Stretch");
_menu.CheckMenuRadioItem(404, 407, im.type == "centre" ? 404 : im.type == "top" ? 405 : im.type == "adjust" ? 406 : 407);
_menu.AppendMenuSeparator();
}
break;
}

if (typeof ps == "object") _menu.AppendMenuItem(l.username.length > 0 ? MF_STRING : MF_GRAYED, 1901, "Last.fm password...");

_menu.AppendMenuItem(MF_STRING, 9, "Properties...");
_menu.AppendMenuItem(MF_STRING, 10, "Configure...");
idx = _menu.TrackPopupMenu(x, y);
switch(idx) {

case 9:
window.ShowProperties();
break;
case 10:
window.ShowConfigure();
break;

case 15:
case 16:
case 17:
case 18:
a.type = idx == 15 ? "centre" : idx == 16 ? "top" : idx == 17 ? "adjust" : "stretch";
window.SetProperty("artreader_image_type", a.type);
window.RepaintRect(a.x, a.y, a.w, a.h);
break;

case 21:
if (server=="last.fm") this.browser("http://www.last.fm/music/" + encodeURIComponent(p.artist));
else
if (server=="fanart.tv")  this.browser("https://fanart.tv/?s=" + encodeURIComponent(p.artist) + "&sect=2" + terms);
break;

case 400:
this.run("explorer /select,\"" + im.files[im.index] + "\"");
break;

case 403:
if (im.images.length < im.limit)
{
// p.run("RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 8");
//fix_limit = im.limit;
im.download();
im.update();
}
else
// p.run("RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 8");
im.update();
break;
case 404:
case 405:
case 406:
case 407:
im.type = idx == 404 ? "centre" : idx == 405 ? "top" : idx == 406 ? "adjust" : "stretch";
window.SetProperty("Image type", im.type);
window.Repaint();
break;
case 410:
case 415:
case 420:
case 425:
case 430:
cycle2 = idx - 410;
window.SetProperty("Image cycle", cycle2);
cicleTimer = undefined;
cicleTimerStarted = false;
stopTimer();
startTimer();
cicleTimerStarted = true;
break;

case 1200:
case 1201:
case 1202:
case 1203:
case 1204:
case 1205:
th.mode = idx == 1200 ? "grid" : idx == 1201 ? "left" : idx == 1202 ? "right" : idx == 1203 ? "top" : idx == 1204 ? "bottom" : "off";
window.SetProperty("Thumbs mode", th.mode);
th.nc = true;
on_size();
window.Repaint();
break;
case 1240:
case 1250:
case 1260:
case 1270:
case 1280:
case 1290:
case 1300:
case 1350:
case 1400:
case 1450:
case 1500:
th.px = idx - 1200;
window.SetProperty("Thumbs px", th.px);
th.nc = true;
on_size();
window.Repaint();
break;

case 1902:
case 1903:
case 1904:
server = idx == 1902 ? "last.fm" : idx == 1903 ? "fanart.tv" : "fanart.tv";
window.SetProperty("Download  source", server);
break; 

case 1905:
case 1906:
case 1907:
case 1908:
case 1909:
case 1910:
im.limit = idx - 1904;
window.SetProperty("Download limit", im.limit);
break;

case 1911:
case 1912:
case 1913:
size = idx == 1911 ? "low" : idx == 1912 ? "medium" : idx == 1913 ? "high" : "high";
window.SetProperty("Download quality", size);
break;
               
            case 4000:
case 4001:
            case 4002:           
            case 4003:
            case 4004:
            case 4005:
fanart_type = idx == 4000 ? "musiclogo" : idx == 4001 ? "artistbackground" : idx == 4002 ? "cdart" : idx == 4003 ? "albumcover" : idx == 4004 ? "artistthumb" : idx == 4005 ? "musicbanner" : "musicbanner";
window.SetProperty("Fanart Type", fanart_type);
                im.update();
                window.Repaint();
break;
               
}
_menu.Dispose();

}

//Futures Init
this.features_init = function() {
for (i = 0; i < this.features.length; i++) {
switch(this.features[i]) {

case "metadb":
this.selection_mode = window.GetProperty("Selection mode", 1);
break;

case "remap":
this.artist_tf = window.GetProperty("Artist format", "%artist%");
break;
}}}

//Check Future
this.check_feature = function(f) {
for (i = 0; i < this.features.length; i++) {
if (this.features[i] == f) return true;
}
return false;
}

//Eval Title/Format
this.eval = function(tf) {
if (!this.metadb || tf == "") return "";
if (fb.IsPlaying && this.metadb.RawPath.indexOf("file://") != 0) {
return fb.TitleFormat(tf).Eval();
} else {
return fb.TitleFormat(tf).EvalWithMetadb(this.metadb);
}}

//Console
this.console = function(message) {
fb.trace(this.name + ": " + message);
}

//Msg Box
this.MsgBox = function(prompt, buttons, title) {
prompt = prompt.replace(/"/g, '" + Chr(34) + "').replace(/\n/g, '" + Chr(13) + "');
title = title.replace(/"/g, '" + Chr(34) + "');
return this.vb.eval('MsgBox' + '("' + prompt + '", "' + buttons + '", "' + title + '")');
}

//Open In Browser
this.browser = function(command) {
if (!this.run(command)) this.MsgBox("Unable to launch your default browser.", 0, this.name);
}

//Run Command
this.run = function(command) {
try {
  this.WshShell.Run(command);
  return true;
  } catch(e) {
  return false;
}}

//Display Image
this.draw_image = function(gr, img, pos_x, pos_y, width, height, type, border, alpha) {
if (!img) return;
gr.SetInterpolationMode(7);
  switch(type) {
case "centre":
case "top":
  {
var sr = img.Width / img.Height;
var dr = width / height;
if (sr < dr) {
var r = img.Width / width;
var ch = height * r;
var sy = Math.round((img.Height - ch) / (type == "top" ? 1000 : 2));
var cw = img.Width;
var sx = 0;
} else {
var r = img.Height / height;
var cw = width * r;
var sx = Math.round((img.Width - cw) / 2);
var ch = img.Height;
var sy = 0;
}
  {
gr.DrawImage(img, pos_x, pos_y, width, height, sx + 5, sy + 5, cw - 10, ch - 10, 0, alpha || 255);
if (border) gr.DrawRect(pos_x, pos_y, width - 1, height - 1, 1, border);
  }
}
break;
case "stretch":
//strech
gr.DrawImage(img, pos_x, pos_y, width, height, 5, 5, img.Width-10, img.Height-10, 0, alpha || 255);
if (border) gr.DrawRect(pos_x, pos_y, width - 1, height - 1, 1, border);

break;
case "adjust":
default:
//adjust
var s = Math.min(width / img.Width, height / img.Height);
var nw = Math.round(img.Width * s);
var nh = Math.round(img.Height * s);
pos_x += Math.round((width - nw) / 2);
pos_y += Math.round((height - nh) / 2);

gr.DrawImage(img, pos_x, pos_y, nw, nh, 5, 5, img.Width-10, img.Height-10, 0, alpha || 255);
if (border) gr.DrawRect(pos_x, pos_y, nw - 1, nh - 1, 1, border);
break;

}
}

//Remove false string from file names
this.clean_filename = function(filename) {
return filename.replace(/[\/\\|:]/g, '-').replace(/\*/g, 'x').replace(/"/g, "''").replace(/[?<>]/g, '_');
}

this.name = "Fanart.tv";
this.features = features;
this.dui = window.InstanceType;
this.script_path = fb.ProfilePath;
this.w = 0;
this.h = 0;
this.mx = 0;
this.my = 0;
this.metadb = fb.GetFocusItem();
this.WshShell = new ActiveXObject("WScript.Shell");
this.fso = new ActiveXObject("Scripting.FileSystemObject");

this.data_folder = lfm_folder + "\\";
if (lfm_folder==fb.ProfilePath + "Artist_fanart") if (!this.fso.FolderExists(this.data_folder)) this.fso.CreateFolder(this.data_folder), this.data_folder=this.data_folder;
if (!this.fso.FolderExists(this.data_folder)) return; 
this.artist = "";
this.artist_tf = "%artist%";

this.metadb_func = typeof on_metadb_changed == "function";
this.features_init();
}

function artreader(x, y, w, h) {
this.draw = function(gr) {
if (!this.img) return;
p.draw_image(gr, this.img, this.x, this.y, this.w, this.h, this.type);
}

this.trace = function(x, y) {
return (x > this.x && x < this.x + this.w && y > this.y && y < this.y + this.h);
}

this.wheel = function(step) {
if (!this.trace(p.mx, p.my)) return false;
this.id -= step;
if (this.id < 0) this.id = 4;
if (this.id > 4) this.id = 0;
window.SetProperty("artreader_id", this.id);
this.metadb_changed();
return true;
}

this.move = function(x, y) {
if (this.trace(x, y)) {
if (this.img) p.tt("Original size: " + this.img.Width + "x" + this.img.Height + "px");
return true;
} else {
p.ttd();
return false;
}}

this.lbtn_dblclk = function(x, y) {
if (!this.trace(x, y)) return false;
if (this.img) p.run("explorer /select,\"" + this.path + "\"");
return true;
}

this.x = x;
this.y = y;
this.w = w;
this.h = h;
this.img = null;
this.path = null;
}

function images(x, y, w, h) {
this.playback_time = function(time) {
}

this.draw = function (gr) {
if (this.images.length == 0) return;
p.draw_image(gr, this.images[this.index], this.x, this.y, this.w, this.h, this.type);
}

//MetaDB
this.metadb_changed = function() {
if (!p.metadb) return false;
switch(this.mode) {
case "last.fm":
p.artist = p.eval(p.artist_tf);
if (this.artist == p.artist) return false;
this.artist = p.artist;
this.folder = p.data_folder + p.clean_filename(p.artist);
if (!p.fso.FolderExists(this.folder)) p.fso.CreateFolder(this.folder);
break;
}
this.update();
return true;
}

this.trace = function(x, y) {
return (x > this.x && x < this.x + this.w && y > this.y && y < this.y + this.h);
}

this.wheel = function(step) {
if (!p.metadb || this.images.length < 2 || !this.trace(p.mx, p.my) || (typeof th == "object" && th.mode == "grid" && !th.overlay)) return false;
this.index -= step;
if (this.index < 0) this.index = this.images.length - 1;
if (this.index >= this.images.length) this.index = 0;
window.RepaintRect(this.x, this.y, this.w, this.h);
return true;
}

//Db-Click
this.lbtn_dblclk = function(x, y) {
if (!this.trace(x, y)) return false;
p.run("\"" + this.files[this.index] + "\"");
return true;
}

//Download Image
this.download = function()
{
if (!p.fso.FolderExists(this.folder))  return;
{

if (server=="last.fm")
{{
this.working=true;
if (p.artist == "" || p.artist == "?") return;
var folder = this.folder + "\\";
if (!this.xmlhttp) this.xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
this.xmlhttp.open("GET", "http://www.last.fm/music/" + encodeURIComponent(p.artist) + "/+images", true);
this.xmlhttp.send();
this.xmlhttp.onreadystatechange = function() {
if (im.xmlhttp.readyState == 4) {
if (im.xmlhttp.status == 200) {
var text = im.xmlhttp.responsetext;
if (!im.doc) im.doc = new ActiveXObject("htmlfile");
im.doc.open();
var div = im.doc.createElement("div");
div.innerHTML = text;
var data = div.getElementsByTagName("img");
var urls = [];
for (i = 0; i < data.length; i++) {
if (data[i].src.indexOf("http://userserve-ak.last.fm/serve/126s") == 0) urls.push(data[i].src.replace("126s", size == "low" ? "252" : size == "medium" ? "500" : size == "high" ? "_" : "_"));
}
fix_limit = im.limit;
for (i = 0; i < Math.min(urls.length, fix_limit, 50); i++) {
p.WshShell.Run("cscript //nologo \"" + p.script_path + "bio_photos.vbs\" \"" + urls[i] + "\" \"" + [folder + p.clean_filename(p.artist) + "_" + i] + urls[i].substring(urls[i].lastIndexOf("/")+1000) + ".jpg" + "\"" , 0, true);
if (im.images.length == 0) {im.update(); fix_limit = im.limit+1;}
if (im.images.length == 0) {return;}
}
im.doc.close();
im.working=false;
im.update();
window.NotifyOthers("images", "update");
} else {
p.console("HTTP error: " + im.xmlhttp.status);
}}}}}

else

if (server=="fanart.tv")
{{
this.working=true;  
if (p.artist == "" || p.artist == "?") return;
var folder = this.folder + "\\";
       

//get mbid from wsh_data folder.

    p.data_folder2 = fb.ProfilePath + "wsh_data\\";
    p.artists_folder2 = p.data_folder2 + "artists\\";
    var fn1 = p.artists_folder2 + p.eval("%artist%") + "\\musicbrainz_artistid.txt";
    musicbrainz_id = p.eval("$if3(%musicbrainz_artistid%,%musicbrainz artist id%,)");
    musicbrainz_id = musicbrainz_id.substring(0, 36);
    p.console(fn1);
    musicbrainz_id = utils.ReadTextFile(fn1);
    p.console(p.eval("%artist%"));
    p.console(musicbrainz_id);
    fanart = "https://fanart.tv/artist/" + musicbrainz_id;
       
   


if (!this.xmlhttp) this.xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");

        this.xmlhttp.open("GET", fanart, true);
this.xmlhttp.send();
this.xmlhttp.onreadystatechange = function() {
if (im.xmlhttp.readyState == 4) {
if (im.xmlhttp.status == 200) {
var text = im.xmlhttp.responsetext;
if (!im.doc) im.doc = new ActiveXObject("htmlfile");
im.doc.open();
var div = im.doc.createElement("div");
div.innerHTML = text;
var data = div.getElementsByTagName("a");

                    var urls_musiclogo = [];
                    var urls_artistbackground = [];
                    var urls_cdart = [];
                    var urls_albumcover = [];
                    var urls_artistthumb = [];
                    var urls_musicbanner = [];
                 
                    p.console(fanart);
                 
                    //hdmusiclogo, musiclogo, artistbackground, cdart, albumcover, artistthumb, musicbanner
                   
                    for (i = 0; i < data.length; i++) {
                    if (data[i].href.indexOf("musiclogo") > 0) urls_musiclogo.push(data[i]);
                    }

                    for (i = 0; i < data.length; i++) {
                    if (data[i].href.indexOf("artistbackground") > 0) urls_artistbackground.push(data[i]);
                    }
                   
                    for (i = 0; i < data.length; i++) {
                    if (data[i].href.indexOf("cdart") > 0) urls_cdart.push(data[i]);
                    }
                   
                    for (i = 0; i < data.length; i++) {
                    if (data[i].href.indexOf("albumcover") > 0) urls_albumcover.push(data[i]);
                    }
                   
                    for (i = 0; i < data.length; i++) {
                    if (data[i].href.indexOf("artistthumb") > 0) urls_artistthumb.push(data[i]);
                    }
                   
                    for (i = 0; i < data.length; i++) {
                    if (data[i].href.indexOf("musicbanner") > 0) urls_musicbanner.push(data[i]);
                    }
                   
           
                    fix_limit = im.limit;
                   
                    //no of urls
                    p.console("Fanart.tv results");
                    p.console("urls_musiclogo: " + urls_musiclogo.length);
                    p.console("urls_artistbackground: " + urls_artistbackground.length);
                    p.console("urls_cdart: " + urls_cdart.length);
                    p.console("urls_albumcover: " + urls_albumcover.length);
                    p.console("urls_artistthumb: " + urls_artistthumb.length);
                    p.console("urls_musicbanner: " + urls_musicbanner.length);
                   
           
                    p.console("Downloading From Fanart.tv Started");
               
                    //musiclogo
                    fix_limit = fanart_type_musiclogo_limit;
                    for (i = 0; i < Math.min(urls_musiclogo.length, fix_limit, 50); i++) {
                    urls_musiclogo[i] = decodeURIComponent(urls_musiclogo[i]).replace("about:", "https://fanart.tv");
                    image_ext = urls_musiclogo[i].substr(urls_musiclogo[i].lastIndexOf('.') + 1);
                    image_name = urls_musiclogo[i].substr(urls_musiclogo[i].lastIndexOf('/') + 1);
p.console("Downloading..: " + urls_musiclogo[i]);
                    cmd = "cscript //nologo \"" + p.script_path + "bio_photos.vbs\" \"" + decodeURIComponent(urls_musiclogo[i]) + "\" \"" + folder + "\musiclogo-" + image_name + "\"" ;
                    p.console(cmd);
p.WshShell.Run(cmd, 0, true);
if (im.images.length == 0) {fix_limit = im.limit+1; im.update();}
if (im.images.length == 0) {return;}
}
                   
                    //artistbackground
                    fix_limit = fanart_type_artistbackground_limit;
                    for (i = 0; i < Math.min(urls_artistbackground.length, fix_limit, 50); i++) {
                    urls_artistbackground[i] = decodeURIComponent(urls_artistbackground[i]).replace("about:", "https://fanart.tv");
                    image_ext = urls_artistbackground[i].substr(urls_artistbackground[i].lastIndexOf('.') + 1);
                    image_name = urls_artistbackground[i].substr(urls_artistbackground[i].lastIndexOf('/') + 1);
p.console("Downloading..: " + urls_artistbackground[i]);
                    cmd = "cscript //nologo \"" + p.script_path + "bio_photos.vbs\" \"" + decodeURIComponent(urls_artistbackground[i]) + "\" \"" + folder + "\artistbackground-" + image_name + "\"" ;
                    p.console(cmd);
p.WshShell.Run(cmd, 0, true);
if (im.images.length == 0) {fix_limit = im.limit+1; im.update();}
if (im.images.length == 0) {return;}
}         
                   
                    //cdart
                    fix_limit = fanart_type_cdart_limit;
                    for (i = 0; i < Math.min(urls_cdart.length, fix_limit, 50); i++) {
                    urls_cdart[i] = decodeURIComponent(urls_cdart[i]).replace("about:", "https://fanart.tv");
                    image_ext = urls_cdart[i].substr(urls_cdart[i].lastIndexOf('.') + 1);
                    image_name = urls_cdart[i].substr(urls_cdart[i].lastIndexOf('/') + 1);
p.console("Downloading..: " + urls_cdart[i]);
                    cmd = "cscript //nologo \"" + p.script_path + "bio_photos.vbs\" \"" + decodeURIComponent(urls_cdart[i]) + "\" \"" + folder + "\cdart-" + image_name + "\"" ;
                    p.console(cmd);
p.WshShell.Run(cmd, 0, true);
if (im.images.length == 0) {fix_limit = im.limit+1; im.update();}
if (im.images.length == 0) {return;}
}         
                   
                    //albumcover
                    fix_limit = fanart_type_albumcover_limit;
                    for (i = 0; i < Math.min(urls_albumcover.length, fix_limit, 50); i++) {
                    urls_albumcover[i] = decodeURIComponent(urls_albumcover[i]).replace("about:", "https://fanart.tv");
                    image_ext = urls_albumcover[i].substr(urls_albumcover[i].lastIndexOf('.') + 1);
                    image_name = urls_albumcover[i].substr(urls_albumcover[i].lastIndexOf('/') + 1);
p.console("Downloading..: " + urls_albumcover[i]);
                    cmd = "cscript //nologo \"" + p.script_path + "bio_photos.vbs\" \"" + decodeURIComponent(urls_albumcover[i]) + "\" \"" + folder + "\albumcover-" + image_name + "\"" ;
                    p.console(cmd);
p.WshShell.Run(cmd, 0, true);
if (im.images.length == 0) {fix_limit = im.limit+1; im.update();}
if (im.images.length == 0) {return;}
}
                   
                    //artistthumb
                    fix_limit = fanart_type_artistthumb_limit;
                    for (i = 0; i < Math.min(urls_artistthumb.length, fix_limit, 50); i++) {
                    urls_artistthumb[i] = decodeURIComponent(urls_artistthumb[i]).replace("about:", "https://fanart.tv");
                    image_ext = urls_artistthumb[i].substr(urls_artistthumb[i].lastIndexOf('.') + 1);
                    image_name = urls_artistthumb[i].substr(urls_artistthumb[i].lastIndexOf('/') + 1);
p.console("Downloading..: " + urls_artistthumb[i]);
                    cmd = "cscript //nologo \"" + p.script_path + "bio_photos.vbs\" \"" + decodeURIComponent(urls_artistthumb[i]) + "\" \"" + folder + "\artistthumb-" + image_name + "\"" ;
                    p.console(cmd);
p.WshShell.Run(cmd, 0, true);
if (im.images.length == 0) {fix_limit = im.limit+1; im.update();}
if (im.images.length == 0) {return;}

                   
                    //musicbanner
                    fix_limit = fanart_type_musicbanner_limit;
                    for (i = 0; i < Math.min(urls_musicbanner.length, fix_limit, 50); i++) {
                    urls_musicbanner[i] = decodeURIComponent(urls_musicbanner[i]).replace("about:", "https://fanart.tv");
                    image_ext = urls_musicbanner[i].substr(urls_musicbanner[i].lastIndexOf('.') + 1);
                    image_name = urls_musicbanner[i].substr(urls_musicbanner[i].lastIndexOf('/') + 1);
p.console("Downloading..: " + urls_musicbanner[i]);
                    cmd = "cscript //nologo \"" + p.script_path + "bio_photos.vbs\" \"" + decodeURIComponent(urls_musicbanner[i]) + "\" \"" + folder + "\musicbanner-" + image_name + "\"" ;
                    p.console(cmd);
p.WshShell.Run(cmd, 0, true);
if (im.images.length == 0) {fix_limit = im.limit+1; im.update();}
if (im.images.length == 0) {return;}
}
                   
                    p.console("Downloading From Fanart.tv Finished");
                   
im.doc.close();
im.working=false;
im.update();
window.NotifyOthers("images", "update");
} else {
p.console("HTTP error: " + im.xmlhttp.status + urls);
}}}}}}}


this.update = function() {
this.index = 0;
for (i = 0; i < this.images.length; i++) {
try { this.images[i].Dispose(); } catch(e) {}
}
this.folders = this.folder.split("|");
this.files = [];
for (i = 0; i < this.folders.length; i++) {
if (p.fso.FolderExists(this.folders[i])) this.files = this.files.concat(utils.Glob(this.folders[i] + "\\" + fanart_type + "*.jpg").toArray(), utils.Glob(this.folders[i] + "\\" + fanart_type + "*.jpeg").toArray(), utils.Glob(this.folders[i] + "\\" + fanart_type + "*.png").toArray(), utils.Glob(this.folders[i] + "\\" + fanart_type + "*.gif").toArray());
                }


    p.console("Current Image Set: " + this.files);



this.images = [];
for (i = 0; i < this.files.length; i++) {
this.images[i] = gdi.Image(this.files[i]);
}
if (typeof th == "object") {
th.nc = true;
th.calc();
}
  window.Repaint();
}

//Delete Image
this.delete_image = function() {
if (!this.app) this.app = new ActiveXObject("Shell.Application");
this.app.Namespace(10).MoveHere(this.files[this.index]);
window.SetTimeout(function() {
im.update();
window.NotifyOthers("images", "update");
}, 100);
}

this.x = x;
this.y = y;
this.w = w;
this.h = h;
this.files = [];
this.images = [];
this.index = 0;
this.artist = "";
this.folder = "";
this.limit = window.GetProperty("Download limit", 6);
this.mode = ("last.fm");
this.type = window.GetProperty("Image type", "adjust");
this.auto_download = window.GetProperty("Download  [on/off]", "on");
}

//Thumbs
function thumbs() {
this.trace = function(x, y) {
return (x > this.x && x < this.x + this.w && y > this.y && y < this.y + this.h);
}

this.draw = function(gr) {
switch(true) {
case im.images.length == 0:
break;
case this.mode == "off":
p.draw_image(gr, im.images[im.index], im.x, im.y, im.w, im.h, im.type);
break;
case !this.img:
break;
case this.mode == "grid":
gr.DrawImage(this.img, this.x, this.y, this.w, this.h, 0, this.offset * this.px, this.w, this.h);
if (this.overlay) {
gr.FillSolidRect(this.x, this.y, this.w, this.h, RGBA(0, 0, 0, 126));
p.draw_image(gr, im.images[im.index], im.x, im.y, im.w, im.h, "adjust");
}
break;
case this.mode == "left":
case this.mode == "right":
gr.DrawImage(this.img, this.x, this.y, this.w, this.h, 0, this.offset * this.px, this.w, this.h);
p.draw_image(gr, im.images[im.index], im.x, im.y, im.w, im.h, im.type);
break;
case this.mode == "bottom":
case this.mode == "top":
gr.DrawImage(this.img, this.x, this.y, this.w, this.h, this.offset * this.px, 0, this.w, this.h);
p.draw_image(gr, im.images[im.index], im.x, im.y, im.w, im.h, im.type);
break;
}}

this.calc = function() {
this.offset = 0;
switch(true) {
case p.w < this.px || p.h < this.px || this.mode == "off":
this.nc = true;
this.img && this.img.Dispose();
this.img = null;
im.x = 0;
im.y = 0;
im.w = p.w;
im.h = p.h;
break;
case this.mode == "grid":
this.x = 0;
this.y = 0;
this.w = p.w;
this.h = p.h;
im.x = 40;
im.y = 40;
im.w = this.w - 80;
im.h = this.h - 80;
if (!this.nc && this.columns != Math.floor(this.w / this.px)) this.nc = true;
this.overlay = false;
this.rows = Math.ceil(this.h / this.px);
this.columns = Math.floor(this.w / this.px);
this.img_rows = Math.ceil(im.images.length / this.columns);
if (this.nc && im.images.length > 0) {
this.nc = false;
this.img && this.img.Dispose();
this.img = null;
this.img = gdi.CreateImage(Math.min(this.columns, im.images.length) * this.px, this.img_rows * this.px);
var temp_gr = this.img.GetGraphics();
temp_gr.SetInterpolationMode(7);
var ci = 0;
var row, col;
for (row = 0; row < this.img_rows; row++) {
for (col = 0; col < this.columns; col++) {
if (ci == im.images.length) continue;
p.draw_image(temp_gr, im.images[ci], col * this.px, row * this.px, this.px, this.px, "top");
ci++;
}}
this.img.ReleaseGraphics(temp_gr);
temp_gr = null;
}
break;
case this.mode == "left":
case this.mode == "right":
this.x = this.mode == "left" ? 0 : p.w - this.px;
this.y = 0;
this.w = this.px;
this.h = p.h;
im.x = this.mode == "right" ? 0 : this.px;
im.y = 0;
im.w = p.w - this.px;
im.h = p.h;
this.rows = Math.ceil(this.h / this.px);

if (this.nc && im.images.length > 0) {
this.nc = false;
this.img && this.img.Dispose();
this.img = null;
this.img = gdi.CreateImage(this.px, this.px * im.images.length);
var temp_gr = this.img.GetGraphics();
temp_gr.SetInterpolationMode(7);
for (i = 0; i < im.images.length; i++) {
p.draw_image(temp_gr, im.images[i], 0, i * this.px, this.px, this.px, "top");
}
this.img.ReleaseGraphics(temp_gr);
temp_gr = null;
}
break;
case this.mode == "bottom":
case this.mode == "top":
this.x = 0;
this.y = this.mode == "top" ? 0 : p.h - this.px;
this.w = p.w;
this.h = this.px;
im.x = 0;
im.y = this.mode == "bottom" ? 0 : this.px;
im.w = p.w;
im.h = p.h - this.px;
this.columns = Math.ceil(this.w / this.px);

if (this.nc && im.images.length > 0) {
this.nc = false;
this.img && this.img.Dispose();
this.img = null;
this.img = gdi.CreateImage(this.px * im.images.length, this.px);
var temp_gr = this.img.GetGraphics();
temp_gr.SetInterpolationMode(7);
for (i = 0; i < im.images.length; i++) {
p.draw_image(temp_gr, im.images[i], i * this.px, 0, this.px, this.px, "top");
}
this.img.ReleaseGraphics(temp_gr);
temp_gr = null;
}
break;
}}

this.wheel = function(step) {
switch(true) {
case !this.trace(p.mx, p.my):
case this.overlay:
return false;
case this.mode == "grid":
if (this.img_rows < this.rows) return true;
this.offset -= step;
if (this.offset < 0) this.offset = 0;
if (this.offset > this.img_rows - this.rows) this.offset = this.img_rows - this.rows + 1;
break;
case this.mode == "left":
case this.mode == "right":
if (im.images.length < this.rows) return true;
this.offset -= step;
if (this.offset < 0) this.offset = 0;
if (this.rows + this.offset > im.images.length) this.offset = im.images.length - this.rows + 1;
break;
case this.mode == "bottom":
case this.mode == "top":
if (im.images.length < this.columns) return true;
this.offset -= step;
if (this.offset < 0) this.offset = 0;
if (this.columns + this.offset > im.images.length) this.offset = im.images.length - this.columns + 1;
break;
}
window.RepaintRect(this.x, this.y, this.w, this.h);
return true;
}

this.move = function(x, y) {
switch(true) {
case !this.trace(x, y):
window.SetCursor(IDC_ARROW);
return false;
case this.overlay:
window.SetCursor(IDC_ARROW);
return true;
case this.mode == "grid":
this.index = Math.floor((x - this.x) / this.px) + (Math.floor((y - this.y) / this.px) * this.columns) + (this.offset * this.columns);
break;
case this.mode == "left":
case this.mode == "right":
this.index = Math.floor((y - this.y) / this.px) + this.offset;
break;
case this.mode == "bottom":
case this.mode == "top":
this.index = Math.floor((x - this.x) / this.px) + this.offset;
break;
}
window.SetCursor(this.index < im.images.length ? IDC_HAND : IDC_ARROW);
return true;
}

this.lbtn_up = function(x, y) {
switch(true) {
case !this.trace(x, y):
return false;
case this.mode == "grid" && this.overlay && im.trace(x, y):
this.overlay = false;
window.Repaint();
break;
case this.mode == "grid" && this.index < im.images.length && !this.overlay:
this.overlay = true;
im.index = this.index;
window.Repaint();
break;
case this.overlay:
break;
case this.index < im.images.length:
im.index = this.index;
window.Repaint();
}
return true;
}

this.lbtn_dblclk = function(x, y) {
if (!im.trace(x, y) || th.mode == "grid") return false;
p.run("\"" + im.files[im.index] + "\"");
return true;
}

this.nc = false;
this.mode = window.GetProperty("Thumbs mode", p.check_feature("now_playing") ? "off" : "off");
this.px = window.GetProperty("Thumbs px", 40);
this.img = null;
}

//START---->
var p = new panel("Thumbs", ["remap", "metadb"]);
var im = new images(0, 0, 0, 0);
var th = new thumbs();

on_item_focus_change();

function on_playback_time(time) {
im.playback_time(time);
}

function on_size() {
p.size();
th.calc();
}

function on_paint(gr) {
col = utils.GetSysColor(1);
gr.FillSolidRect(0, 0, p.w, p.h, col);
th.draw(gr);
}

function on_metadb_changed() {
  im.metadb_changed(); 
    window.SetTimeout(function()
            {
              if (im.images.length == 0 && im.auto_download=="on")
im.download();

            }, 5000);


}


function on_mouse_wheel(step) {
if (th.wheel(step)) return;
if (im.wheel(step)) return;
}

function on_mouse_move(x, y) {
p.move(x, y);
th.move(x, y);
}

function on_mouse_lbtn_up(x, y) {
th.lbtn_up(x, y);
}

function on_mouse_lbtn_dblclk(x, y) {
th.lbtn_dblclk(x, y);
}

//Auto Cycle Image
var cicleTimerStarted = false;
var cicleTimer = null;
 
(function startTimer(){
 
if(!cicleTimerStarted){

cicleTimer = window.CreateTimerInterval(cycle2+"000");
cicleTimerStarted = true;
}
 
})();
 
function stopTimer(){
 
if(!cicleTimerStarted) return;
window.KillTimer(cicleTimer);
cicleTimer = undefined;
cicleTimerStarted = false;
 
}
 
function on_timer(id) {
if(cicleTimer && id == cicleTimer.ID){
 
{
do{
im.index++
if (im.index == im.images.length) im.index=0;
window.Repaint();
}while (im.index==-1);
}}}


WSH Panel Mod script discussion/help

Reply #3528
@mire777

If you port the old script (Biography Photos) to common8 here's a mod that gets artwork from fanart.tv instead of google.
If you like it you can include it in your new script.

Don't know, i didnt receive any result, i didnt analize your code, but for me this not work..
Console:
Code: [Select]
Fanart.tv: Current Image Set:  
Fanart.tv: C:\Users\mire\Desktop\foobar2000 xch4\wsh_data\artists\Midnight Star\musicbrainz_artistid.txt
Fanart.tv: Midnight Star
Fanart.tv: 
Fanart.tv: C:\Users\mire\Desktop\foobar2000 xch4\wsh_data\artists\Midnight Star\musicbrainz_artistid.txt
Fanart.tv: Midnight Star
Fanart.tv: 
Fanart.tv: C:\Users\mire\Desktop\foobar2000 xch4\wsh_data\artists\Midnight Star\musicbrainz_artistid.txt
Fanart.tv: Midnight Star
Fanart.tv: 
Fanart.tv: [url=https://fanart.tv/artist/]https://fanart.tv/artist/[/url]
Fanart.tv: Fanart.tv results
Fanart.tv: urls_musiclogo: 0
Fanart.tv: urls_artistbackground: 0
Fanart.tv: urls_cdart: 0
Fanart.tv: urls_albumcover: 0
Fanart.tv: urls_artistthumb: 0
Fanart.tv: urls_musicbanner: 0
Fanart.tv: Downloading From Fanart.tv Started
Fanart.tv: Downloading From Fanart.tv Finished
Fanart.tv: Current Image Set:

EDIT: uh, there is no image for this artist at all: https://fanart.tv/artist/3d30a740-e36b-45b9.../midnight-star/
Again for madonna i didnt receive anything even there is images: https://fanart.tv/artist/79239441-bfd5-4981...5c1287/madonna/
Anyway, don't know if this is useful if you don't have all artist there..

i've updated my last.fm & wikipedia biography script with full language support for last.fm. wikipedia is still english only.

Great
Why not for wiki?

WSH Panel Mod script discussion/help

Reply #3529
Why not for wiki?


because i'm still using the echonest. it solves the problem of not getting the artist/band related page when using common words or phrases. also, even if you do hit the right page, formatting content with just what you want is major pain and i'm just not interested in trying to work around it.

as for fanart, i think i looked at it when zeremy suggested it ages ago but i found the stats on their pages to be most disappointing. for example, there are just 13,000 artist images. i looked at that page for madonna and 4 of those are for her. i then looked up the beatles because they're rather famous and there are 16 images. when you start getting a few artists like this, you soon realise they're only going to have images for a few hundred or maybe a couple of thousand different artists. for me, that just isn't worth the effort.

----

i've added an Updates page to my website to cover new features and important bug fixes. i'll still post all updates here though.

http://marc2003.x10host.com/updates

WSH Panel Mod script discussion/help

Reply #3530
Marc, i have problem with some redirecting urls, that i receive as google image links.
When you enter link in browser, it changes to another.
Link works but it is different .
How to fix this?

WSH Panel Mod script discussion/help

Reply #3531
i'm pretty sure you can't do anything about that. when using random sites found via google, you're at their mercy.

it's like my website is configured to redirect if you try and access a page that doesn't exist. rather than show a 404 message, i just redirect to my home page. try it: http://marc2003.x10host.com/not_a_page

WSH Panel Mod script discussion/help

Reply #3532
@mire777

If you port the old script (Biography Photos) to common8 here's a mod that gets artwork from fanart.tv instead of google.
If you like it you can include it in your new script.

Don't know, i didnt receive any result, i didnt analize your code, but for me this not work..
Console:
Code: [Select]
Fanart.tv: Current Image Set:  
Fanart.tv: C:\Users\mire\Desktop\foobar2000 xch4\wsh_data\artists\Midnight Star\musicbrainz_artistid.txt
Fanart.tv: Midnight Star
Fanart.tv: 
Fanart.tv: C:\Users\mire\Desktop\foobar2000 xch4\wsh_data\artists\Midnight Star\musicbrainz_artistid.txt
Fanart.tv: Midnight Star
Fanart.tv: 
Fanart.tv: C:\Users\mire\Desktop\foobar2000 xch4\wsh_data\artists\Midnight Star\musicbrainz_artistid.txt
Fanart.tv: Midnight Star
Fanart.tv: 
Fanart.tv: [url=https://fanart.tv/artist/]https://fanart.tv/artist/[/url]
Fanart.tv: Fanart.tv results
Fanart.tv: urls_musiclogo: 0
Fanart.tv: urls_artistbackground: 0
Fanart.tv: urls_cdart: 0
Fanart.tv: urls_albumcover: 0
Fanart.tv: urls_artistthumb: 0
Fanart.tv: urls_musicbanner: 0
Fanart.tv: Downloading From Fanart.tv Started
Fanart.tv: Downloading From Fanart.tv Finished
Fanart.tv: Current Image Set:

EDIT: uh, there is no image for this artist at all: https://fanart.tv/artist/3d30a740-e36b-45b9.../midnight-star/
Again for madonna i didnt receive anything even there is images: https://fanart.tv/artist/79239441-bfd5-4981...5c1287/madonna/
Anyway, don't know if this is useful if you don't have all artist there..

Yes, It doesn't have all artist on the site , but what it does have is criteria to what is uploaded.
e.g background images are 1920x1080 , album covers 1000x1000.
It also has Logo ( which I didn't find anywhere else).

As for the script it uses the artists/bands musicbrainz id (which if found from tag or artists wsh_data folder (thanks marc2003) ) to search and scrape the site.
If "Madonna"  did not work for you , check that it exists.

I find a search like this using mbid more accurate , I tried your google search script and it returns generic images for common words.
e.g  like the band "Heart".

WSH Panel Mod script discussion/help

Reply #3533
marc, I have yet another improvement suggestion for your biography panel :

Let's say that I want to remain on last.fm most of the time.
But for some artists there is no last.fm bio, so I go to wikipedia.
Then the wikipedia bio is downloaded automatically.
Then I switch back to last.fm.
Then the next time I listen to that artist... I won't see anything because I will be back to last.fm, so the wikipedia bio won't display, even if it's in my hard drive !

So, could you think of some "fallback scenario" for your panel ?
1. We choose a "preferred site" (last.fm or wikipedia) and a "preferred language" (ex : english) (on a global basis of course, not for every artist !  )
2. The panel tries to find a bio on the preferred site and language
3. If it doesn't find anything, it automatically tries to find a bio on the other site with the same language, without us needing to switch
4. If it doesn't find anything on both sites, it looks for the bio in the hard drive

Example 1 : preferred = last.fm AND english ==> last.fm (english), then wikipedia (english), then hard drive
Example 2 : preferred = wikipedia AND french ==> wikipedia (french), then last.fm (french), then hard drive

Something like that... ;-)

Oh, and in all cases, it would be nice if the panel would display a last.fm or a wikipedia logo, so we would know where the displayed bio comes from (right now my panel doesn't display anything).

I hope this makes sense. Thanks in advance !

WSH Panel Mod script discussion/help

Reply #3534
Oh, and in all cases, it would be nice if the panel would display a last.fm or a wikipedia logo, so we would know where the displayed bio comes from (right now my panel doesn't display anything).


not a logo but this will show some text next to the artist name at the top. open the panel and edit line 22. replace

Code: [Select]
t.header_text()


with

Code: [Select]
t.header_text() + ": " + (t.biography_lastfm ? "last.fm" : "wikipedia")


i'll think about the rest but i'm warning you now, do not hold your breath. also you seem to be confused into thinking wikipedia supports other languages but it doesn't - not in my script anyway. if you don't like it, feel free to use foo_uie_biography.

edit: having given it a bit more thought, i think the chances me implementing any of these fallbacks are very slim. it would be a big, ugly hack-y mess and i'm really trying to cut down on those. 

WSH Panel Mod script discussion/help

Reply #3535
Hmm, it's up to you : you're the boss !

I honestly don't care about the language part. I only used it as an example that could be used by everyone. As for me, the only language I use is english, so I'm fine with that.
I'm well aware that your script doesn't support other languages in Wikipedia, and again, I'm fine with that.

Languages aside, I understand it may be complicated to implement the fallbacks. What bothers me is that no fallback leads to the above scenario, where a bio won't display even if it's in my hard drive. I would understand if there was a bio available online, but if there's nothing online and something in the hard drive, I think it's a pity that we have to remember there's something in the hard drive, switch manually, and re-switch afterwards.

A component like foo_uie_lyrics3 comes to mind, where a fallback scenario can be configured in the order we choose (ex : look first for lyrics in the tags, then look for lyrics in the hard drive, then look for lyrics online).

But again, you are the boss.

WSH Panel Mod script discussion/help

Reply #3536
Here's another idea instead of a fallback scenario :

- The bio panel could always scan BOTH preferred sites (ex : last.fm english, wikipedia) AND the hard drive
- Then on the top-right part, it would display 0 to 4 small buttons (e.g. "last.fm online", "wikipedia online", "last.fm local", "wikipedia local"), depending on whether there's an available bio or not
- So we would manually click the buttons to display the bio we want, the default displayed bio being of course the one we chose via the right-click menu.

WSH Panel Mod script discussion/help

Reply #3537
Yet another small improvement : when only 1 of the 2 online bios a is available, display it by default. Just my two cents.

EDIT - And maybe a small bug report on Thumbs :
- Sometimes downloaded images are corrupted (half-downloaded, impossible to resume download)
- Sometimes a black thumbnail appears instead of the downloaded image, but if I go to the next song then get back to the previous one, the downloaded image appears.

WSH Panel Mod script discussion/help

Reply #3538
i'm pretty sure you can't do anything about that. when using random sites found via google, you're at their mercy.

it's like my website is configured to redirect if you try and access a page that doesn't exist. rather than show a 404 message, i just redirect to my home page. try it: http://marc2003.x10host.com/not_a_page


Yes, this is what happens, and script then download nothing.
Only solution is to check if that url can be opened, if not, to use next url..
But then you lost speed..

I have one suggestion, because you now use html, you can also add 'album info', like foo_uie_biography.dll have..

@Zeremy

This would be good for some ''cover tag script''..
But if you want that script always  find image, this is not good..
I think that only google or yahoo should be used here.
Maybe discogs.com , i didnt try this..

As Marc said - better source than last.fm doesn't exist , but is good to have some alternative..

WSH Panel Mod script discussion/help

Reply #3539
- The bio panel could always scan BOTH preferred sites (ex : last.fm english, wikipedia)


well not really. the biggest problem is fetching and processing the response from 2 different sites when i have shared functions configured to use a global setting - one or the other. in theory i could break the functions down so each source can work independently of each other but i really don't want to do that.

if this is such an issue for you, i suggest running 2 instances at the same time and have them in tabs. that's fairly similar to me creating buttons in the top corner.

EDIT - And maybe a small bug report on Thumbs :
- Sometimes downloaded images are corrupted (half-downloaded, impossible to resume download)
- Sometimes a black thumbnail appears instead of the downloaded image, but if I go to the next song then get back to the previous one, the downloaded image appears.


sorry, i've never seen that before and no one else has reported it either. when the download is initiated, i launch an external script that foobar has no control over. nothing you or i could possibly do in foobar (even closing it) will affect this download. i suppose network interruptions or other background processes on your pc may cause it but that's something beyond my control.

edit: i've even tried replicating problems by disconnecting my internet while it's running and killing the process in task manager (cscript.exe) and i'm not being left with any corrupt images at all. i'm at a loss to explain that.

I have one suggestion, because you now use html, you can also add 'album info', like foo_uie_biography.dll have..


i wouldn't use html. the JSON web service still works in full for that. i even used to have it in my scripts but i ditched it a few months back because of the lack of content. i've not had a single complaint either. that just goes to show popular it was.

WSH Panel Mod script discussion/help

Reply #3540
i wouldn't use html. the JSON web service still works in full for that. i even used to have it in my scripts but i ditched it a few months back because of the lack of content. i've not had a single complaint either. that just goes to show popular it was.


Well that's great. I didn't know that

WSH Panel Mod script discussion/help

Reply #3541
marc : fair enough  The tabs idea looks good, I'll try it. As for the download errors, I have experienced them many times already (let's say about 1 in 20 downloads or so), but honestly I can live with that.

WSH Panel Mod script discussion/help

Reply #3542
try saving this file in your marc2003 folder. https://dl.dropboxusercontent.com/u/2280132...mp/download.vbs

this modified version saves images with a .tmp extension so my panel won't detect it. it only gets renamed properly when it's complete.

WSH Panel Mod script discussion/help

Reply #3543
marc, so far so good ! The issue seems to have been completely solved (tested on several dozen songs). Thank you.

WSH Panel Mod script discussion/help

Reply #3544
marc,

Is there a way to replace the cog icon you used in yuckfoo's menu panel with something drawn directly in the panel?

Ideally it would be round, say 20px in diameter and have three states/color states. Normal, hover, and pressed.

I stole that little gem of yours for a config I've been working on and replaced the icon. However, even that looks out of place and thought that maybe a simple round button with configurable color options would look the best.

WSH Panel Mod script discussion/help

Reply #3545
marc, so far so good ! The issue seems to have been completely solved (tested on several dozen songs). Thank you.


bit of an odd one that. i don't really know how the vbscript works but it looked to me like it wasn't writing the file until it was fully downloaded but something was messing it up on your setup??

Is there a way to replace the cog icon you used in yuckfoo's menu panel with something drawn directly in the panel?


yes but don't ask me how. falstaff and extremehunter know about that stuff. i don't bother with it because i have to distribute loads of images with my samples so it's not worth my time learning how. the best i can do is draw a rectangle or line.

WSH Panel Mod script discussion/help

Reply #3546
Paint to the rescue it is then.

WSH Panel Mod script discussion/help

Reply #3547
Bug report for Thumbs : "Set as default" doesn't work for artists whose name ends with a "." (ex : "Boney M.", "Sheila E.").
It works for artists with "." anywhere in their name (ex : "B.o.B"), it only fails when the name ends with a ".".
Thanks in advance.

WSH Panel Mod script discussion/help

Reply #3548
thanks for spotting that. it has now been fixed. right click>Update script.

WSH Panel Mod script discussion/help

Reply #3549
Problem solved ! Thanks marc.

That being said... maybe it's completely unrelated, but since the last update I'm having again some download problems with Thumbs (only from time to time, no big deal - I can live with that, I'm just reporting just in case).
Here's an example : http://i59.tinypic.com/11kl10z.jpg . As you can see, 3 images have just been downloaded and appear, and 2 more have been downloaded... but they don't appear yet.
I can wait for as long as I wish (1min in this example, check the progress bar  ) but they won't appear.
However, if I switch to another artist then back again, then the 5 images display correctly and almost instantly (no new downloads) : http://i57.tinypic.com/2n83c0g.jpg