Sign up here and you can log into the forum!

my next crazy idea - trailers

General WDTVExt forum

Re: my next crazy idea - trailers   

Postby KAD » Sat Feb 18, 2012 1:47 am

:( same result, any other idea's?
If you like my work please consider a Donation. Donate
Please read the appropriate documentation before posting questions! READ ME FAQ WIKI
User avatar
KAD
Global Moderator
 
Posts: 4011
Joined: Mon Apr 12, 2010 4:59 pm
Location: Seattle, WA USA

Re: my next crazy idea - trailers   

Postby recliq » Sat Feb 18, 2012 3:53 am

can you post the complete function containing this code?
­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: 5021
Joined: Thu Apr 15, 2010 8:09 am
Location: Kiel, Germany

Re: my next crazy idea - trailers   

Postby KAD » Sat Feb 18, 2012 11:30 am

ok, that's the main section of code, but here goes

this line occurs 5 times in the entire script 4 in the section below
Code: Select all
if (this.currentTrailer != "") {

of the 5 occurances 2 are not working, both failures run the same line after working with files
the other occurances are working with folders
and 1 occurance working, checks the value in a separate function and works regardless of folder or files selected

just out of curriousity I changed it to
Code: Select all
if (this.currentTrailer == "") {

which is the exact opposite as what I want, but it works

so I tried this
Code: Select all
if (this.currentTrailer == "") {
    this.debug.Log("[ test ]", 2);
} else {
    this.PlayLocal = true;
    return;
}

still works correctly if file is found
but if file is not found
the logger is logged, but it still stops and doesn't continue to the remaining code

the complete function call as it sits currently
Code: Select all
TrailerPlugin.prototype.setSearchName = function(page) {
   this.debug.Log("[ setSearchName starting]", 1);
   this.PlayLocal = false;
   Page.Top.setParam("SearchName", "");
   Page.Top.setParam("Trailer_Icon", "");
   Page.Top.setParam("Trailer", "");
   Page.Top.setParam("Title", "");
   Page.Top.setParam("LocalTrailer", "");
   var Trailer = "";
   this.currentTrailer = Trailer;
   var media = page.selectedMedia;
   if (!media || media == "") {
      return;
   }
   
   var SearchName = "";
   if (media) {
      if (this.Path != "") {
      var Path = this.Path;
         if (media.path.lastIndexOf('/') === media.path.length-1) {
            var LocalTrailer = executeCmd("find '" + Path + "' -maxdepth 1 -name '." + media.name + "_Trailer.mp4'",this.debug.Lib);
            var Trailer = LocalTrailer;
            var Title = media.name;
            this.Title = Title;
            this.currentTrailer = Trailer;
            if (this.currentTrailer != "") {
               this.PlayLocal = true;
               return;
            }
         } else {
            var file = media.name;
            var SearchName = file.substr(0, file.lastIndexOf('.'));
            var LocalTrailer = executeCmd("find '" + Path + "' -maxdepth 1 -name '." + SearchName + "_Trailer.mp4'",this.debug.Lib);
            var Trailer = LocalTrailer;
            this.Title = SearchName;
            this.currentTrailer = Trailer;
            if (this.currentTrailer != "") {
               this.PlayLocal = true;
               return;
            }
         }
      }
      if (media.path.lastIndexOf('/') === media.path.length-1) { 
         var Path = (media.path);
         this.CurrentPath = Path;
         this.Name = media.name;
         var LocalTrailer = executeCmd("find '" + media.path + "' -maxdepth 1 -name '." + media.name + "_Trailer.mp4'",this.debug.Lib);
         var Trailer = LocalTrailer;
         this.currentTrailer = Trailer;
         if (this.currentTrailer != "") {
            this.PlayLocal = true;
            return;
         }
         this.debug.Log("[ metafile folder Path]" + Path, 1);
         var metafile = executeCmd("find '" + media.path + "' -maxdepth 1 -name '" + media.name + ".*.tgmd'",this.debug.Lib); 
         this.debug.Log("[ metafile folder tgmd name]" + metafile, 1);
         var IMDBID = executeCmd("sed -n -e 's/.*<id>\\(.*\\)<\\/id>.*/\\1/p' \"" + metafile + "\"",this.debug.Lib);
         this.debug.Log("[ metafile folder tgmd ID]" + IMDBID, 1);
         this.SearchStream = IMDBID;
         Page.Top.setParam("IMDBID", this.SearchStream);
         if (this.SearchStream == "") { 
            var metafile = executeCmd("find '" + media.path + "' -maxdepth 1 -name '" + "*.nfo'",this.debug.Lib); 
            this.debug.Log("[ metafile folder nfo name]" + metafile, 1);
            var IMDBID = executeCmd("sed -n -e 's/.*<id>\\(.*\\)<\\/id>.*/\\1/p' \"" + metafile + "\"",this.debug.Lib);
            this.debug.Log("[ metafile folder nfo ID]" + IMDBID, 1);
            this.SearchStream = IMDBID;
            Page.Top.setParam("IMDBID", this.SearchStream);
         }
         if (this.SearchStream == "") { 
            SearchName = (media.name);
            this.debug.Log("[ setSearchName folder name]" + SearchName, 1);
            Page.Top.setParam("SearchName", SearchName);
            this.SearchName = SearchName;
            this.debug.Log("[ setSearchName folder path]" + media.path, 1);
            var NameSearchURL = ("http://app.imdb.com/find?q=" + SearchName);
            this.debug.Log("[ SearchName folder curl ]" + NameSearchURL, 2);
            var curl = new CurlEasy(NameSearchURL);
            if (curl.perform()) {
               var content = eval("(" + curl.responseText + ")");
               var result = content.data.results[0];
               var lists = result.list[0];
               if ( lists.tconst == null ) {
                  var Trailer = "";
                  this.currentTrailer = Trailer;
                  return;
               } else {
               var IMDBID = lists.tconst;
               this.debug.Log("[ SearchName folder IMDBID]" + IMDBID, 2);
               this.SearchStream = IMDBID;
               Page.Top.setParam("IMDBID", this.SearchStream);
               }
            }
         }
      } else {
         MediaPath = media.path;
         var Path = MediaPath.substr(0, MediaPath.lastIndexOf('/')); 
         this.CurrentPath = Path;
         file = (media.name);
         SearchName = file.substr(0, file.lastIndexOf('.'));
         this.Name = Searchname;
         var LocalTrailer = executeCmd("find '" + Path + "' -maxdepth 1 -name '." + SearchName + "_Trailer.mp4'",this.debug.Lib);
         var Trailer = LocalTrailer;
         this.currentTrailer = Trailer;
         if (this.currentTrailer != "") {
            this.PlayLocal = true;
            return;
         }
         this.debug.Log("[ metafile file Path]" + Path, 1);
         var metafile = (media.path + ".tgmd"); 
         this.debug.Log("[ metafile file tgmd name]" + metafile, 1) 
         var IMDBID = executeCmd("sed -n -e 's/.*<id>\\(.*\\)<\\/id>.*/\\1/p' \"" + metafile + "\"",this.debug.Lib); 
         this.debug.Log("[ metafile file tgmd ID]" + IMDBID, 1);
         this.SearchStream = IMDBID;
         Page.Top.setParam("IMDBID", this.SearchStream);
         if (this.SearchStream == "" ) {
            var path = (media.path);
            var nfo1 = path.substr(0, path.lastIndexOf('.'));
            var metafile = (nfo1 + ".nfo");
            this.debug.Log("[ metafile file nfo name]" + metafile, 1)
            var IMDBID = executeCmd("sed -n -e 's/.*<id>\\(.*\\)<\\/id>.*/\\1/p' \"" + metafile + "\"",this.debug.Lib);
            this.SearchStream = IMDBID;
            Page.Top.setParam("IMDBID", this.SearchStream);
         }
         if (this.SearchStream == "" ) {
            file = (media.name);
            SearchName = file.substr(0, file.lastIndexOf('.'));
            this.debug.Log("[ setSearchName file name]" + SearchName, 1);
            Page.Top.setParam("SearchName", SearchName);
            this.SearchName = SearchName;
            var NameSearchURL = ("http://app.imdb.com/find?q=" + SearchName);
            this.debug.Log("[ SearchName file curl ]" + NameSearchURL, 2);
            var curl = new CurlEasy(NameSearchURL);
            if (curl.perform()) {
               var content = eval("(" + curl.responseText + ")");
               var result = content.data.results[0];
               this.debug.Log("[ SearchName folder IMDBID]" + result, 2);
               var lists = result.list[0];
               if ( lists.tconst == null ) {
                  var Trailer = "";
                  this.currentTrailer = Trailer;
                  return;
               } else {
               var IMDBID = lists.tconst;
               this.debug.Log("[ SearchName file IMDBID]" + IMDBID, 2);
               this.SearchStream = IMDBID;
               Page.Top.setParam("IMDBID", this.SearchStream);
               }
            }
         }
      }
   }
   
   var SearchID = ("http://app.imdb.com/title/maindetails?tconst=" + IMDBID);
   this.debug.Log("[ get video id curl ]" + SearchID, 2);
   var curl2 = new CurlEasy(SearchID);
   if (curl2.perform()) {
      var content2 = eval("(" + curl2.responseText + ")");
      var Title = content2.data.title;
      this.Title = Title;
      Page.Top.setParam("Title", this.Title);
      if ( content2.data.trailer == null ) {
      var Trailer = "";
      this.currentTrailer = Trailer;
         return;
      } else {
      var TrailerID = content2.data.trailer.id;
      this.debug.Log("[ get video id] " + TrailerID, 2);   
      }
   }
   this.trailerid = TrailerID;
   Page.Top.setParam("TrailerID", this.trailerid);
   
   if (this.Format == "") {
      this.Format = "240p";
   }
   
   var URL = ("http://www.imdb.com/video/imdb/" + this.trailerid + "/html5?format=" + this.Format);
   this.debug.Log("[ get real URL ]" + URL, 2);
   this.URL = URL;
   var curl3 = new CurlEasy(URL);
   if (curl3.perform()) {
      var StreamHTML = curl3.responseText;
      StreamHTML.match(/mp4_h264\s+:\s+\'([^\']+)\'/);
      var Trailer = RegExp.$1;
      this.currentTrailer = Trailer;
      this.debug.Log("[ Real URL ]" + Trailer, 2);
   }
}
If you like my work please consider a Donation. Donate
Please read the appropriate documentation before posting questions! READ ME FAQ WIKI
User avatar
KAD
Global Moderator
 
Posts: 4011
Joined: Mon Apr 12, 2010 4:59 pm
Location: Seattle, WA USA

Re: my next crazy idea - trailers   

Postby dzebrys » Sat Feb 18, 2012 3:17 pm

KAD wrote:this line occurs 5 times in the entire script 4 in the section belowCode: Select allif (this.currentTrailer != "") {of the 5 occurances 2 are not working, both failures run the same line after working with filesthe other occurances are working with foldersand 1 occurance working, checks the value in a separate function and works regardless of folder or files selected


in js for conditions you need to use !==, ===


br/piotr
User avatar
dzebrys
DLX'er
 
Posts: 130
Joined: Mon Feb 14, 2011 1:49 am
Location: poland

Re: my next crazy idea - trailers   

Postby KAD » Sat Feb 18, 2012 3:23 pm

that doesn't explain why it works in other sections, but easy enough to try, I'll report shortly
If you like my work please consider a Donation. Donate
Please read the appropriate documentation before posting questions! READ ME FAQ WIKI
User avatar
KAD
Global Moderator
 
Posts: 4011
Joined: Mon Apr 12, 2010 4:59 pm
Location: Seattle, WA USA

Re: my next crazy idea - trailers   

Postby KAD » Sat Feb 18, 2012 3:27 pm

was a good idea, but nope

here's the output
Code: Select all
Lib: [executeCmd]  cmd: find '/tmp/mnt/E8FA-9D51/Trailers/' -maxdepth 1 -name '.2012_Trailer.mp4'
Lib: [executeCmd]  completed.
Trailer: [setTrailerICON]
Trailer: [setTrailerICON] disabled


using !==
the code doesn't stop
but it also should not return to setTrailerICON
it should continue with additional code in the same function
If you like my work please consider a Donation. Donate
Please read the appropriate documentation before posting questions! READ ME FAQ WIKI
User avatar
KAD
Global Moderator
 
Posts: 4011
Joined: Mon Apr 12, 2010 4:59 pm
Location: Seattle, WA USA

Re: my next crazy idea - trailers   

Postby recliq » Sat Feb 18, 2012 3:27 pm

dzebrys wrote:
KAD wrote:this line occurs 5 times in the entire script 4 in the section belowCode: Select allif (this.currentTrailer != "") {of the 5 occurances 2 are not working, both failures run the same line after working with filesthe other occurances are working with foldersand 1 occurance working, checks the value in a separate function and works regardless of folder or files selected


in js for conditions you need to use !==, ===


br/piotr

not true.
== and != are valid comparison operators but check only for values with automatic type conversion.
=== and !== compare value AND type.
http://www.devguru.com/technologies/ecmascript/quickref/comparison_operators.html
­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: 5021
Joined: Thu Apr 15, 2010 8:09 am
Location: Kiel, Germany

Re: my next crazy idea - trailers   

Postby KAD » Sat Feb 18, 2012 7:47 pm

update, I seem to have moved beyond the exact problem above but still have a very similar issue

here's the entire function again after today's edits
Code: Select all

TrailerPlugin.prototype.setSearchName = function(page) {
   this.debug.Log("[ setSearchName starting]", 1);
   this.PlayLocal = false;
   Page.Top.setParam("SearchName", "");
   Page.Top.setParam("Trailer_Icon", "");
   Page.Top.setParam("Trailer", "");
   Page.Top.setParam("Title", "");
   Page.Top.setParam("LocalTrailer", "");
   var Trailer = "";
   this.currentTrailer = Trailer;
   this.SearchStream = "";
   var Name = "";
   this.Name = Name;
   Page.Top.setParam("LoadingScreen", "");
   var media = page.selectedMedia;
   if (!media || media == "") {
      return;
   }
   
   var SearchName = "";
   if (media) {
      if (this.Path != "") {
      var Path = this.Path;
         if (media.path.lastIndexOf('/') === media.path.length-1) {
            var LocalTrailer = executeCmd("find '" + Path + "/' -maxdepth 1 -name '." + media.name + "_Trailer.mp4'",this.debug.Lib);
            var Trailer = LocalTrailer;
            var Title = media.name;
            this.Title = Title;
            this.currentTrailer = Trailer;
            if (this.currentTrailer != "") {
               this.PlayLocal = true;
               return;
            }
            var Name = media.name;
            this.Name = Name;
            var metafile = executeCmd("find '" + Path + "/' -maxdepth 1 -name '" + media.name + ".*.tgmd'",this.debug.Lib);
            var IMDBID = executeCmd("sed -n -e 's/.*<id>\\(.*\\)<\\/id>.*/\\1/p' \"" + metafile + "\"",this.debug.Lib);
            this.debug.Log("[ metafile folder tgmd ID]" + IMDBID, 1);
            this.SearchStream = IMDBID;
            Page.Top.setParam("IMDBID", this.SearchStream);
            Page.Top.setParam("Name", this.Name);
         } else {
            var file = media.name;
            var SearchName = file.substr(0, file.lastIndexOf('.'));
            var LocalTrailer = executeCmd("find '" + Path + "/' -maxdepth 1 -name '." + SearchName + "_Trailer.mp4'",this.debug.Lib);
            var Trailer = LocalTrailer;
            this.Title = SearchName;
            this.currentTrailer = Trailer;
            if (this.currentTrailer != "") {
               this.PlayLocal = true;
               return;
            }
            var Name = SearchName;
            this.Name = Name;
            var metafile = executeCmd("find '" + Path + "/' -maxdepth 1 -name '" + media.name + ".tgmd'",this.debug.Lib);
            var IMDBID = executeCmd("sed -n -e 's/.*<id>\\(.*\\)<\\/id>.*/\\1/p' \"" + metafile + "\"",this.debug.Lib); 
            this.debug.Log("[ metafile file tgmd ID]" + IMDBID, 1);
            this.SearchStream = IMDBID;
            Page.Top.setParam("IMDBID", this.SearchStream);
            Page.Top.setParam("Name", this.Name);
         }
      }
      if (this.SearchStream == "") {
         if (media.path.lastIndexOf('/') === media.path.length-1) { 
            this.CurrentPath = Path;
            var Name = media.name;
            this.Name = Name;
            Page.Top.setParam("Name", this.Name);
            var LocalTrailer = executeCmd("find '" + media.path + "' -maxdepth 1 -name '." + media.name + "_Trailer.mp4'",this.debug.Lib);
            var Trailer = LocalTrailer;
            this.currentTrailer = Trailer;
            if (this.currentTrailer != "") {
               this.PlayLocal = true;
               return;
            }
            this.debug.Log("[ metafile folder Path]" + Path, 1);
            var metafile = executeCmd("find '" + media.path + "' -maxdepth 1 -name '" + media.name + ".*.tgmd'",this.debug.Lib); 
            this.debug.Log("[ metafile folder tgmd name]" + metafile, 1);
            var IMDBID = executeCmd("sed -n -e 's/.*<id>\\(.*\\)<\\/id>.*/\\1/p' \"" + metafile + "\"",this.debug.Lib);
            this.debug.Log("[ metafile folder tgmd ID]" + IMDBID, 1);
            this.SearchStream = IMDBID;
            Page.Top.setParam("IMDBID", this.SearchStream);
            if (this.SearchStream == "") { 
               var metafile = executeCmd("find '" + media.path + "' -maxdepth 1 -name '" + "*.nfo'",this.debug.Lib); 
               this.debug.Log("[ metafile folder nfo name]" + metafile, 1);
               var IMDBID = executeCmd("sed -n -e 's/.*<id>\\(.*\\)<\\/id>.*/\\1/p' \"" + metafile + "\"",this.debug.Lib);
               this.debug.Log("[ metafile folder nfo ID]" + IMDBID, 1);
               this.SearchStream = IMDBID;
               Page.Top.setParam("IMDBID", this.SearchStream);
            }
            if (this.SearchStream == "") { 
               SearchName = (media.name);
               this.debug.Log("[ setSearchName folder name]" + SearchName, 1);
               Page.Top.setParam("SearchName", SearchName);
               this.SearchName = SearchName;
               this.debug.Log("[ setSearchName folder path]" + media.path, 1);
               var NameSearchURL = ("http://app.imdb.com/find?q=" + SearchName);
               this.debug.Log("[ SearchName folder curl ]" + NameSearchURL, 2);
               var curl = new CurlEasy(NameSearchURL);
               if (curl.perform()) {
                  var content = eval("(" + curl.responseText + ")");
                  var result = content.data.results[0];
                  var lists = result.list[0];
                  if ( lists.tconst == null ) {
                     var Trailer = "";
                     this.currentTrailer = Trailer;
                     return;
                  } else {
                  var IMDBID = lists.tconst;
                  this.debug.Log("[ SearchName folder IMDBID]" + IMDBID, 2);
                  this.SearchStream = IMDBID;
                  Page.Top.setParam("IMDBID", this.SearchStream);
                  }
               }
            }
         } else {
            MediaPath = media.path;
            var Path = MediaPath.substr(0, MediaPath.lastIndexOf('/')); 
            this.CurrentPath = Path;
            file = (media.name);
            SearchName = file.substr(0, file.lastIndexOf('.'));
            var Name = Searchname;
            this.Name = Searchname;
            Page.Top.setParam("Name", this.Name);
            var LocalTrailer = executeCmd("find '" + Path + "' -maxdepth 1 -name '." + SearchName + "_Trailer.mp4'",this.debug.Lib);
            var Trailer = LocalTrailer;
            this.currentTrailer = Trailer;
            if (this.currentTrailer != "") {
               this.PlayLocal = true;
               return;
            }
            this.debug.Log("[ metafile file Path]" + Path, 1);
            var metafile = (media.path + ".tgmd"); 
            this.debug.Log("[ metafile file tgmd name]" + metafile, 1) 
            var IMDBID = executeCmd("sed -n -e 's/.*<id>\\(.*\\)<\\/id>.*/\\1/p' \"" + metafile + "\"",this.debug.Lib); 
            this.debug.Log("[ metafile file tgmd ID]" + IMDBID, 1);
            this.SearchStream = IMDBID;
            Page.Top.setParam("IMDBID", this.SearchStream);
            if (this.SearchStream == "" ) {
               var path = (media.path);
               var nfo1 = path.substr(0, path.lastIndexOf('.'));
               var metafile = (nfo1 + ".nfo");
               this.debug.Log("[ metafile file nfo name]" + metafile, 1)
               var IMDBID = executeCmd("sed -n -e 's/.*<id>\\(.*\\)<\\/id>.*/\\1/p' \"" + metafile + "\"",this.debug.Lib);
               this.SearchStream = IMDBID;
               Page.Top.setParam("IMDBID", this.SearchStream);
            }
            if (this.SearchStream == "" ) {
               file = (media.name);
               SearchName = file.substr(0, file.lastIndexOf('.'));
               this.debug.Log("[ setSearchName file name]" + SearchName, 1);
               Page.Top.setParam("SearchName", SearchName);
               this.SearchName = SearchName;
               var NameSearchURL = ("http://app.imdb.com/find?q=" + SearchName);
               this.debug.Log("[ SearchName file curl ]" + NameSearchURL, 2);
               var curl = new CurlEasy(NameSearchURL);
               if (curl.perform()) {
                  var content = eval("(" + curl.responseText + ")");
                  var result = content.data.results[0];
                  this.debug.Log("[ SearchName folder IMDBID]" + result, 2);
                  var lists = result.list[0];
                  if ( lists.tconst == null ) {
                     var Trailer = "";
                     this.currentTrailer = Trailer;
                     return;
                  } else {
                  var IMDBID = lists.tconst;
                  this.debug.Log("[ SearchName file IMDBID]" + IMDBID, 2);
                  this.SearchStream = IMDBID;
                  Page.Top.setParam("IMDBID", this.SearchStream);
                  }
               }
            }
         }
      }
   }
   
   if ( IMDBID == "" ) {
      return;
   }
   var SearchID = ("http://app.imdb.com/title/maindetails?tconst=" + IMDBID);
   this.debug.Log("[ get video id curl ]" + SearchID, 2);
   var curl2 = new CurlEasy(SearchID);
   if (curl2.perform()) {
      var content2 = eval("(" + curl2.responseText + ")");
      var Title = content2.data.title;
      this.Title = Title;
      Page.Top.setParam("Title", this.Title);
      if ( content2.data.trailer == null ) {
      var Trailer = "";
      this.currentTrailer = Trailer;
         return;
      } else {
      var TrailerID = content2.data.trailer.id;
      this.debug.Log("[ get video id] " + TrailerID, 2);   
      }
   }
   this.trailerid = TrailerID;
   Page.Top.setParam("TrailerID", this.trailerid);
   
   if (this.Format == "") {
      this.Format = "240p";
   }
   
   if (this.trailerid == "") {
      return;
   }
   var URL = ("http://www.imdb.com/video/imdb/" + this.trailerid + "/html5?format=" + this.Format);
   this.debug.Log("[ get real URL ]" + URL, 2);
   this.URL = URL;
   var curl3 = new CurlEasy(URL);
   if (curl3.perform()) {
      var StreamHTML = curl3.responseText;
      StreamHTML.match(/mp4_h264\s+:\s+\'([^\']+)\'/);
      var Trailer = RegExp.$1;
      this.currentTrailer = Trailer;
      this.debug.Log("[ Real URL ]" + Trailer, 2);
   }
}


and here a smaller section to focus on
Code: Select all
} else {
            var file = media.name;
            var SearchName = file.substr(0, file.lastIndexOf('.'));
            var LocalTrailer = executeCmd("find '" + Path + "/' -maxdepth 1 -name '." + SearchName + "_Trailer.mp4'",this.debug.Lib);
            var Trailer = LocalTrailer;
            this.Title = SearchName;
            this.currentTrailer = Trailer;
            if (this.currentTrailer != "") {
               this.PlayLocal = true;
               return;
            }
            var Name = SearchName;
            this.Name = Name;
            var metafile = executeCmd("find '" + Path + "/' -maxdepth 1 -name '" + media.name + ".tgmd'",this.debug.Lib);
            var IMDBID = executeCmd("sed -n -e 's/.*<id>\\(.*\\)<\\/id>.*/\\1/p' \"" + metafile + "\"",this.debug.Lib); 
            this.debug.Log("[ metafile file tgmd ID]" + IMDBID, 1);
            this.SearchStream = IMDBID;
            Page.Top.setParam("IMDBID", this.SearchStream);
            Page.Top.setParam("Name", this.Name);
         }


it goes past the problem from earlier today and stops on
Code: Select all
this.SearchStream = IMDBID;
this line is found 8 times in the code and only this instance does not work
again this only happens when no file exist
my best guess is,some odd syntax issue

edit:
this gets even wierder
if I delete
Code: Select all
var Name = SearchName;
            this.Name = Name;
            var metafile = executeCmd("find '" + Path + "/' -maxdepth 1 -name '" + media.name + ".tgmd'",this.debug.Lib);
            var IMDBID = executeCmd("sed -n -e 's/.*<id>\\(.*\\)<\\/id>.*/\\1/p' \"" + metafile + "\"",this.debug.Lib); 
            this.debug.Log("[ metafile file tgmd ID]" + IMDBID, 1);
            this.SearchStream = IMDBID;
            Page.Top.setParam("IMDBID", this.SearchStream);
            Page.Top.setParam("Name", this.Name);


the code stops in the same place it did earlier today

so I added the lines back in and once again it, does not stop until this line
Code: Select all
this.SearchStream = IMDBID;
If you like my work please consider a Donation. Donate
Please read the appropriate documentation before posting questions! READ ME FAQ WIKI
User avatar
KAD
Global Moderator
 
Posts: 4011
Joined: Mon Apr 12, 2010 4:59 pm
Location: Seattle, WA USA

Re: my next crazy idea - trailers   

Postby recliq » Sun Feb 19, 2012 2:11 am

Arg, I'm so blind and your problem is quite obvious... :lol:

executeCmd() ALWAYS returns an ARRAY not a STRING!

so it should be
Code: Select all
this.SearchStream = IMDBID[0];


to check if executeCmd() returned any results do
Code: Select all
if (IMDBID.length > 0) {}

:mrgreen: :geek:
­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: 5021
Joined: Thu Apr 15, 2010 8:09 am
Location: Kiel, Germany

Re: my next crazy idea - trailers   

Postby Jeffmaster » Mon Mar 26, 2012 1:25 am

Did you give up?
Jeffmaster
WDTVer
 
Posts: 24
Joined: Wed Sep 07, 2011 12:34 pm

PreviousNext

Return to WDTVExt discussion

Who is online

Users browsing this forum: No registered users and 1 guest