eyevinn-channel-engine 4.2.4 → 4.2.5

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.
@@ -126,31 +126,34 @@ 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 newHlsVodJson, isLeader;
129
+ var isLeader;
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*/, 3];
137
- return [4 /*yield*/, this.set("currentVod", hlsVod.toJSON())];
136
+ if (!this.store.isShared()) return [3 /*break*/, 6];
137
+ return [4 /*yield*/, this.store.clearLeaderCache()];
138
138
  case 1:
139
- newHlsVodJson = _a.sent();
139
+ _a.sent();
140
140
  return [4 /*yield*/, this.store.isLeader(this.instanceId)];
141
141
  case 2:
142
142
  isLeader = _a.sent();
143
- if (!isLeader) {
144
- debug("[".concat(this.sessionId, "]: not a leader, will not overwrite currentVod in shared store"));
145
- hlsVod = new HLSVod();
146
- hlsVod.fromJSON(newHlsVodJson);
147
- }
143
+ if (!isLeader) return [3 /*break*/, 4];
144
+ return [4 /*yield*/, this.set("currentVod", hlsVod.toJSON())];
145
+ case 3:
146
+ _a.sent();
148
147
  return [3 /*break*/, 5];
149
- case 3: return [4 /*yield*/, this.set("currentVod", hlsVod)];
150
148
  case 4:
151
- _a.sent();
149
+ debug("[".concat(this.sessionId, "]: not a leader, will not overwrite currentVod in shared store"));
152
150
  _a.label = 5;
153
- case 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;
156
+ case 8:
154
157
  if (this.cache.currentVod) {
155
158
  this.cache.currentVod.ts = Date.now();
156
159
  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.4",
3
+ "version": "4.2.5",
4
4
  "description": "OTT TV Channel Engine",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -30,7 +30,7 @@
30
30
  "dependencies": {
31
31
  "@eyevinn/hls-repeat": "^0.2.0",
32
32
  "@eyevinn/hls-truncate": "^0.2.0",
33
- "@eyevinn/hls-vodtolive": "^3.0.0",
33
+ "@eyevinn/hls-vodtolive": "^3.0.1",
34
34
  "@eyevinn/m3u8": "^0.5.3",
35
35
  "abort-controller": "^3.0.0",
36
36
  "debug": "^3.2.7",
@@ -75,12 +75,12 @@ class SharedSessionState {
75
75
  }
76
76
 
77
77
  if (this.store.isShared()) {
78
- let newHlsVodJson = await this.set("currentVod", hlsVod.toJSON());
78
+ await this.store.clearLeaderCache();
79
79
  const isLeader = await this.store.isLeader(this.instanceId);
80
- if (!isLeader) {
80
+ if (isLeader) {
81
+ await this.set("currentVod", hlsVod.toJSON());
82
+ } else {
81
83
  debug(`[${this.sessionId}]: not a leader, will not overwrite currentVod in shared store`);
82
- hlsVod = new HLSVod();
83
- hlsVod.fromJSON(newHlsVodJson);
84
84
  }
85
85
  } else {
86
86
  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.4",
3
+ "version": "4.2.5",
4
4
  "description": "OTT TV Channel Engine",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -30,7 +30,7 @@
30
30
  "dependencies": {
31
31
  "@eyevinn/hls-repeat": "^0.2.0",
32
32
  "@eyevinn/hls-truncate": "^0.2.0",
33
- "@eyevinn/hls-vodtolive": "^3.0.0",
33
+ "@eyevinn/hls-vodtolive": "^3.0.1",
34
34
  "@eyevinn/m3u8": "^0.5.3",
35
35
  "abort-controller": "^3.0.0",
36
36
  "debug": "^3.2.7",