eyevinn-channel-engine 4.2.5 → 4.2.6

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.
@@ -255,8 +255,8 @@ var ChannelEngine = /** @class */ (function () {
255
255
  this.server.get('/health', this._handleAggregatedSessionHealth.bind(this));
256
256
  this.server.get('/health/:sessionId', this._handleSessionHealth.bind(this));
257
257
  this.server.get('/reset', this._handleSessionReset.bind(this));
258
- this.server.get(this.dummySubtitleEndpoint, this._handleDummySubtitleEndpoint.bind(this));
259
- this.server.get(this.subtitleSliceEndpoint, this._handleSubtitleSliceEndpoint.bind(this));
258
+ this.server.get(DefaultDummySubtitleEndpointPath, this._handleDummySubtitleEndpoint.bind(this));
259
+ this.server.get(DefaultSubtitleSpliceEndpointPath, this._handleSubtitleSliceEndpoint.bind(this));
260
260
  this.server.on('NotFound', function (req, res, err, next) {
261
261
  res.header("X-Instance-Id", _this.instanceId + "<".concat(version, ">"));
262
262
  return next();
@@ -126,14 +126,14 @@ var SharedSessionState = /** @class */ (function () {
126
126
  };
127
127
  SharedSessionState.prototype.setCurrentVod = function (hlsVod, opts) {
128
128
  return __awaiter(this, void 0, void 0, function () {
129
- var isLeader;
129
+ var isLeader, currentVod;
130
130
  return __generator(this, function (_a) {
131
131
  switch (_a.label) {
132
132
  case 0:
133
133
  if (!this.sessionId) {
134
134
  throw new Error("shared session state store has not been initialized");
135
135
  }
136
- if (!this.store.isShared()) return [3 /*break*/, 6];
136
+ if (!this.store.isShared()) return [3 /*break*/, 7];
137
137
  return [4 /*yield*/, this.store.clearLeaderCache()];
138
138
  case 1:
139
139
  _a.sent();
@@ -144,16 +144,21 @@ var SharedSessionState = /** @class */ (function () {
144
144
  return [4 /*yield*/, this.set("currentVod", hlsVod.toJSON())];
145
145
  case 3:
146
146
  _a.sent();
147
- return [3 /*break*/, 5];
147
+ return [3 /*break*/, 6];
148
148
  case 4:
149
- debug("[".concat(this.sessionId, "]: not a leader, will not overwrite currentVod in shared store"));
150
- _a.label = 5;
151
- case 5: return [3 /*break*/, 8];
152
- case 6: return [4 /*yield*/, this.set("currentVod", hlsVod)];
153
- case 7:
154
- _a.sent();
155
- _a.label = 8;
149
+ debug("[".concat(this.sessionId, "]: Not a leader. Will not overwrite. Getting currentVod in shared store"));
150
+ return [4 /*yield*/, this.get("currentVod")];
151
+ case 5:
152
+ currentVod = _a.sent();
153
+ hlsVod = new HLSVod();
154
+ hlsVod.fromJSON(currentVod);
155
+ _a.label = 6;
156
+ case 6: return [3 /*break*/, 9];
157
+ case 7: return [4 /*yield*/, this.set("currentVod", hlsVod)];
156
158
  case 8:
159
+ _a.sent();
160
+ _a.label = 9;
161
+ case 9:
157
162
  if (this.cache.currentVod) {
158
163
  this.cache.currentVod.ts = Date.now();
159
164
  this.cache.currentVod.ttl = CURRENTVOD_CACHE_TTL;
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eyevinn-channel-engine",
3
- "version": "4.2.5",
3
+ "version": "4.2.6",
4
4
  "description": "OTT TV Channel Engine",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
package/engine/server.ts CHANGED
@@ -349,8 +349,8 @@ export class ChannelEngine {
349
349
  this.server.get('/health', this._handleAggregatedSessionHealth.bind(this));
350
350
  this.server.get('/health/:sessionId', this._handleSessionHealth.bind(this));
351
351
  this.server.get('/reset', this._handleSessionReset.bind(this));
352
- this.server.get(this.dummySubtitleEndpoint, this._handleDummySubtitleEndpoint.bind(this));
353
- this.server.get(this.subtitleSliceEndpoint, this._handleSubtitleSliceEndpoint.bind(this));
352
+ this.server.get(DefaultDummySubtitleEndpointPath, this._handleDummySubtitleEndpoint.bind(this));
353
+ this.server.get(DefaultSubtitleSpliceEndpointPath, this._handleSubtitleSliceEndpoint.bind(this));
354
354
 
355
355
  this.server.on('NotFound', (req, res, err, next) => {
356
356
  res.header("X-Instance-Id", this.instanceId + `<${version}>`);
@@ -73,14 +73,16 @@ class SharedSessionState {
73
73
  if (!this.sessionId) {
74
74
  throw new Error("shared session state store has not been initialized");
75
75
  }
76
-
77
76
  if (this.store.isShared()) {
78
77
  await this.store.clearLeaderCache();
79
78
  const isLeader = await this.store.isLeader(this.instanceId);
80
79
  if (isLeader) {
81
80
  await this.set("currentVod", hlsVod.toJSON());
82
81
  } else {
83
- debug(`[${this.sessionId}]: not a leader, will not overwrite currentVod in shared store`);
82
+ debug(`[${this.sessionId}]: Not a leader. Will not overwrite. Getting currentVod in shared store`);
83
+ const currentVod = await this.get("currentVod");
84
+ hlsVod = new HLSVod();
85
+ hlsVod.fromJSON(currentVod);
84
86
  }
85
87
  } else {
86
88
  await this.set("currentVod", hlsVod);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eyevinn-channel-engine",
3
- "version": "4.2.5",
3
+ "version": "4.2.6",
4
4
  "description": "OTT TV Channel Engine",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",