diff --git a/assets/api/local.js b/assets/api/local.js index bb2ac00..233ee1b 100644 --- a/assets/api/local.js +++ b/assets/api/local.js @@ -16,7 +16,11 @@ const removeUnwanted = (rawName) => { } const getName = (rawName) => { - return removeUnwanted(rawName).split(' ').slice(1, -3).join(' ') + try { + return removeUnwanted(rawName).split(' ').slice(1, -3).join(' ') + } catch (e) { + return null + } } const getEp = (rawName) => { @@ -31,9 +35,9 @@ const getUniques = (files) => { const result = [] files.forEach((file) => { - const toAdd = getName(file) + const toAdd = getName(file) || null - if (!result.includes(toAdd)) { + if (toAdd && !result.includes(toAdd)) { result.push(toAdd) } }) @@ -47,10 +51,13 @@ const sendFiles = (json, files, res) => { console.log('[Local]: Sending files.') files.forEach((file) => { - const tmp = JSON.parse(JSON.stringify(json[minifyName(getName(file))])) - tmp.ep = getEp(file) - tmp.path = file - result.push(tmp) + const name = getName(file) + if (name) { + const tmp = JSON.parse(JSON.stringify(json[minifyName(name)])) + tmp.ep = getEp(file) + tmp.path = file + result.push(tmp) + } }) res.writeHead(200, {'Content-Type': 'application/json'}) diff --git a/assets/api/main.js b/assets/api/main.js index a732c35..1ac2251 100644 --- a/assets/api/main.js +++ b/assets/api/main.js @@ -7,6 +7,7 @@ const fs = require('fs') const {join} = require('path') const URL = require('url-parse') +const qs = require('querystring') const {userInfo} = require('os') const BASE_PATH = userInfo().homedir @@ -194,6 +195,19 @@ const route = (nuxt) => { openInBrowser(process.nuxtURL, res) break + /* istanbul ignore next */ + case '/_win': + const query = qs.parse(url.query.replace('?', '')) + const action = query.action + const actions = { + minimize: process.win.minimize, + maximize: process.win.maximize, + close: process.win.close + } + + actions[action]() + break + default: nuxt.render(req, res) break diff --git a/components/settings.vue b/components/settings.vue index 282d5d2..4e28ae6 100644 --- a/components/settings.vue +++ b/components/settings.vue @@ -113,7 +113,9 @@ News - + + diff --git a/layouts/default.vue b/layouts/default.vue index 66b363e..65e3c94 100644 --- a/layouts/default.vue +++ b/layouts/default.vue @@ -57,9 +57,9 @@ v-if="!browser">
- remove - check_box_outline_blank - close + remove + check_box_outline_blank + close
@@ -103,6 +103,7 @@ @@ -280,6 +310,8 @@ .page-container { min-height: 92vh !important; + padding-left: 0; + padding-right: 0; } /* ------------- MENUBAR ------------- */ @@ -377,12 +409,6 @@ margin: 0; } - .delete-button - { - display: inline; - margin: 0; - } - .genres { padding-left: 15px; diff --git a/test/nightwatch/main.test.js b/test/nightwatch/main.test.js index 9b101ce..24633cf 100644 --- a/test/nightwatch/main.test.js +++ b/test/nightwatch/main.test.js @@ -51,7 +51,7 @@ module.exports = { // adapted from: https://git.io/vodU0 client .url(`${uri}/downloader`) .waitForElementVisible('body') - .assert.title('KawAnime') + .assert.title('Downloader - KawAnime') .assert.visible('div.config-modal') .assert.visible('div.form-container') .assert.visible('div.choose-magnets .input-group__input') @@ -74,7 +74,7 @@ module.exports = { // adapted from: https://git.io/vodU0 client .url(`${uri}/seasons`) .waitForElementVisible('body') - .assert.title('KawAnime') + .assert.title('Seasons - KawAnime') .end() }, after: function () {