@bililive-tools/manager 1.2.0 → 1.2.1

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/lib/manager.js CHANGED
@@ -54,6 +54,8 @@ export function createRecorderManager(opts) {
54
54
  }
55
55
  catch (err) {
56
56
  manager.emit("error", { source: "getBiliStatusInfoByRoomIds", err });
57
+ // 如果批量查询失败,则使用单个查询
58
+ needCheckRecorders = needCheckRecorders.concat(biliNeedCheckRecorders);
57
59
  }
58
60
  }
59
61
  const checkOnce = async () => {
@@ -23,6 +23,7 @@ export declare class StreamManager extends EventEmitter {
23
23
  private extraDataController;
24
24
  recordSavePath: string;
25
25
  recordStartTime?: number;
26
+ hasSegment: boolean;
26
27
  private videoFormat?;
27
28
  constructor(getSavePath: GetSavePath, hasSegment: boolean, disableDanma: boolean, videoFormat?: "auto" | "ts" | "mkv");
28
29
  handleVideoStarted(stderrLine: string): Promise<void>;
@@ -73,12 +73,14 @@ export class StreamManager extends EventEmitter {
73
73
  extraDataController = null;
74
74
  recordSavePath;
75
75
  recordStartTime;
76
+ hasSegment;
76
77
  videoFormat;
77
78
  constructor(getSavePath, hasSegment, disableDanma, videoFormat) {
78
79
  super();
79
80
  const recordSavePath = getSavePath({ startTime: Date.now() });
80
81
  this.recordSavePath = recordSavePath;
81
82
  this.videoFormat = videoFormat;
83
+ this.hasSegment = hasSegment;
82
84
  if (hasSegment) {
83
85
  this.segment = new Segment(getSavePath, disableDanma, this.videoExt);
84
86
  this.segment.on("DebugLog", (data) => {
@@ -133,7 +135,7 @@ export class StreamManager extends EventEmitter {
133
135
  return "mkv";
134
136
  }
135
137
  else if (this.videoFormat === "auto") {
136
- if (!this.segment) {
138
+ if (!this.hasSegment) {
137
139
  return "mp4";
138
140
  }
139
141
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bililive-tools/manager",
3
- "version": "1.2.0",
3
+ "version": "1.2.1",
4
4
  "description": "Batch scheduling recorders",
5
5
  "main": "./lib/index.js",
6
6
  "type": "module",