diff options
author | thlo <t.lohmar@gmx.de> | 2013-01-27 21:43:19 +0100 |
---|---|---|
committer | thlo <t.lohmar@gmx.de> | 2013-01-27 21:43:19 +0100 |
commit | cb79f356b321eb4af6e24b2e0b7206a4c1d4e548 (patch) | |
tree | c4351beddd53183b8fa667fa8b4fd3777c251965 /smarttv-client/Javascript/Data.js | |
parent | e1766a1d404884247df96d4f631245bdc2d3d74a (diff) | |
download | vdr-plugin-smarttvweb-cb79f356b321eb4af6e24b2e0b7206a4c1d4e548.tar.gz vdr-plugin-smarttvweb-cb79f356b321eb4af6e24b2e0b7206a4c1d4e548.tar.bz2 |
Localtime shown in Main and Video Select Menu.
Free HDD space shown in Main and Video Select Menu.
Title in progress overlay are single lined (no overflow).
EPG data of Live channels are updated.
Navigation (Page Up / down, Return, etc) more consistent.
Diffstat (limited to 'smarttv-client/Javascript/Data.js')
-rwxr-xr-x | smarttv-client/Javascript/Data.js | 57 |
1 files changed, 46 insertions, 11 deletions
diff --git a/smarttv-client/Javascript/Data.js b/smarttv-client/Javascript/Data.js index 2b95fa7..03b7a31 100755 --- a/smarttv-client/Javascript/Data.js +++ b/smarttv-client/Javascript/Data.js @@ -10,7 +10,8 @@ Data.reset = function() { this.folderList = [];
- this.folderList.push({item : this.assets, id: 0});
+// this.folderList.push({item : this.assets, id: 0});
+ Main.log("Data.reset: folderList.push. this.folderList.length= " + this.folderList.length);
};
Data.completed= function(sort) {
@@ -18,26 +19,31 @@ Data.completed= function(sort) { this.assets.sortPayload();
this.folderList.push({item : this.assets, id: 0});
+ Main.log("Data.completed: folderList.push. this.folderList.length= " + this.folderList.length);
Main.log ("Data.completed()= " +this.folderList.length);
};
-Data.selectFolder = function (idx) {
- this.folderList.push({item : this.getCurrentItem().childs[idx], id: idx});
+Data.selectFolder = function (idx, first_idx) {
+ this.folderList.push({item : this.getCurrentItem().childs[idx], id: idx, first:first_idx});
+ Main.log("Data.selectFolder: folderList.push. this.folderList.length= " + this.folderList.length);
+};
+
+Data.folderUp = function () {
+ itm = this.folderList.pop();
+ Main.log("Data.folderUp: folderList.pop. this.folderList.length= " + this.folderList.length);
+ return itm;
+// return itm.id;
};
Data.isRootFolder = function() {
+ Main.log("Data.isRootFolder: this.folderList.length= " + this.folderList.length);
if (this.folderList.length == 1)
return true;
else
return false;
};
-Data.folderUp = function () {
- itm = this.folderList.pop();
- return itm.id;
-};
-
Data.addItem = function(t_list, pyld) {
this.assets.addChild(t_list, pyld, 0);
};
@@ -52,12 +58,16 @@ Data.findEpgUpdateTime = function() { return this.assets.findEpgUpdateTime(Display.GetEpochTime() + 10000, "", 0);
// min, guid, level
};
+
+Data.updateEpg = function (guid, entry) {
+ this.assets.updateEpgEntry(guid, entry, 0);
+};
+
Data.getCurrentItem = function () {
return this.folderList[this.folderList.length-1].item;
};
-Data.getVideoCount = function()
-{
+Data.getVideoCount = function() {
return this.folderList[this.folderList.length-1].item.childs.length;
};
@@ -142,12 +152,13 @@ Item.prototype.findEpgUpdateTime = function (min, guid, level) { 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);
+// 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);
+// Main.logToServer(prefix + "New Min= " + min + " new id= " + guid + " title= " + this.childs[i].title);
}
}
}
@@ -155,6 +166,30 @@ Item.prototype.findEpgUpdateTime = function (min, guid, level) { return { "min": min, "guid" : guid};
};
+Item.prototype.updateEpgEntry = function (guid, entry, 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].updateEpgEntry(guid, entry, level+1);
+ if (res == true)
+ return true;
+ }
+ else {
+ if (this.childs[i].payload['guid'] == guid) {
+ Main.log("updateEpgEntry: Found " + this.childs[i].title);
+ this.childs[i].payload.prog = entry.prog;
+ this.childs[i].payload.desc = entry.desc;
+ this.childs[i].payload.start = entry.start;
+ this.childs[i].payload.dur = entry.dur;
+ return true;
+ }
+ }
+ }
+ return false;
+};
+
Item.prototype.print = function(level) {
var prefix= "";
for (var i = 0; i < level; i++)
|