diff --git a/tvapp2/index.js b/tvapp2/index.js index b8326a17..0b9c74ce 100755 --- a/tvapp2/index.js +++ b/tvapp2/index.js @@ -57,8 +57,8 @@ let EPG_FILE; const envUrlRepo = process.env.URL_REPO || `https://git.binaryninja.net/binaryninja`; const envStreamQuality = process.env.STREAM_QUALITY || `hd`; -const envFilePlaylist = process.env.FILE_PLAYLIST || `playlist.m3u8`; -const envFileEPG = process.env.FILE_EPG || `xmltv.xml`; +const envFileM3U = process.env.FILE_PLAYLIST || `playlist.m3u8`; +const envFileXML = process.env.FILE_EPG || `xmltv.xml`; const LOG_LEVEL = process.env.LOG_LEVEL || 10; /* @@ -169,7 +169,7 @@ if ( process.pkg ) const basePath = path.dirname( process.execPath ); URLS_FILE = path.join( basePath, 'urls.txt' ); FORMATTED_FILE = path.join( basePath, 'formatted.dat' ); - EPG_FILE = path.join( basePath, 'xmltv.1.xml' ); + EPG_FILE = path.join( basePath, `${ envFileXML }` ); EPG_FILE.length; } else @@ -177,7 +177,7 @@ else Log.info( `Processing Locals` ); URLS_FILE = path.resolve( __dirname, 'urls.txt' ); FORMATTED_FILE = path.resolve( __dirname, 'formatted.dat' ); - EPG_FILE = path.resolve( __dirname, 'xmltv.1.xml' ); + EPG_FILE = path.resolve( __dirname, `${ envFileXML }` ); } /* @@ -554,7 +554,7 @@ async function serveChannelPlaylist( req, res ) res.writeHead( 200, { 'Content-Type': 'application/vnd.apple.mpegurl', - 'Content-Disposition': 'inline; filename="' + envFilePlaylist + 'Content-Disposition': 'inline; filename="' + envFileM3U }); res.end( rewrittenPlaylist ); @@ -581,7 +581,7 @@ async function serveChannelPlaylist( req, res ) const rewrittenPlaylist = await rewritePlaylist( hdUrl, req ); res.writeHead( 200, { 'Content-Type': 'application/vnd.apple.mpegurl', - 'Content-Disposition': 'inline; filename="' + envFilePlaylist + 'Content-Disposition': 'inline; filename="' + envFileM3U }); res.end( rewrittenPlaylist ); @@ -659,7 +659,7 @@ async function servePlaylist( response, req ) response.writeHead( 200, { 'Content-Type': 'application/x-mpegURL', - 'Content-Disposition': 'inline; filename="' + envFilePlaylist + 'Content-Disposition': 'inline; filename="' + envFileM3U }); response.end( updatedContent ); @@ -691,7 +691,7 @@ async function serveXmltv( response, req ) response.writeHead( 200, { 'Content-Type': 'application/xml', - 'Content-Disposition': 'inline; filename="xmltv.1.xml"' + 'Content-Disposition': 'inline; filename="' + envFileXML }); response.end( formattedContent ); @@ -838,7 +838,7 @@ const server = http.createServer( ( request, response ) => read the loaded asset file */ - ejs.renderFile( './www/' + loadAsset, { fileEPG: envFilePlaylist, fileM3U: envFileEPG, appName: name, appVersion: version }, ( err, data ) => + ejs.renderFile( './www/' + loadAsset, { fileXML: envFileXML, fileM3U: envFileM3U, appName: name, appVersion: version }, ( err, data ) => { if ( !err ) { diff --git a/tvapp2/www/index.html b/tvapp2/www/index.html index 6805530b..4034b336 100644 --- a/tvapp2/www/index.html +++ b/tvapp2/www/index.html @@ -100,7 +100,7 @@ document.getElementById("playlist-link").textContent = playlistURL; document.getElementById("playlist-link").href = playlistURL; - document.getElementById("epg-url").textContent = "<%= fileEPG %>"; + document.getElementById("epg-url").textContent = "<%= fileXML %>"; document.getElementById("epg-url").href = epgURL; document.getElementById("epg-link").textContent = epgURL; document.getElementById("epg-link").href = epgURL;