Skip to content

Commit 0131eb4

Browse files
Added more interstitials
1 parent 69f91f7 commit 0131eb4

File tree

4 files changed

+29
-15
lines changed

4 files changed

+29
-15
lines changed

src/main/main.ts

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,6 @@ const SUBTITLE_SUB_DIRECTORY = `_Subtitles`;
6262
const THUMBNAIL_SUB_DIRECTORY = `_ThumbNails`;
6363
const PREVIEW_IMAGE_SUB_DIRECTORY = `_PreviewImages`;
6464

65-
const VIDEO_INSTALL_SUB_DIRECTORY = '/StreamingAssets/VideoClips';
66-
const SUBTITLE_INSTALL_SUB_DIRECTORY = '/StreamingAssets/Subtitles';
67-
const THUMBNAIL_INSTALL_SUB_DIRECTORY = '/StreamingAssets/ThumbNails';
68-
6965
export default class AppUpdater {
7066
constructor() {
7167
log.transports.file.level = 'info';
@@ -282,23 +278,19 @@ const exportToZip = async (
282278
const deleteClip = (id: string, game: string) => {
283279
console.log('DELETING ' + id + ' FOR GAME ' + game);
284280

285-
const {clip: clipsDirectory, subtitle: subsDirectory} = getClipPaths(id, game);
281+
const {clip: videoFilePath, subtitle: subFilePath} = getClipPaths(id, game);
286282

287-
let videoFilePath = `${clipsDirectory}/${id}.mp4`;
288-
let subFilePath = `${subsDirectory}/${id}.srt`;
283+
console.log('DELETING ' + videoFilePath);
284+
console.log('DELETING ' + subFilePath);
289285

290286
// Delete video files
291287
if (fs.existsSync(videoFilePath)) {
292288
fs.unlinkSync(videoFilePath);
293-
} else if (fs.existsSync(videoFilePath + '.disabled')) {
294-
fs.unlinkSync(videoFilePath + '.disabled');
295289
}
296290

297291
// Delete subtitle files
298292
if (fs.existsSync(subFilePath)) {
299293
fs.unlinkSync(subFilePath);
300-
} else if (fs.existsSync(subFilePath + '.disabled')) {
301-
fs.unlinkSync(subFilePath + '.disabled');
302294
}
303295

304296
// Remove references to video in collections
@@ -401,6 +393,11 @@ const createWindow = async () => {
401393
},
402394
});
403395

396+
mainWindow.webContents.setWindowOpenHandler(({ url }) => {
397+
shell.openExternal(url);
398+
return { action: 'deny' };
399+
});
400+
404401
mainWindow.loadURL(resolveHtmlPath('index.html'));
405402

406403
mainWindow.on('ready-to-show', () => {

src/renderer/App.jsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,12 @@ let App = (props) => {
9999
>
100100
About
101101
</Link>
102+
<a
103+
href="https://ko-fi.com/michaelcmain52278"
104+
target="_blank"
105+
>
106+
Donate
107+
</a>
102108
</div>
103109
) : null}
104110
<div style={{ minHeight: '50vh' }}>

src/renderer/routes/About.jsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ const About = (props) => {
88
Dub Editor is a free and open source piece of software created
99
by thetruekingofspace provided under the MIT License. The source
1010
code can be found at{' '}
11-
<a href="https://github.com/deusprogrammer/wtd-tool-electron">
12-
https://github.com/deusprogrammer/wtd-tool-electron
11+
<a href="https://github.com/deusprogrammer/dub-editor-electron">
12+
https://github.com/deusprogrammer/dub-editor-electron
1313
</a>
1414
. If you paid for this program, you were scammed. If you have
1515
any ideas, comments, questions, or bugs...please contact
@@ -33,7 +33,9 @@ const About = (props) => {
3333
3434
</div>
3535
<h4>Testers</h4>
36-
<div>TBA</div>
36+
<div>
37+
<strong>Tester</strong>: Typically Thomas
38+
</div>
3739
</div>
3840
);
3941
};

src/renderer/routes/VideoList.jsx

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,19 @@
1+
import { useAtom } from 'jotai';
12
import React, { useState, useEffect } from 'react';
23
import { Link, useParams } from 'react-router-dom';
34
import { toast } from 'react-toastify';
45
import BatchAPI from 'renderer/api/BatchAPI';
56
import ConfigAPI from 'renderer/api/ConfigAPI';
7+
import { interstitialAtom } from 'renderer/atoms/interstitial.atom';
8+
import { handleInterstitial } from 'renderer/components/interstitial/Interstitial';
69

710
let VideoList = () => {
811
const { game } = useParams();
912
const [videos, setVideos] = useState([]);
1013
const [batchCount, setBatchCount] = useState(0);
1114
const [collections, setCollections] = useState({ _originals: [] });
1215
const [config, setConfig] = useState({});
16+
const [, setInterstitialState] = useAtom(interstitialAtom);
1317

1418
useEffect(() => {
1519
loadVideos();
@@ -27,7 +31,12 @@ let VideoList = () => {
2731
};
2832

2933
const deleteFile = async (id, game, isActive) => {
30-
await window.api.send('deleteVideo', { id, game, isActive });
34+
await handleInterstitial(
35+
window.api.send('deleteVideo', { id, game, isActive }),
36+
(open) => {
37+
setInterstitialState(open);
38+
}
39+
);
3140
toast('Deleted video', { type: 'info' });
3241
loadVideos();
3342
};

0 commit comments

Comments
 (0)