Sign up here and you can log into the forum!

extra.js error

The place to report WDTVExt bus

extra.js error   

Postby KAD » Sun Oct 28, 2012 7:59 pm

so maybe a bug, or maybe not

here's what I'm seeing tonight

firmware 1.05.04-dev

here a bit of log data
Code: Select all
Trailer: [ setSearchName file name]The Amazing SpiderMan
Trailer: [ remove special characters ]The Amazing SpiderMan
Trailer: [ Formated Name ]The0X0.0000000000029P-1022mazing/wdtvext/js/extra.js:34:Error: Command failed with exit code -1


Correct Formatted name should be "The%20Amazing%20SpiderMan"
this is working with other files and folders just fine (all white spaces are replaced by %20)
it seems that extra.js is trying to do some math instead of just printing the text

here's an example of the code that produced this
Code: Select all
var RemoveCharacters = SearchName.replace(/[^\w\s]/gi, ''); //remove special characters
var FormatedName = RemoveCharacters.replace(/ /g,"%20"); //replace white spaces with %20 as required by api
this.debug.Log("[ remove special characters ]" + RemoveCharacters, 1);
this.debug.Log("[ Formated Name ]" + FormatedName, 1);


I've only been able to produce this with the 1 file,

bug ?? you tell me

I can't see any errors in my plugin, or in extra.js
If you like my work please consider a Donation. Donate
Please read the appropriate documentation before posting questions! READ ME FAQ WIKI
PM's are for private matters. Post support questions to the appropriate forum, or they will be ignored.
User avatar
KAD
Global Moderator
 
Posts: 5103
Joined: Mon Apr 12, 2010 4:59 pm
Location: Seattle, WA USA

Re: extra.js error   

Postby recliq » Mon Oct 29, 2012 3:44 am

hmmm, line 34 (the one throwing the error) reads:
Code: Select all
traceln(this.Prefix + " " + text);


I'd guess it's something wrong with that string...
First thing to try is to replace the debug.Log command with a simple traceln()...

I also tested this code in Firebug, which works just fine...
Code: Select all
var SearchName = "The Amazing SpiderMan";
var RemoveCharacters = SearchName.replace(/[^\w\s]/gi, '');
var FormatedName = RemoveCharacters.replace(/ /g,'%20');
alert('RemoveCharacters: ' + RemoveCharacters);
alert('FormatedName: ' + FormatedName);
­WDLXTV Project Maintainer
-:] If you like my contributions feel free to donate for a beer or a new flash drive. ...and always remember: RTFM! (README, FAQ, WIKI) [:-
User avatar
recliq
WDLXTV Team
 
Posts: 5513
Joined: Thu Apr 15, 2010 8:09 am
Location: Kiel, Germany

Re: extra.js error   

Postby KAD » Mon Oct 29, 2012 7:41 pm

well, the short version

no error in extra.js

the long version here's some log data

Code: Select all
Working with traceln & this.debug
Trailer: [ setSearchName folder name]Alien vs Predator
Trailer: [ remove special characters ]Alien vs Predator
Trailer: [ setSearchName folder path]/tmp/media/usb/USB1/Action/Alien vs Predator/
Trailer: [ Formated Name ]Alien%20vs%20Predator
Trailer: [ SearchName folder curl ]http://app.imdb.com/find?q=Alien%20vs%20Predator&appid=0&device=0&sig=0

Working but looks odd with traceln & this.debug
Trailer: [ setSearchName file name]Abraham Lincoln Vampire Hunter
Trailer: [ remove special characters ]Abraham Lincoln Vampire Hunter
[ Formated Name ]Abraham   62123953900582924ncoln%20Vampire%20Hunter
Trailer: [ SearchName file curl ]http://app.imdb.com/find?q=Abraham   62124124958070450ncoln%20Vampire%20Hunter&appid=0&device=0&sig=0
no packet capture, but suspect curl passed the url correctly, not as noted above, trailer did play correctly

Not working with traceln & this.debug
Trailer: [ setSearchName file name]The Amazing SpiderMan
Trailer: [ remove special characters ]The Amazing SpiderMan
[ Formated Name ]The0X1.71C702C49780CP-1007mazing/tmp/wdtvext-plugins/Trailer/Trailer.plugin.js:534:Error: Command failed with exit code -1

Working with traceln & this.debug
Trailer: [ setSearchName file name]10000 BC
Trailer: [ remove special characters ]10000 BC
[ Formated Name ]10000%20BC
Trailer: [ SearchName file curl ]http://app.imdb.com/find?q=10000%20BC&appid=0&device=0&sig=0

Working with traceln & this.debug
Trailer: [ setSearchName file name]Alien vs Predator
Trailer: [ remove special characters ]Alien vs Predator
[ Formated Name ]Alien%20vs%20Predator
Trailer: [ SearchName file curl ]http://app.imdb.com/find?q=Alien%20vs%20Predator&appid=0&device=0&sig=0

Working with traceln & this.debug
Trailer: [ setSearchName file name]Men In Black 3
Trailer: [ remove special characters ]Men In Black 3
[ Formated Name ]Men%20In%20Black%203
Trailer: [ SearchName file curl ]http://app.imdb.com/find?q=Men%20In%20Black%203&appid=0&device=0&sig=0

Remove logger/traceln and it works
Trailer: [ metafile file Path]/tmp/media/usb/USB1/Action
Trailer: [ setSearchName file name]The Amazing SpiderMan
Trailer: [ remove special characters ]The Amazing SpiderMan
Trailer: [ curl.reponseText ]{"@meta":{"serverTimeMs":70,"requestId":"1ZS8N73TBW1V6RWK5RMZ"},"data":{"fields":["title","name"],"q":"the amazing spiderman",.....


So I still have no idea what is causing this error.
but it only has to do with logging the string because curl is passing the string correctly

for now I've just removed the debug statement and everything works
If you like my work please consider a Donation. Donate
Please read the appropriate documentation before posting questions! READ ME FAQ WIKI
PM's are for private matters. Post support questions to the appropriate forum, or they will be ignored.
User avatar
KAD
Global Moderator
 
Posts: 5103
Joined: Mon Apr 12, 2010 4:59 pm
Location: Seattle, WA USA


Return to WDTVExt bugs

Who is online

Users browsing this forum: No registered users and 1 guest