mirror of https://github.com/Kylart/KawAnime.git
Added menu on elem in localPage. Now ca add to WL in local Page
No more errors on malformed files Waiting for vuetify to catch clicks on system bar ? Fixed test nightwatch..
This commit is contained in:
parent
7fc3c68356
commit
83fc138d37
|
@ -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'})
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -113,7 +113,9 @@
|
|||
</v-flex>
|
||||
<v-flex xs3 class="section-title">News</v-flex>
|
||||
<v-flex xs9>
|
||||
<v-switch :label="config.inside ? 'Inside' : 'Outside'" v-model="config.inside" dark></v-switch>
|
||||
<v-switch :label="config.inside ? 'Inside' : 'Outside'"
|
||||
v-model="config.inside" dark>
|
||||
</v-switch>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-card>
|
||||
|
|
|
@ -57,9 +57,9 @@
|
|||
v-if="!browser">
|
||||
<v-spacer></v-spacer>
|
||||
<div v-if="$store.state.platform !== 'darwin'">
|
||||
<v-icon class="window-icon">remove</v-icon>
|
||||
<v-icon class="window-icon">check_box_outline_blank</v-icon>
|
||||
<v-icon class="window-icon">close</v-icon>
|
||||
<v-icon class="window-icon" ripple @click.native="actOnWindow('minimize')">remove</v-icon>
|
||||
<v-icon class="window-icon" @click.native="actOnWindow('maximize')">check_box_outline_blank</v-icon>
|
||||
<v-icon class="window-icon" @click.native="actOnWindow('close')">close</v-icon>
|
||||
</div>
|
||||
|
||||
</v-system-bar>
|
||||
|
@ -103,6 +103,7 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import axios from 'axios'
|
||||
import Settings from '~components/settings.vue'
|
||||
import infoModal from '~components/infoModal.vue'
|
||||
|
||||
|
@ -194,6 +195,13 @@
|
|||
methods: {
|
||||
toggleDrawer () {
|
||||
this.$store.commit('toggleDrawer')
|
||||
},
|
||||
actOnWindow (action) {
|
||||
axios.get('/_win', {
|
||||
params: {
|
||||
action
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -217,6 +225,7 @@
|
|||
{
|
||||
margin-top: 24px;
|
||||
max-height: 48px;
|
||||
padding-left: 2%;
|
||||
}
|
||||
|
||||
.navigation-drawer
|
||||
|
|
|
@ -34,11 +34,10 @@
|
|||
"mal-scraper": "^1.4.1",
|
||||
"mdi": "^1.9.33",
|
||||
"moment": "^2.18.1",
|
||||
"nuxt": "^0.10.5",
|
||||
"nuxt": "^0.10.7",
|
||||
"nyaapi": "^1.2.2",
|
||||
"play-sound": "^1.1.1",
|
||||
"url-parse": "^1.1.8",
|
||||
"vuetify": "^0.13.1"
|
||||
"vuetify": "^0.14.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"ava": "^0.19.1",
|
||||
|
|
|
@ -39,18 +39,18 @@
|
|||
<transition-group name="list">
|
||||
<template v-for="item in files">
|
||||
<v-flex :key="item.path" xs12 sm6 md4 xl3
|
||||
class="elem">
|
||||
class="elem">
|
||||
<v-card class="elem-content elevation-3" v-ripple="true">
|
||||
<v-card-text class="elem-card">
|
||||
<v-container fluid style="padding: 0;">
|
||||
<v-layout row wrap class="elem-container">
|
||||
<v-flex xs7
|
||||
v-tooltip:top="{ html: item.name }">
|
||||
v-tooltip:top="{ html: item.name }">
|
||||
<h6 class="title ellipsis">{{ item.name }}</h6>
|
||||
</v-flex>
|
||||
<v-flex xs2
|
||||
v-tooltip:top="{ html: 'Episode ' + item.ep }"
|
||||
class="elem-ep text-xs-right">
|
||||
v-tooltip:top="{ html: 'Episode ' + item.ep }"
|
||||
class="elem-ep text-xs-right">
|
||||
<p class="ellipsis ep">{{ item.ep }} / {{ item.numberOfEpisode }}</p>
|
||||
</v-flex>
|
||||
<v-flex xs3 class="buttons-container">
|
||||
|
@ -59,14 +59,34 @@
|
|||
@click.native="playThis(item.path)">
|
||||
<v-icon large>play_circle_outline</v-icon>
|
||||
</v-btn>
|
||||
<v-btn medium icon
|
||||
class="delete-button"
|
||||
@click.native="delThis(item.path)">
|
||||
<v-icon medium>delete_forever</v-icon>
|
||||
</v-btn>
|
||||
<v-menu open-on-hover
|
||||
transition="slide-x-transition">
|
||||
<v-btn icon medium slot="activator">
|
||||
<v-icon>more_vert</v-icon>
|
||||
</v-btn>
|
||||
<v-list>
|
||||
<v-list-tile @click.native="showChoices(item.name)">
|
||||
<v-list-tile-action>
|
||||
<v-icon>add_box</v-icon>
|
||||
</v-list-tile-action>
|
||||
<v-list-tile-title>
|
||||
Add to
|
||||
</v-list-tile-title>
|
||||
</v-list-tile>
|
||||
<v-list-tile @click.native="delThis(item.path)">
|
||||
<v-list-tile-action>
|
||||
<v-icon medium class="primary--text">delete_forever</v-icon>
|
||||
</v-list-tile-action>
|
||||
<v-list-tile-title class="primary--text">Delete</v-list-tile-title>
|
||||
</v-list-tile>
|
||||
</v-list>
|
||||
</v-menu>
|
||||
</v-flex>
|
||||
<v-flex xs8 v-tooltip:top="{ html: item.genres.length ? item.genres.join(', ') : 'No specified genre' }">
|
||||
<p class="ellipsis genres">{{ item.genres.length ? item.genres.join(', ') : 'No specified genre' }}</p>
|
||||
<v-flex xs8
|
||||
v-tooltip:top="{ html: item.genres.length ? item.genres.join(', ') : 'No specified genre' }">
|
||||
<p class="ellipsis genres">
|
||||
{{ item.genres.length ? item.genres.join(', ') : 'No specified genre' }}
|
||||
</p>
|
||||
</v-flex>
|
||||
<v-flex xs4 v-tooltip:top="{ html: item.classification.replace('None', 'No restriction') }">
|
||||
<p class="ellipsis classification">
|
||||
|
@ -78,7 +98,9 @@
|
|||
</v-flex>
|
||||
<v-flex xl7 lg8 md7 sm9 xs8 class="bottom-right-container">
|
||||
<v-layout row wrap justify-space-between>
|
||||
<v-flex xs12><div class="synopsis">{{ reduced(item.synopsis) }}</div></v-flex>
|
||||
<v-flex xs12>
|
||||
<div class="synopsis">{{ reduced(item.synopsis) }}</div>
|
||||
</v-flex>
|
||||
<v-flex xs12 style="display: flex">
|
||||
<v-layout align-center justify-space-between style="min-width: 100%">
|
||||
<v-flex xs2>
|
||||
|
@ -140,11 +162,13 @@
|
|||
</v-flex>
|
||||
</v-layout>
|
||||
</v-container>
|
||||
<choice-window :entry="choiceTitle"></choice-window>
|
||||
</v-container>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import HistoryModal from '~components/historyModal.vue'
|
||||
import ChoiceWindow from '~components/choiceWindow.vue'
|
||||
import axios from 'axios'
|
||||
|
||||
export default {
|
||||
|
@ -157,7 +181,7 @@
|
|||
}
|
||||
},
|
||||
mounted () {
|
||||
setTimeout(this.emptyBg = true, 1000)
|
||||
setTimeout(() => { this.emptyBg = true }, 1000)
|
||||
|
||||
this.refresh()
|
||||
},
|
||||
|
@ -166,7 +190,8 @@
|
|||
},
|
||||
data () {
|
||||
return {
|
||||
emptyBg: false
|
||||
emptyBg: false,
|
||||
choiceTitle: ''
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
|
@ -183,7 +208,8 @@
|
|||
}
|
||||
},
|
||||
components: {
|
||||
HistoryModal
|
||||
HistoryModal,
|
||||
ChoiceWindow
|
||||
},
|
||||
methods: {
|
||||
reduced (text) {
|
||||
|
@ -241,7 +267,11 @@
|
|||
},
|
||||
resetLocal () {
|
||||
this.$store.dispatch('resetLocal')
|
||||
}
|
||||
},
|
||||
showChoices (name) {
|
||||
this.choiceTitle = name
|
||||
this.$store.commit('setAddToChoice', true)
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
@ -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;
|
||||
|
|
|
@ -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 () {
|
||||
|
|
Loading…
Reference in New Issue