Skip to content

Commit

Permalink
added a fix for the new itch.io cdn for installing files
Browse files Browse the repository at this point in the history
  • Loading branch information
Shane Harris committed Dec 4, 2023
1 parent e1b702f commit 7f07a3d
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion electron/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -434,6 +434,7 @@ function addWindowDownloadHandler(window) {
let name = item.getFilename();
let etx = path.extname(url.split('?')[0]).toLowerCase();
let etx2 = urls.length ? path.extname(urls[0].split('?')[0]).toLowerCase() : etx;
console.log(url);
if (~url.indexOf('https://beatsaver.com/cdn')) {
// beat saber mods /songs
mainWindow.webContents.send('open-url', 'sidequest://bsaber/#' + url);
Expand All @@ -452,7 +453,11 @@ function addWindowDownloadHandler(window) {
BrowserWindow.getAllWindows()
.filter(b => b !== mainWindow)
.forEach(b => b.close());
} else if (~url.indexOf('ssl.hwcdn.net/') || ~url.indexOf('patreonusercontent.com/')) {
} else if (
~url.indexOf('ssl.hwcdn.net/') ||
~url.indexOf('patreonusercontent.com/') ||
(~url.indexOf('https://itchio-mirror.') && ~url.indexOf('cloudflarestorage.com'))
) {
//itch.io & patreon
mainWindow.webContents.send('pre-open-url', { url, name });
BrowserWindow.getAllWindows()
Expand Down

0 comments on commit 7f07a3d

Please sign in to comment.