mirror of
https://github.com/ThaUnknown/miru.git
synced 2026-04-19 06:52:04 +00:00
fix anilist auth, torrent path
This commit is contained in:
parent
d5dafa1878
commit
9aaade57b5
3 changed files with 14 additions and 8 deletions
|
|
@ -1,4 +1,4 @@
|
|||
const { app, BrowserWindow } = require('electron')
|
||||
const { app, BrowserWindow, protocol } = require('electron')
|
||||
const path = require('path')
|
||||
|
||||
// Keep a global reference of the window object, if you don't, the window will
|
||||
|
|
@ -37,6 +37,12 @@ function createWindow () {
|
|||
icon: path.join(__dirname, '/renderer/public/logo.ico'),
|
||||
show: false
|
||||
})
|
||||
|
||||
protocol.registerHttpProtocol('miru', (req, cb) => {
|
||||
const token = req.url.slice(7)
|
||||
mainWindow.loadURL(path.join(__dirname, '/renderer/dist/index.html' + token))
|
||||
})
|
||||
|
||||
// mainWindow.removeMenu()
|
||||
mainWindow.webContents.session.webRequest.onBeforeSendHeaders(
|
||||
(details, callback) => {
|
||||
|
|
|
|||
|
|
@ -53,7 +53,7 @@
|
|||
function handleFolder({ target }) {
|
||||
if (target.files.length) {
|
||||
const filepath = target.files[0].path
|
||||
const path = filepath.slice(0, (filepath.lastIndexOf('\\') || filepath.lastIndexOf('/')) + 1)
|
||||
const path = filepath.slice(0, filepath.lastIndexOf('\\') + 1 || filepath.lastIndexOf('/')) + 1
|
||||
settings.torrentPath = path
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,12 +10,12 @@ async function handleRequest (opts) {
|
|||
const json = await res.json()
|
||||
if (!res.ok) {
|
||||
for (const error of json.errors) {
|
||||
halfmoon.initStickyAlert({
|
||||
content: `Failed making request to anilist!<br>${error.status} - ${error.message}`,
|
||||
title: 'Search Failed',
|
||||
alertType: 'alert-danger',
|
||||
fillType: ''
|
||||
})
|
||||
// halfmoon.initStickyAlert({
|
||||
// content: `Failed making request to anilist!<br>${error.status} - ${error.message}`,
|
||||
// title: 'Search Failed',
|
||||
// alertType: 'alert-danger',
|
||||
// fillType: ''
|
||||
// })
|
||||
console.error(error)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue