-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathfilter.js
More file actions
58 lines (52 loc) · 1.29 KB
/
Copy pathfilter.js
File metadata and controls
58 lines (52 loc) · 1.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
/*jslint node: true */
"use strict";
var endTime = function (a, b) {
if (a.endTime < b.endTime) {
return -1;
}
if (a.endTime > b.endTime) {
return 1;
}
return 0;
};
var startTime = function (a, b) {
if (a.startTime < b.startTime) {
return -1;
}
if (a.startTime > b.startTime) {
return 1;
}
return 0;
};
var channels = function (tuner_channels, tvguide_channels) {
var chan = "";
for (chan in tvguide_channels) {
if (!tuner_channels[tvguide_channels[chan].Channel.Number.replace('.', '-')]) {
tvguide_channels.splice(chan, 1);
}
}
return tvguide_channels;
};
var shows = function (tvguide_channels) {
var res = tvguide_channels;
var chan = "";
var epi = "";
var temp = "";
for (chan in res) {
for (epi in res[chan].ProgramSchedules) {
//console.log(res[chan].ProgramSchedules[epi].Title);
temp = "";
temp = res[chan].ProgramSchedules[epi].Title.replace(/[^\x20-\x7E]+/g, '');
if (temp.indexOf("Paid") !== -1) {
res[chan].ProgramSchedules.splice(epi, 1);
}
}
}
return res;
};
module.exports = {
endTime: endTime,
startTime: startTime,
channels: channels,
shows: shows
};