FontAwesome is now bundled as part of dizqueTV, so that the web UI can be used offline.
This commit is contained in:
parent
1468d112a9
commit
a66ade1a8d
@ -74,3 +74,4 @@ npm run dev-server
|
||||
|
||||
* Original pseudotv-Plex code was released under [MIT license (c) 2020 Dan Ferguson](https://github.com/DEFENDORe/pseudotv/blob/665e71e24ee5e93d9c9c90545addb53fdc235ff6/LICENSE)
|
||||
* dizqueTV's improvements are released under zlib license (c) 2020 Victor Hugo Soliz Kuncar
|
||||
* FontAwesome: [https://fontawesome.com/license/free](https://archive.fo/PRqis)
|
||||
13
index.js
13
index.js
@ -1,6 +1,7 @@
|
||||
|
||||
const db = require('diskdb')
|
||||
const fs = require('fs')
|
||||
const unzip = require('unzipper')
|
||||
const path = require('path')
|
||||
const express = require('express')
|
||||
const bodyParser = require('body-parser')
|
||||
@ -90,6 +91,8 @@ if(!fs.existsSync(path.join(process.env.DATABASE, 'cache','images'))) {
|
||||
channelDB = new ChannelDB( path.join(process.env.DATABASE, 'channels') );
|
||||
|
||||
db.connect(process.env.DATABASE, ['channels', 'plex-servers', 'ffmpeg-settings', 'plex-settings', 'xmltv-settings', 'hdhr-settings', 'db-version', 'client-id', 'cache-images', 'settings'])
|
||||
|
||||
let fontAwesome = "fontawesome-free-5.15.4-web";
|
||||
initDB(db, channelDB)
|
||||
|
||||
channelService = new ChannelService(channelDB);
|
||||
@ -282,6 +285,7 @@ app.use('/custom.css', express.static(path.join(process.env.DATABASE, 'custom.cs
|
||||
// API Routers
|
||||
app.use(api.router(db, channelService, fillerDB, customShowDB, xmltvInterval, guideService, m3uService, eventService ))
|
||||
app.use('/api/cache/images', cacheImageService.apiRouters())
|
||||
app.use('/' + fontAwesome, express.static(path.join(process.env.DATABASE, fontAwesome)))
|
||||
|
||||
app.use(video.router( channelService, fillerDB, db, programmingService, activeChannelService, programPlayTimeDB ))
|
||||
app.use(hdhr.router)
|
||||
@ -293,6 +297,7 @@ app.listen(process.env.PORT, () => {
|
||||
})
|
||||
|
||||
function initDB(db, channelDB) {
|
||||
//TODO: this is getting so repetitive, do it better
|
||||
if (!fs.existsSync(process.env.DATABASE + '/images/dizquetv.png')) {
|
||||
let data = fs.readFileSync(path.resolve(path.join(__dirname, 'resources/dizquetv.png')))
|
||||
fs.writeFileSync(process.env.DATABASE + '/images/dizquetv.png', data)
|
||||
@ -330,7 +335,15 @@ function initDB(db, channelDB) {
|
||||
let data = fs.readFileSync(path.resolve(path.join(__dirname, 'resources', 'default-custom.css')))
|
||||
fs.writeFileSync( path.join(process.env.DATABASE, 'custom.css'), data)
|
||||
}
|
||||
if (!fs.existsSync( path.join(process.env.DATABASE, fontAwesome) )) {
|
||||
|
||||
let sourceZip = path.resolve(__dirname, 'resources', fontAwesome) + ".zip";
|
||||
let destinationPath = path.resolve(process.env.DATABASE);
|
||||
|
||||
fs.createReadStream(sourceZip)
|
||||
.pipe(unzip.Extract({ path: destinationPath }));
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -38,6 +38,7 @@
|
||||
"random-js": "2.1.0",
|
||||
"request": "^2.88.2",
|
||||
"uuid": "9.0.1",
|
||||
"unzipper": "0.10.14",
|
||||
"xml-writer": "^1.7.0"
|
||||
},
|
||||
"bin": "dist/index.js",
|
||||
|
||||
BIN
resources/fontawesome-free-5.15.4-web.zip
Normal file
BIN
resources/fontawesome-free-5.15.4-web.zip
Normal file
Binary file not shown.
@ -5,7 +5,7 @@
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<link rel="icon" type="image/png" href="/favicon.svg" ></link>
|
||||
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css">
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.14.0/css/all.min.css">
|
||||
<link rel="stylesheet" href="fontawesome-free-5.15.4-web/css/all.css">
|
||||
<link href="style.css" rel="stylesheet">
|
||||
<link href="custom.css" rel="stylesheet">
|
||||
<script src="version.js"></script>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user