fix(hdhr): assign new var to tuner instance

This commit is contained in:
2025-09-30 23:52:15 -07:00
parent 47ec5267ec
commit 69805151c8

View File

@@ -2348,14 +2348,14 @@ const server = http.createServer( ( req, resp ) =>
Log.notice( `http`, chalk.yellowBright( `[notice]` ), chalk.white( `📌` ), Log.notice( `http`, chalk.yellowBright( `[notice]` ), chalk.white( `📌` ),
chalk.yellowBright( `<msg>` ), chalk.gray( `If you are attempting to load TVApp2 using an HDHomeRun tuner, please switch to the` ), chalk.yellowBright( `M3U Tuner` ) ); chalk.yellowBright( `<msg>` ), chalk.gray( `If you are attempting to load TVApp2 using an HDHomeRun tuner, please switch to the` ), chalk.yellowBright( `M3U Tuner` ) );
const Tuner = new Tuner(); const tunerInstance = new Tuner(); // <-- use a different name
const hdHomeRun = const hdHomeRun =
{ {
FriendlyName: Tuner.FriendlyName, FriendlyName: tunerInstance.FriendlyName,
ModelNumber: Tuner.ModelNumber, ModelNumber: tunerInstance.ModelNumber,
FirmwareName: Tuner.FirmwareName, FirmwareName: tunerInstance.FirmwareName,
FirmwareVersion: Tuner.FirmwareVersion, FirmwareVersion: tunerInstance.FirmwareVersion,
DeviceID: Tuner.GetDeviceId(), DeviceID: tunerInstance.GetDeviceId(),
TunerCount: `10`, TunerCount: `10`,
BaseURL: `${ envIpContainer }:${ envHdhrPort }`, BaseURL: `${ envIpContainer }:${ envHdhrPort }`,
LineupURL: `${ envIpContainer }:${ envHdhrPort }/lineup.json`, LineupURL: `${ envIpContainer }:${ envHdhrPort }/lineup.json`,
@@ -2372,6 +2372,10 @@ const server = http.createServer( ( req, resp ) =>
resp.writeHead( hdHomeRun.code, { resp.writeHead( hdHomeRun.code, {
'Content-Type': 'application/json' 'Content-Type': 'application/json'
}); });
resp.end( JSON.stringify( hdHomeRun ) );
return; // <- Prevent further code from executing
} }
const statusCheck = const statusCheck =
@@ -2477,14 +2481,14 @@ const serverHdHomeRun = http.createServer( ( req, resp ) =>
read the loaded asset file read the loaded asset file
*/ */
const Tuner = new Tuner(); const tunerInstance = new Tuner();
ejs.renderFile( `./${ envWebFolder }/${ loadFile }`, ejs.renderFile( `./${ envWebFolder }/${ loadFile }`,
{ {
friendlyName: Tuner.FriendlyName, friendlyName: tunerInstance.FriendlyName,
modelNumber: Tuner.ModelNumber, modelNumber: tunerInstance.ModelNumber,
firmwareName: Tuner.FirmwareName, firmwareName: tunerInstance.FirmwareName,
firmwareVersion: Tuner.FirmwareVersion, firmwareVersion: tunerInstance.FirmwareVersion,
deviceId: Tuner.GetDeviceId( ), deviceId: tunerInstance.GetDeviceId( ),
healthTimer: envHealthTimer, healthTimer: envHealthTimer,
appRelease: envAppRelease, appRelease: envAppRelease,
@@ -2494,7 +2498,11 @@ const serverHdHomeRun = http.createServer( ( req, resp ) =>
appUrlDiscord: discord.url, appUrlDiscord: discord.url,
appUrlDocs: docs.url, appUrlDocs: docs.url,
appGitHashShort: envGitSHA1.substring( 0, 9 ), appGitHashShort: envGitSHA1.substring( 0, 9 ),
appGitHashLong: envGitSHA1 appGitHashLong: envGitSHA1,
appUptimeShort: timeAgo.format( Date.now() - Math.round( process.uptime() ) * 1000, 'twitter' ),
appUptimeLong: timeAgo.format( Date.now() - process.uptime() * 1000, 'twitter' ),
appStartup: Math.round( serverStartup ) / 1000,
serverOs: serverOs
}, ( err, data ) => }, ( err, data ) =>
{ {
if ( !err ) if ( !err )
@@ -2579,14 +2587,14 @@ const serverHdHomeRun = http.createServer( ( req, resp ) =>
Log.notice( `http`, chalk.yellowBright( `[notice]` ), chalk.white( `📌` ), Log.notice( `http`, chalk.yellowBright( `[notice]` ), chalk.white( `📌` ),
chalk.yellowBright( `<msg>` ), chalk.gray( `If you are attempting to load TVApp2 using an HDHomeRun tuner, please switch to the` ), chalk.yellowBright( `M3U Tuner` ) ); chalk.yellowBright( `<msg>` ), chalk.gray( `If you are attempting to load TVApp2 using an HDHomeRun tuner, please switch to the` ), chalk.yellowBright( `M3U Tuner` ) );
const Tuner = new Tuner(); const tunerInstance = new Tuner();
const hdHomeRun = const hdHomeRun =
{ {
FriendlyName: Tuner.FriendlyName, FriendlyName: tunerInstance.FriendlyName,
ModelNumber: Tuner.ModelNumber, ModelNumber: tunerInstance.ModelNumber,
FirmwareName: Tuner.FirmwareName, FirmwareName: tunerInstance.FirmwareName,
FirmwareVersion: Tuner.FirmwareVersion, FirmwareVersion: tunerInstance.FirmwareVersion,
DeviceID: Tuner.GetDeviceId(), DeviceID: tunerInstance.GetDeviceId(),
TunerCount: `10`, TunerCount: `10`,
BaseURL: `${ envIpContainer }:${ envHdhrPort }`, BaseURL: `${ envIpContainer }:${ envHdhrPort }`,
LineupURL: `${ envIpContainer }:${ envHdhrPort }/lineup.json`, LineupURL: `${ envIpContainer }:${ envHdhrPort }/lineup.json`,