Merge pull request #238 from vexorian/20210116_dev

Visual Update
This commit is contained in:
vexorian 2021-01-16 15:18:24 -04:00 committed by GitHub
commit 62cf02addf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 67 additions and 19 deletions

View File

@ -187,7 +187,11 @@ app.listen(process.env.PORT, () => {
})
function initDB(db, channelDB) {
dbMigration.initDB(db, channelDB);
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)
}
dbMigration.initDB(db, channelDB, __dirname);
if (!fs.existsSync(process.env.DATABASE + '/font.ttf')) {
let data = fs.readFileSync(path.resolve(path.join(__dirname, 'resources/font.ttf')))
fs.writeFileSync(process.env.DATABASE + '/font.ttf', data)

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 15 KiB

View File

@ -29,7 +29,7 @@
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="3.0547013"
inkscape:cx="173.01248"
inkscape:cx="55.816079"
inkscape:cy="84.726326"
inkscape:document-units="mm"
inkscape:current-layer="layer1"
@ -48,7 +48,7 @@
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
<dc:title />
</cc:Work>
</rdf:RDF>
</metadata>
@ -58,7 +58,7 @@
id="layer1"
transform="translate(0,-244.08278)">
<rect
style="opacity:1;fill:#e6e6e6;fill-opacity:1;stroke:none;stroke-width:1.46508551;stroke-linecap:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
style="opacity:1;fill:#a1a1a1;fill-opacity:0.86666667;stroke:none;stroke-width:1.46508551;stroke-linecap:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
id="rect4712"
width="52.211964"
height="51.512306"
@ -67,7 +67,7 @@
transform="matrix(0.99980416,-0.01978974,0.00448328,0.99998995,0,0)" />
<g
id="g4581"
style="fill:#1f1f1f;fill-opacity:1;stroke-width:0.68901283"
style="fill:#080808;fill-opacity:1;stroke-width:0.68901283"
transform="matrix(1.2119871,0,0,1.7379906,-82.577875,-167.18505)">
<rect
transform="rotate(-0.94645665)"
@ -76,7 +76,7 @@
height="27.75024"
width="41.471352"
id="rect4524"
style="opacity:1;fill:#1f1f1f;fill-opacity:1;stroke:#000000;stroke-width:0;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
style="opacity:1;fill:#080808;fill-opacity:1;stroke:#000000;stroke-width:0;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
</g>
<rect
style="opacity:1;fill:#9cbc28;fill-opacity:1;stroke:#000000;stroke-width:0;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"

Before

Width:  |  Height:  |  Size: 5.1 KiB

After

Width:  |  Height:  |  Size: 5.1 KiB

View File

@ -20,7 +20,7 @@
const path = require('path');
var fs = require('fs');
const TARGET_VERSION = 701;
const TARGET_VERSION = 703;
const STEPS = [
// [v, v2, x] : if the current version is v, call x(db), and version becomes v2
@ -34,6 +34,7 @@ const STEPS = [
[ 600, 601, (db) => addFPS(db) ],
[ 601, 700, (db) => migrateWatermark(db) ],
[ 700, 701, (db) => addScalingAlgorithm(db) ],
[ 701, 703, (db,channels,dir) => reAddIcon(dir) ],
]
const { v4: uuidv4 } = require('uuid');
@ -332,7 +333,7 @@ function commercialsRemover(db) {
}
function initDB(db, channelDB ) {
function initDB(db, channelDB, dir ) {
if (typeof(channelDB) === 'undefined') {
throw Error("???");
}
@ -347,7 +348,7 @@ function initDB(db, channelDB ) {
ran = true;
console.log("Migrating from db version " + dbVersion.version + " to: " + STEPS[i][1] + "...");
try {
STEPS[i][2](db, channelDB);
STEPS[i][2](db, channelDB, dir);
if (typeof(dbVersion._id) === 'undefined') {
db['db-version'].save( {'version': STEPS[i][1] } );
} else {
@ -755,6 +756,40 @@ function addScalingAlgorithm(db) {
fs.writeFileSync( f, JSON.stringify( [ffmpegSettings] ) );
}
function moveBackup(path) {
if (fs.existsSync(`${process.env.DATABASE}${path}`) ) {
let i = 0;
while (fs.existsSync( `${process.env.DATABASE}${path}.bak.${i}`) ) {
i++;
}
fs.renameSync(`${process.env.DATABASE}${path}`, `${process.env.DATABASE}${path}.bak.${i}` );
}
}
function reAddIcon(dir) {
moveBackup('/images/dizquetv.png');
let data = fs.readFileSync(path.resolve(path.join(dir, 'resources/dizquetv.png')));
fs.writeFileSync(process.env.DATABASE + '/images/dizquetv.png', data);
if (fs.existsSync(`${process.env.DATABASE}/images/pseudotv.png`) ) {
moveBackup('/images/pseudotv.png');
let data = fs.readFileSync(path.resolve(path.join(dir, 'resources/dizquetv.png')));
fs.writeFileSync(process.env.DATABASE + '/images/pseudotv.png', data);
}
moveBackup('/images/generic-error-screen.png');
data = fs.readFileSync(path.resolve(path.join(dir, 'resources/generic-error-screen.png')))
fs.writeFileSync(process.env.DATABASE + '/images/generic-error-screen.png', data)
moveBackup('/images/generic-offline-screen.png');
data = fs.readFileSync(path.resolve(path.join(dir, 'resources/generic-offline-screen.png')));
fs.writeFileSync(process.env.DATABASE + '/images/generic-offline-screen.png', data);
moveBackup('/images/loading-screen.png');
data = fs.readFileSync(path.resolve(path.join(dir, 'resources/loading-screen.png')))
fs.writeFileSync(process.env.DATABASE + '/images/loading-screen.png', data)
}
module.exports = {
initDB: initDB,

View File

@ -16,9 +16,9 @@
id="svg8"
inkscape:version="0.92.5 (2060ec1f9f, 2020-04-08)"
sodipodi:docname="dizquetv.svg"
inkscape:export-filename="/home/vx/dev/dizqueanimation/01.png"
inkscape:export-xdpi="245.75999"
inkscape:export-ydpi="245.75999">
inkscape:export-filename="/home/vx/dev/pseudotv/resources/dizquetv.png"
inkscape:export-xdpi="240"
inkscape:export-ydpi="240">
<defs
id="defs2" />
<sodipodi:namedview
@ -29,8 +29,8 @@
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="1"
inkscape:cx="-91.800821"
inkscape:cy="221.87049"
inkscape:cx="74.610162"
inkscape:cy="39.873047"
inkscape:document-units="mm"
inkscape:current-layer="layer1"
showgrid="false"
@ -48,7 +48,7 @@
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
<dc:title />
</cc:Work>
</rdf:RDF>
</metadata>
@ -58,7 +58,7 @@
id="layer1"
transform="translate(0,-244.08278)">
<rect
style="opacity:1;fill:#e6e6e6;fill-opacity:1;stroke:none;stroke-width:1.46501946;stroke-linecap:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
style="opacity:1;fill:#3f3f3f;fill-opacity:0.86666667;stroke:none;stroke-width:1.46501946;stroke-linecap:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
id="rect4712"
width="52.206699"
height="35.866219"
@ -67,7 +67,7 @@
transform="matrix(0.99990505,-0.01378015,0.00643904,0.99997927,0,0)" />
<g
id="g4581"
style="fill:#1f1f1f;fill-opacity:1;stroke-width:0.82573813"
style="fill:#080808;fill-opacity:1;stroke-width:0.82573813"
transform="matrix(1.2119871,0,0,1.2100891,-82.577875,-32.337926)">
<rect
transform="rotate(-0.94645665)"
@ -76,7 +76,7 @@
height="27.75024"
width="41.471352"
id="rect4524"
style="opacity:1;fill:#1f1f1f;fill-opacity:1;stroke:#000000;stroke-width:0;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
style="opacity:1;fill:#080808;fill-opacity:1;stroke:#000000;stroke-width:0;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
</g>
<rect
style="opacity:1;fill:#9cbc28;fill-opacity:1;stroke:#000000;stroke-width:0;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"

Before

Width:  |  Height:  |  Size: 5.1 KiB

After

Width:  |  Height:  |  Size: 5.1 KiB

View File

@ -13,7 +13,9 @@
<body ng-app="myApp" style="min-width: 340px;">
<div class="container">
<h1>dizqueTV
<h1>
<a href="#!/guide"><img id='dizquetv-logo' src="images/dizquetv.png" alt="logo" /></a>
dizqueTV
<small class="pull-right" style="padding: 5px;">
<a href="https://github.com/vexorian/dizquetv" title='Git Repository'>
<span class="fab fa-github text-sm"></span>

View File

@ -356,3 +356,10 @@ div.programming-programs div.list-group-item {
.watermark-preview .alternate-aspect {
background : rgba(255,255,255, 0.1);
}
#dizquetv-logo {
width: 1em;
height: 1em;
margin-bottom: 0.25em;
}