diff options
Diffstat (limited to 'smarttv-client/Javascript/Data.js')
-rwxr-xr-x | smarttv-client/Javascript/Data.js | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/smarttv-client/Javascript/Data.js b/smarttv-client/Javascript/Data.js index e7049ee..2b95fa7 100755 --- a/smarttv-client/Javascript/Data.js +++ b/smarttv-client/Javascript/Data.js @@ -48,6 +48,10 @@ Data.dumpFolderStruct = function(){ Main.log("---------- dumpFolderStruct Done -------");
};
+Data.findEpgUpdateTime = function() {
+ return this.assets.findEpgUpdateTime(Display.GetEpochTime() + 10000, "", 0);
+ // min, guid, level
+};
Data.getCurrentItem = function () {
return this.folderList[this.folderList.length-1].item;
};
@@ -123,6 +127,34 @@ Item.prototype.addChild = function (key, pyld, level) { }
};
+Item.prototype.findEpgUpdateTime = function (min, guid, level) {
+ var prefix= "";
+ for (var i = 0; i < level; i++)
+ prefix += "-";
+
+ for (var i = 0; i < this.childs.length; i++) {
+ if (this.childs[i].isFolder == true) {
+ var res = this.childs[i].findEpgUpdateTime(min, guid, level+1);
+ min = res.min;
+ guid = res.guid;
+ }
+ else {
+ var digi =new Date(this.childs[i].payload['start'] * 1000);
+ var str = digi.getHours() + ":" + digi.getMinutes();
+
+ Main.log(prefix + "min= " + min+ " start= " + this.childs[i].payload['start'] + " (" + str+ ") title= " + this.childs[i].title);
+
+ if ((this.childs[i].payload['start'] != 0) && ((this.childs[i].payload['start'] + this.childs[i].payload['dur']) < min)) {
+ min = this.childs[i].payload['start'] + this.childs[i].payload['dur'];
+ guid = this.childs[i].payload['guid'] ;
+ Main.log(prefix + "New Min= " + min + " new id= " + guid + " title= " + this.childs[i].title);
+ }
+ }
+ }
+
+ return { "min": min, "guid" : guid};
+};
+
Item.prototype.print = function(level) {
var prefix= "";
for (var i = 0; i < level; i++)
|