@krx3d/tizentube2 1.15.950 → 1.15.970

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@krx3d/tizentube2",
3
3
  "appName": "TizenTube",
4
- "version": "1.15.950",
4
+ "version": "1.15.970",
5
5
  "description": "TizenTube is an ad-free and sponsor-free solution for your favourite streaming website on your Tizen (Samsung) TVs.",
6
6
  "packageType": "mods",
7
7
  "websiteURL": "https://youtube.com/tv?additionalDataUrl=http%3A%2F%2Flocalhost%3A8085%2Fdial%2Fapps%2FYouTube",
@@ -47,22 +47,48 @@
47
47
  // firing at all). Same /tv-log target and payload shape as the
48
48
  // service's own relayLog, so scripts/log-receiver/receiver.ps1 needs
49
49
  // no changes.
50
+ // The one place the receiver address is written down. index.html cannot
51
+ // read the user's setting — that lives in the page's localStorage, a
52
+ // different origin — so this stays a constant, but only one.
53
+ var LOG_RECEIVER_HOST = '192.168.50.57';
54
+ var LOG_RECEIVER_PORT = 3030;
55
+ var receiverAnnounced = false;
56
+
50
57
  function sendLog(level, message) {
58
+ var ts = new Date().toISOString();
59
+ var entry = {
60
+ _formatted: '[' + ts + '] [' + level + '] [StandaloneIndexHtml] ' + message,
61
+ app: 'TizenTube Standalone',
62
+ ts: ts,
63
+ level: level,
64
+ context: 'StandaloneIndexHtml',
65
+ message: message
66
+ };
67
+ // Posted straight to the receiver, because this runs before the
68
+ // service exists and has to catch failures that stop it starting.
51
69
  try {
52
- var ts = new Date().toISOString();
53
- fetch('http://192.168.50.57:3030/tv-log', {
70
+ fetch('http://' + LOG_RECEIVER_HOST + ':' + LOG_RECEIVER_PORT + '/tv-log', {
54
71
  method: 'POST',
55
72
  headers: { 'Content-Type': 'application/json' },
56
- body: JSON.stringify({
57
- _formatted: '[' + ts + '] [' + level + '] [StandaloneIndexHtml] ' + message,
58
- app: 'TizenTube Standalone',
59
- ts: ts,
60
- level: level,
61
- context: 'StandaloneIndexHtml',
62
- message: message
63
- })
73
+ body: JSON.stringify(entry)
64
74
  }).catch(function () { });
65
75
  } catch (e) { }
76
+ // The service has no configuration of its own, and its own logs —
77
+ // logServiceEvent, plus everything the injector relays — pass no
78
+ // host, so blanking its hardcoded default silenced that entire
79
+ // channel. Telling it the address here brings [StandaloneService]
80
+ // and [Injector] lines back. Only the address is sent, not the
81
+ // entry, so nothing is logged twice; retried until one gets
82
+ // through, because the service may not be listening yet.
83
+ if (!receiverAnnounced) {
84
+ try {
85
+ fetch('http://localhost:8099/tizentube/receiver', {
86
+ method: 'POST',
87
+ headers: { 'Content-Type': 'application/json' },
88
+ body: JSON.stringify({ host: LOG_RECEIVER_HOST, port: LOG_RECEIVER_PORT })
89
+ }).then(function () { receiverAnnounced = true; }).catch(function () { });
90
+ } catch (e) { }
91
+ }
66
92
  }
67
93
 
68
94
  sendLog('INFO', 'index.html script started');