Skip to content

Commit c6dbd81

Browse files
Cleaning up logs
1 parent c6edfa9 commit c6dbd81

File tree

7 files changed

+30
-30
lines changed

7 files changed

+30
-30
lines changed

src/main/main.ts

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -169,9 +169,6 @@ const importZip = async (filePath: string, game: string) => {
169169
'/'
170170
)}${subtitleDirectoryStack.join('/')}`;
171171

172-
console.log(`${sourceVideoDirectory} => ${targetVideoDirectory}`);
173-
console.log(`${sourceSubtitlesDirectory} => ${targetSubtitlesDirectory}`);
174-
175172
Object.values(entries).forEach((entry: any) => console.log(entry.name));
176173

177174
// Try with standard directory names
@@ -503,7 +500,7 @@ const installExtensions = async () => {
503500
extensions.map((name) => installer[name]),
504501
forceDownload
505502
)
506-
.catch(console.log);
503+
.catch(console.error);
507504
};
508505

509506
const createWindow = async () => {
@@ -585,13 +582,12 @@ app.whenReady()
585582
if (mainWindow === null) createWindow();
586583
});
587584
})
588-
.catch(console.log);
585+
.catch(console.error);
589586

590587
// Bridged functionality
591588

592589
ipcMain.handle('fileExists', (event, filePath) => {
593590
const exists = fs.existsSync(filePath);
594-
console.log(`${filePath} exists? ${exists}`);
595591
return exists;
596592
});
597593

@@ -615,8 +611,6 @@ ipcMain.handle('clipExists', (event, { title, clipNumber, game }) => {
615611
fs.existsSync(videoFilePath) ||
616612
fs.existsSync(videoFilePath + '.disabled');
617613

618-
console.log(`${videoFilePath} exists? ${exists}`);
619-
620614
return exists;
621615
});
622616

@@ -764,7 +758,7 @@ ipcMain.handle('getVideos', (event, game) => {
764758
});
765759

766760
ipcMain.handle('getVideo', (event, { id, game }) => {
767-
console.log('Opening: ' + id + ' from game ' + game);
761+
console.log('OPENING: ' + id + ' from game ' + game);
768762

769763
let directory = null;
770764
if (game === 'rifftrax') {

src/renderer/api/ConfigAPI.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
const getConfig = async () => {
2+
return await window.api.send('getConfig');
3+
};
4+
5+
const storeConfig = async (config) => {
6+
return await window.api.send('updateConfig', config);
7+
};
8+
9+
export default {
10+
getConfig,
11+
storeConfig,
12+
};

src/renderer/components/SubtitleList.jsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,6 @@ export default ({
4242
setCollections(collections);
4343
};
4444

45-
console.log('CURRENT SUB: ' + currentSub);
46-
4745
let currentSubObject = subs[currentSub];
4846
return (
4947
<div className="subtitle-window">

src/renderer/components/TimeLine.jsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,6 @@ export default ({
137137
step={1}
138138
max={videoLengthMs}
139139
onChange={(e) => {
140-
console.log('OFFSET: ' + offset);
141140
onSliderPositionChange(parseFloat(e.target.value) + offset);
142141
}}
143142
/>

src/renderer/components/WhatTheDubPlayer.jsx

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,17 +25,14 @@ export default (props) => {
2525
});
2626

2727
useEffect(() => {
28-
console.log('Video position changed');
2928
videoElement.current.currentTime = props.videoPosition;
3029
isTalking = false;
3130
}, [props.videoPosition]);
3231

3332
useEffect(() => {
3433
if (props.isPlaying) {
35-
console.log('Play');
3634
videoElement.current.play();
3735
} else {
38-
console.log('Pause');
3936
videoElement.current.pause();
4037
}
4138
}, [props.isPlaying]);
@@ -88,7 +85,6 @@ export default (props) => {
8885
});
8986

9087
if (index !== currentIndex) {
91-
console.log('INDEX CHANGED: ' + index);
9288
if (isTalking) {
9389
video.pause();
9490
return;

src/renderer/routes/VideoList.jsx

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,13 @@ import React, { useState, useEffect } from 'react';
22
import { Link, useParams } from 'react-router-dom';
33
import { toast } from 'react-toastify';
44
import BatchAPI from 'renderer/api/BatchAPI';
5+
import ConfigAPI from 'renderer/api/ConfigAPI';
56

67
let VideoList = () => {
78
const { game } = useParams();
89
const [videos, setVideos] = useState([]);
910
const [batchCount, setBatchCount] = useState(0);
11+
const [config, setConfig] = useState({});
1012

1113
useEffect(() => {
1214
loadVideos();
@@ -15,8 +17,10 @@ let VideoList = () => {
1517
const loadVideos = async () => {
1618
const videos = await window.api.send('getVideos', game);
1719
const hasBatch = await BatchAPI.hasBatch();
20+
const config = await ConfigAPI.getConfig();
1821
setVideos(videos);
1922
setBatchCount(hasBatch);
23+
setConfig(config);
2024
};
2125

2226
const deleteFile = async (id, game, isActive) => {
@@ -32,13 +36,17 @@ let VideoList = () => {
3236
<Link to={`/create/${game}`}>
3337
<button>New Clip</button>
3438
</Link>
35-
<Link to={`/batch/${game}`}>
36-
<button>New Batch</button>
37-
</Link>
38-
{batchCount > 0 ? (
39-
<Link to={`/create/${game}?batch=true`}>
40-
<button>Continue Batch ({batchCount})</button>
41-
</Link>
39+
{config.editor === 'advanced' ? (
40+
<>
41+
<Link to={`/batch/${game}`}>
42+
<button>New Batch</button>
43+
</Link>
44+
{batchCount > 0 ? (
45+
<Link to={`/create/${game}?batch=true`}>
46+
<button>Continue Batch ({batchCount})</button>
47+
</Link>
48+
) : null}
49+
</>
4250
) : null}
4351
<h3>Clips</h3>
4452
{videos.filter((video) => video._id.startsWith('_')).length > 0 ? (

src/renderer/util/VideoTools.js

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@ export let convertTimestampToSeconds = (timestamp) => {
1313
let regex = /(\d\d):(\d\d):(\d\d),(\d\d\d)/;
1414
let match = regex.exec(timestamp);
1515

16-
console.log('TIMESTAMP: ' + timestamp);
17-
1816
let h = parseInt(match[1]);
1917
let m = parseInt(match[2]);
2018
let s = parseInt(match[3]);
@@ -73,7 +71,6 @@ export let convertSrtToSubtitles = (srtBase64) => {
7371
let srt = atob(srtBase64);
7472
let n = 0;
7573
srt.split('\n').forEach((line) => {
76-
console.log('LINE: ' + line);
7774
switch (n++) {
7875
case 0:
7976
break;
@@ -85,7 +82,6 @@ export let convertSrtToSubtitles = (srtBase64) => {
8582

8683
let startTime = match[1];
8784
let endTime = match[2];
88-
console.log(startTime + ' => ' + endTime);
8985
subtitle.startTime =
9086
convertTimestampToSeconds(startTime) * 1000;
9187
subtitle.endTime = convertTimestampToSeconds(endTime) * 1000;
@@ -132,8 +128,6 @@ export let convertSubtitlesToWebVtt = (subtitles, substitution, offset = 0) => {
132128
})
133129
.join('\n\n');
134130

135-
console.log(webvtt);
136-
137131
return webvtt;
138132
};
139133

@@ -152,7 +146,6 @@ export let addVideo = async (
152146
type,
153147
isBatch
154148
) => {
155-
console.log('SUBS: ' + convertSubtitlesToSrt(subtitles, type));
156149
if (isBatch) {
157150
return await window.api.send('processBatchClip', {
158151
subtitles: convertSubtitlesToSrt(subtitles, type),

0 commit comments

Comments
 (0)