[mirotalksfu] - fix prettier lint
هذا الالتزام موجود في:
@@ -86,7 +86,7 @@ class HtmlInjector {
|
||||
// Replace placeholders with dynamic data (OG, TITLE, etc.)
|
||||
const modifiedHTML = this.cache[filePath].replace(
|
||||
/{{(OG_[A-Z_]+)}}/g,
|
||||
(_, key) => this.injectData[key] || '',
|
||||
(_, key) => this.injectData[key] || ''
|
||||
);
|
||||
|
||||
if (!res.headersSent) {
|
||||
|
||||
@@ -32,7 +32,7 @@ module.exports = class Logger {
|
||||
console.debug(
|
||||
'[' + this.getDateTime() + '] [' + this.appName + '] ' + msg,
|
||||
util.inspect(op, options),
|
||||
this.timeElapsedMs,
|
||||
this.timeElapsedMs
|
||||
);
|
||||
this.timeStart = Date.now();
|
||||
}
|
||||
@@ -45,21 +45,21 @@ module.exports = class Logger {
|
||||
info(msg, op = '') {
|
||||
console.info(
|
||||
'[' + this.getDateTime() + '] [' + this.appName + '] ' + colors.green(msg),
|
||||
util.inspect(op, options),
|
||||
util.inspect(op, options)
|
||||
);
|
||||
}
|
||||
|
||||
warn(msg, op = '') {
|
||||
console.warn(
|
||||
'[' + this.getDateTime() + '] [' + this.appName + '] ' + colors.yellow(msg),
|
||||
util.inspect(op, options),
|
||||
util.inspect(op, options)
|
||||
);
|
||||
}
|
||||
|
||||
error(msg, op = '') {
|
||||
console.error(
|
||||
'[' + this.getDateTime() + '] [' + this.appName + '] ' + colors.red(msg),
|
||||
util.inspect(op, options),
|
||||
util.inspect(op, options)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -225,7 +225,7 @@ module.exports = class Room {
|
||||
room,
|
||||
host = 'localhost',
|
||||
port = 1935,
|
||||
inputVideoURL = 'https://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4',
|
||||
inputVideoURL = 'https://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4'
|
||||
) {
|
||||
if (!this.rtmp || !this.rtmp.enabled) {
|
||||
log.debug('[startRTMPfromURL] Server is not enabled or missing the config');
|
||||
@@ -756,13 +756,13 @@ module.exports = class Room {
|
||||
error: error.message,
|
||||
});
|
||||
throw new Error(
|
||||
`Failed to create producer for peer ${peer.peer_name} with transport ID ${producerTransportId}`,
|
||||
`Failed to create producer for peer ${peer.peer_name} with transport ID ${producerTransportId}`
|
||||
);
|
||||
}
|
||||
|
||||
if (!peerProducer) {
|
||||
throw new Error(
|
||||
`Failed to create producer for peer ${peer_name} with ID ${producerTransportId} for peer ${socket_id}`,
|
||||
`Failed to create producer for peer ${peer_name} with ID ${producerTransportId} for peer ${socket_id}`
|
||||
);
|
||||
}
|
||||
|
||||
@@ -819,7 +819,7 @@ module.exports = class Room {
|
||||
|
||||
if (!this.router.canConsume({ producerId, rtpCapabilities })) {
|
||||
throw new Error(
|
||||
`Cannot consume producer for peer ${peer_name} with ID ${producerId} type ${type}, router validation failed`,
|
||||
`Cannot consume producer for peer ${peer_name} with ID ${producerId} type ${type}, router validation failed`
|
||||
);
|
||||
}
|
||||
|
||||
@@ -834,13 +834,13 @@ module.exports = class Room {
|
||||
error: error.message,
|
||||
});
|
||||
throw new Error(
|
||||
`Failed to create consumer for peer ${peer_name} with transport ID ${consumer_transport_id} and producer ID ${producerId} type ${type} for peer ${socket_id}`,
|
||||
`Failed to create consumer for peer ${peer_name} with transport ID ${consumer_transport_id} and producer ID ${producerId} type ${type} for peer ${socket_id}`
|
||||
);
|
||||
}
|
||||
|
||||
if (!peerConsumer) {
|
||||
throw new Error(
|
||||
`Consumer creation failed for peer ${peer_name} with transport ID ${consumer_transport_id} and producer ID ${producerId}`,
|
||||
`Consumer creation failed for peer ${peer_name} with transport ID ${consumer_transport_id} and producer ID ${producerId}`
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -64,7 +64,7 @@ dev dependencies: {
|
||||
* @license For commercial or closed source, contact us at license.mirotalk@gmail.com or purchase directly via CodeCanyon
|
||||
* @license CodeCanyon: https://codecanyon.net/item/mirotalk-sfu-webrtc-realtime-video-conferences/40769970
|
||||
* @author Miroslav Pejic - miroslav.pejic.85@gmail.com
|
||||
* @version 1.8.54
|
||||
* @version 1.8.55
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -427,7 +427,7 @@ function startServer() {
|
||||
res.setHeader('Content-Type', 'application/javascript');
|
||||
} //...
|
||||
},
|
||||
}),
|
||||
})
|
||||
);
|
||||
app.use(cors(corsOptions));
|
||||
app.use(compression());
|
||||
@@ -752,7 +752,7 @@ function startServer() {
|
||||
// 2. Protect room access with configuration check
|
||||
if (!OIDC.enabled && hostCfg.protected && !hostCfg.users_from_db) {
|
||||
const roomExists = hostCfg.users.some(
|
||||
(user) => user.allowed_rooms && (user.allowed_rooms.includes(roomId) || roomList.has(roomId)),
|
||||
(user) => user.allowed_rooms && (user.allowed_rooms.includes(roomId) || roomList.has(roomId))
|
||||
);
|
||||
log.debug('/join/:roomId exists from config allowed rooms', roomExists);
|
||||
return roomExists ? htmlInjector.injectHtml(views.room, res) : res.redirect('/whoAreYou/' + roomId);
|
||||
@@ -840,7 +840,7 @@ function startServer() {
|
||||
});
|
||||
|
||||
const isPresenter = Boolean(
|
||||
hostCfg?.presenters?.join_first || hostCfg?.presenters?.list?.includes(username),
|
||||
hostCfg?.presenters?.join_first || hostCfg?.presenters?.list?.includes(username)
|
||||
);
|
||||
|
||||
const token = encodeToken({ username: username, password: password, presenter: isPresenter });
|
||||
@@ -1354,7 +1354,7 @@ function startServer() {
|
||||
|
||||
if (restApi.allowed && !restApi.allowed.slack) {
|
||||
return res.end(
|
||||
'`This endpoint has been disabled`. Please contact the administrator for further information.',
|
||||
'`This endpoint has been disabled`. Please contact the administrator for further information.'
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1514,7 +1514,7 @@ function startServer() {
|
||||
╚══════╝╚═╝ ╚═════╝ ╚═╝ ╚═══╝ ╚══════╝╚══════╝╚═╝ ╚═╝ ╚═══╝ ╚══════╝╚═╝ ╚═╝ started...
|
||||
|
||||
`,
|
||||
'font-family:monospace',
|
||||
'font-family:monospace'
|
||||
);
|
||||
|
||||
if (config?.integrations?.ngrok?.enabled && config?.integrations?.ngrok?.authToken !== '') {
|
||||
@@ -1799,7 +1799,7 @@ function startServer() {
|
||||
|
||||
if (room.isLobbyEnabled() && !isPresenter) {
|
||||
log.debug(
|
||||
'The user is currently waiting to join the room because the lobby is enabled, and they are not a presenter',
|
||||
'The user is currently waiting to join the room because the lobby is enabled, and they are not a presenter'
|
||||
);
|
||||
room.broadCast(socket.id, 'roomLobby', {
|
||||
peer_id: peer_id,
|
||||
@@ -1965,7 +1965,7 @@ function startServer() {
|
||||
producerTransportId,
|
||||
rtpParameters,
|
||||
kind,
|
||||
appData.mediaType,
|
||||
appData.mediaType
|
||||
);
|
||||
|
||||
log.debug('Produce', {
|
||||
@@ -2346,7 +2346,7 @@ function startServer() {
|
||||
socket.room_id,
|
||||
socket.id,
|
||||
data.from_peer_name,
|
||||
data.from_peer_uuid,
|
||||
data.from_peer_uuid
|
||||
);
|
||||
if (!isPresenter) return;
|
||||
}
|
||||
@@ -2692,7 +2692,7 @@ function startServer() {
|
||||
Authorization: `Bearer ${config?.integrations?.deepSeek?.apiKey}`,
|
||||
'Content-Type': 'application/json',
|
||||
},
|
||||
},
|
||||
}
|
||||
);
|
||||
|
||||
// Extract the assistant's response
|
||||
@@ -2801,7 +2801,7 @@ function startServer() {
|
||||
'content-type': 'application/json',
|
||||
'x-api-key': config?.integrations?.videoAI?.apiKey,
|
||||
},
|
||||
},
|
||||
}
|
||||
);
|
||||
|
||||
const data = { response: response.data };
|
||||
@@ -2831,7 +2831,7 @@ function startServer() {
|
||||
'Content-Type': 'application/json',
|
||||
'X-Api-Key': config?.integrations?.videoAI?.apiKey,
|
||||
},
|
||||
},
|
||||
}
|
||||
);
|
||||
|
||||
const data = { response: response.data.data };
|
||||
@@ -2861,7 +2861,7 @@ function startServer() {
|
||||
'Content-Type': 'application/json',
|
||||
'X-Api-Key': config?.integrations?.videoAI?.apiKey,
|
||||
},
|
||||
},
|
||||
}
|
||||
);
|
||||
|
||||
const data = { response: response.data };
|
||||
@@ -2894,7 +2894,7 @@ function startServer() {
|
||||
'Content-Type': 'application/json',
|
||||
'X-Api-Key': config?.integrations?.videoAI?.apiKey,
|
||||
},
|
||||
},
|
||||
}
|
||||
);
|
||||
|
||||
const data = { response: response.data };
|
||||
@@ -2926,7 +2926,7 @@ function startServer() {
|
||||
'Content-Type': 'application/json',
|
||||
'X-Api-Key': config?.integrations?.videoAI?.apiKey,
|
||||
},
|
||||
},
|
||||
}
|
||||
);
|
||||
|
||||
const data = { response: response.data };
|
||||
@@ -2986,7 +2986,7 @@ function startServer() {
|
||||
'Content-Type': 'application/json',
|
||||
'X-Api-Key': config?.integrations?.videoAI?.apiKey,
|
||||
},
|
||||
},
|
||||
}
|
||||
);
|
||||
|
||||
const data = { response: response.data };
|
||||
@@ -3538,7 +3538,7 @@ function startServer() {
|
||||
},
|
||||
{
|
||||
timeout: 5000, // Timeout set to 5 seconds (5000 milliseconds)
|
||||
},
|
||||
}
|
||||
);
|
||||
return response.data && response.data.message === true;
|
||||
} catch (error) {
|
||||
@@ -3669,7 +3669,7 @@ function startServer() {
|
||||
},
|
||||
{
|
||||
timeout: 5000, // Timeout set to 5 seconds (5000 milliseconds)
|
||||
},
|
||||
}
|
||||
);
|
||||
log.debug('AXIOS roomExistsForUser', { room: room, exists: true });
|
||||
return response.data && response.data.message === true;
|
||||
@@ -3696,7 +3696,7 @@ function startServer() {
|
||||
},
|
||||
{
|
||||
timeout: 5000, // Timeout set to 5 seconds (5000 milliseconds)
|
||||
},
|
||||
}
|
||||
);
|
||||
const allowedRooms = response.data ? response.data.message : {};
|
||||
log.debug('AXIOS getUserAllowedRooms', allowedRooms);
|
||||
@@ -3749,7 +3749,7 @@ function startServer() {
|
||||
},
|
||||
{
|
||||
timeout: hostCfg.users_api_timeout || 5000,
|
||||
},
|
||||
}
|
||||
);
|
||||
|
||||
if (response.data && (response.data === true || response.data.message === true)) {
|
||||
@@ -3791,7 +3791,7 @@ function startServer() {
|
||||
|
||||
log.debug(
|
||||
isAllowed ? 'isRoomAllowedForUser - Room allowed' : 'isRoomAllowedForUser - Room not allowed',
|
||||
{ room, username },
|
||||
{ room, username }
|
||||
);
|
||||
return isAllowed;
|
||||
}
|
||||
|
||||
@@ -52,7 +52,7 @@ module.exports = class ServerApi {
|
||||
hand: peer_hand,
|
||||
os: os_name ? `${os_name} ${os_version}` : '',
|
||||
browser: browser_name ? `${browser_name} ${browser_version}` : '',
|
||||
}),
|
||||
})
|
||||
);
|
||||
return {
|
||||
roomId: id,
|
||||
|
||||
المرجع في مشكلة جديدة
حظر مستخدم