2017-08-13 22:46:05 +00:00
|
|
|
<template lang="pug">
|
2017-12-12 15:20:53 +00:00
|
|
|
v-container#local-page.pa-0(fluid)
|
2017-09-19 08:19:15 +00:00
|
|
|
div(v-if='nbEps')
|
2017-08-13 22:46:05 +00:00
|
|
|
v-layout(row, wrap, style='margin: 0 1%;')
|
|
|
|
v-flex.menubar(xs12)
|
|
|
|
v-layout(row, wrap)
|
2018-04-23 22:16:19 +00:00
|
|
|
v-flex(hidden-sm-and-up, xs1)
|
|
|
|
v-flex.menu-eps(xs3, sm2, md2)
|
2017-08-13 22:46:05 +00:00
|
|
|
p.menu-eps-text {{ nbEps }} {{ episodeLabel }}
|
2018-04-23 22:16:19 +00:00
|
|
|
v-flex(xs4, offset-xs1, sm2, offset-sm0, md2)
|
2017-08-13 22:46:05 +00:00
|
|
|
history-modal
|
2018-04-23 22:16:19 +00:00
|
|
|
v-flex(xs3, sm2, md2)
|
|
|
|
v-switch(
|
|
|
|
:label="inside ? 'Inside' : 'Outside'",
|
|
|
|
color='primary',
|
|
|
|
v-model='inside',
|
|
|
|
dark,
|
|
|
|
persistent-hint,
|
|
|
|
hint='Play in KawAnime?'
|
|
|
|
)
|
|
|
|
v-flex.menu-buttons(xs12, sm6, offset-md1, md5, offset-lg2, lg4, offset-xl3, xl3)
|
2017-09-19 08:19:15 +00:00
|
|
|
v-btn.refresh-button(icon, v-if='!this.$store.state.localFiles.refreshing', @click='refresh()')
|
2017-08-13 22:46:05 +00:00
|
|
|
v-icon(large) refresh
|
|
|
|
v-btn.refresh-button(v-else, icon, loading)
|
|
|
|
v-btn.change-dir-button(flat, dark, @click='changePath()')
|
|
|
|
| Change dir
|
2017-10-10 01:51:34 +00:00
|
|
|
v-btn.reset-cache-button(color='secondary', dark, @click='resetLocal()', v-if='!this.$store.state.localFiles.resetting')
|
2017-08-13 22:46:05 +00:00
|
|
|
| Refresh local info
|
2017-10-10 01:51:34 +00:00
|
|
|
v-btn.reset-cache-button(color='secondary', dark, loading, v-else)
|
2017-08-13 22:46:05 +00:00
|
|
|
transition-group(name='list')
|
|
|
|
template(v-for='item in files')
|
|
|
|
v-flex.elem(:key='item.path', xs12, sm6, md4, xl3)
|
2017-12-24 04:59:30 +00:00
|
|
|
v-card.pt-1.elem-content.elevation-3(ripple)
|
2017-10-16 00:13:18 +00:00
|
|
|
v-layout.elem-container.ma-0(row, wrap)
|
|
|
|
v-flex(xs7)
|
|
|
|
v-tooltip(top)
|
|
|
|
h6.elem-title.ellipsis(slot='activator') {{ item.name }}
|
|
|
|
span {{ item.name }}
|
|
|
|
v-flex.elem-ep.text-xs-right(xs2)
|
|
|
|
v-tooltip(top)
|
|
|
|
p.ellipsis.ep(slot='activator') {{ item.ep }} / {{ item.numberOfEpisode }}
|
|
|
|
span {{ 'Episode ' + item.ep }}
|
|
|
|
v-flex.buttons-container(xs3)
|
2017-12-04 17:24:47 +00:00
|
|
|
v-btn.ma-0(large, icon, @click='playThis(item)')
|
2017-10-16 00:13:18 +00:00
|
|
|
v-icon(large) play_circle_outline
|
|
|
|
v-menu(open-on-hover, transition='slide-x-transition')
|
2017-10-16 05:39:58 +00:00
|
|
|
v-btn.ml-0(icon, medium, slot='activator')
|
2017-10-16 00:13:18 +00:00
|
|
|
v-icon more_vert
|
|
|
|
v-list.dark
|
|
|
|
v-list-tile(@click='showChoices(item.name)')
|
|
|
|
v-list-tile-action
|
|
|
|
v-icon add_box
|
|
|
|
v-list-tile-title
|
|
|
|
| Add to
|
|
|
|
v-list-tile(@click='delThis(item)')
|
|
|
|
v-list-tile-action
|
|
|
|
v-icon.primary--text(medium) delete_forever
|
|
|
|
v-list-tile-title.primary--text Delete
|
|
|
|
v-flex(xs8)
|
|
|
|
v-tooltip(top)
|
|
|
|
p.ellipsis.genres(slot='activator')
|
|
|
|
| {{ item.genres.length ? item.genres.join(', ') : 'No specified genre' }}
|
|
|
|
span {{ item.genres.length ? item.genres.join(', ') : 'No specified genre' }}
|
|
|
|
v-flex(xs4)
|
|
|
|
v-tooltip(top)
|
|
|
|
p.ellipsis.classification(slot='activator')
|
|
|
|
| {{ item.classification.replace('None', 'No restriction') }}
|
|
|
|
span {{ item.classification.replace('None', 'No restriction') }}
|
|
|
|
v-flex.picture-container(xl5, lg4, md5, xs4)
|
|
|
|
lazy-component
|
|
|
|
img.picture(:src='item.picture', onerror="this.src='static/images/error.jpg'")
|
|
|
|
v-flex.bottom-right-container(xl7, lg8, md7, xs8)
|
|
|
|
v-layout.pl-2.pr-2.pb-2(row, wrap, justify-space-between)
|
|
|
|
v-flex(xs12)
|
2017-11-02 04:57:41 +00:00
|
|
|
.synopsis {{ item.synopsis }}
|
2017-10-16 00:13:18 +00:00
|
|
|
v-flex(xs12, style='display: flex')
|
|
|
|
v-layout(align-center, justify-space-between, style='min-width: 100%')
|
|
|
|
v-flex(xs2)
|
|
|
|
p.year {{ item.year }}
|
|
|
|
v-flex(xs7)
|
|
|
|
p.status {{ item.status }}
|
|
|
|
v-flex(xs3)
|
|
|
|
p.mark {{ item.mark }}
|
2017-12-12 15:20:53 +00:00
|
|
|
v-container#empty(fluid, v-else)
|
2017-08-13 22:46:05 +00:00
|
|
|
transition(name='fade')
|
|
|
|
img.empty-bg(v-if='emptyBg', height='400', src='~static/images/empty-bg.png')
|
|
|
|
v-layout(row, wrap)
|
|
|
|
v-flex.menubar(xs12)
|
|
|
|
v-layout(row, wrap)
|
|
|
|
v-flex(offset-xs2, xs2)
|
|
|
|
history-modal
|
|
|
|
v-flex(xs5)
|
|
|
|
v-flex.menu-buttons(xs3)
|
2017-09-19 08:19:15 +00:00
|
|
|
v-btn.refresh-button(icon, v-if='!this.$store.state.localFiles.refreshing', @click='refresh()')
|
2017-08-13 22:46:05 +00:00
|
|
|
v-icon(large) refresh
|
|
|
|
v-btn.refresh-button(v-else, icon, loading)
|
|
|
|
v-btn.change-dir-button(flat, dark, @click='changePath()')
|
|
|
|
| Change dir
|
|
|
|
v-flex.empty-message(xs12)
|
2017-12-08 23:58:03 +00:00
|
|
|
h3 Wow such empty!
|
|
|
|
h4
|
2017-08-23 13:07:37 +00:00
|
|
|
| Start downloading anime
|
2017-08-13 22:46:05 +00:00
|
|
|
router-link.green--text(to='/downloader') here
|
2017-08-23 13:07:37 +00:00
|
|
|
| or
|
2017-08-13 22:46:05 +00:00
|
|
|
router-link.cyan--text(to='/') here!
|
2017-04-15 14:16:14 +00:00
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
export default {
|
2017-06-22 12:57:47 +00:00
|
|
|
mounted () {
|
2017-08-23 13:07:37 +00:00
|
|
|
setTimeout(() => { this.emptyBg = true }, 300)
|
2017-07-06 20:01:26 +00:00
|
|
|
|
2018-04-23 22:16:19 +00:00
|
|
|
this.inside = this.$store.state.config.config.video.inside
|
|
|
|
|
2017-06-22 12:57:47 +00:00
|
|
|
this.refresh()
|
|
|
|
},
|
2017-07-06 20:01:26 +00:00
|
|
|
beforeDestroy () {
|
|
|
|
this.emptyBg = false
|
|
|
|
},
|
2017-05-13 14:38:17 +00:00
|
|
|
data () {
|
2017-07-06 20:01:26 +00:00
|
|
|
return {
|
2018-04-23 22:16:19 +00:00
|
|
|
inside: true,
|
2017-11-22 21:06:17 +00:00
|
|
|
emptyBg: false
|
2017-07-06 20:01:26 +00:00
|
|
|
}
|
2017-04-15 14:16:14 +00:00
|
|
|
},
|
|
|
|
computed: {
|
2017-09-19 08:19:15 +00:00
|
|
|
files () {
|
|
|
|
return this.$store.state.localFiles.files
|
2017-04-15 14:16:14 +00:00
|
|
|
},
|
2017-09-19 08:19:15 +00:00
|
|
|
nbEps () {
|
2017-04-15 14:16:14 +00:00
|
|
|
return this.files.length
|
|
|
|
},
|
2017-09-19 08:19:15 +00:00
|
|
|
episodeLabel () {
|
2017-04-15 14:16:14 +00:00
|
|
|
return this.nbEps === 1
|
2017-05-13 14:38:17 +00:00
|
|
|
? 'episode'
|
|
|
|
: 'episodes'
|
2017-04-15 14:16:14 +00:00
|
|
|
}
|
|
|
|
},
|
|
|
|
methods: {
|
2018-03-25 18:37:09 +00:00
|
|
|
async playThis (item) {
|
|
|
|
this.$log(`Requested to play ${item.name} - ${item.ep}. Sending...`)
|
2018-05-20 18:05:45 +00:00
|
|
|
const name = `${item.name} - ${item.ep}`
|
2017-04-15 14:16:14 +00:00
|
|
|
|
2018-03-25 18:37:09 +00:00
|
|
|
if (this.inside) {
|
2018-04-29 13:04:04 +00:00
|
|
|
this.$store.commit('streaming/play', {
|
2018-03-25 18:37:09 +00:00
|
|
|
show: true,
|
|
|
|
link: {
|
2018-03-27 01:02:07 +00:00
|
|
|
link: item.path,
|
2018-05-20 18:05:45 +00:00
|
|
|
name
|
2018-03-25 18:37:09 +00:00
|
|
|
}
|
|
|
|
})
|
|
|
|
} else {
|
|
|
|
const { status } = await this.$axios.get(`openThis`, {
|
|
|
|
params: {
|
|
|
|
type: 'video',
|
|
|
|
path: item.path,
|
|
|
|
dir: this.$store.state.localFiles.dir
|
|
|
|
}
|
|
|
|
})
|
2017-04-24 21:49:56 +00:00
|
|
|
|
2018-05-20 18:05:45 +00:00
|
|
|
this.$store.dispatch('history/append', {
|
|
|
|
type: 'Play',
|
|
|
|
text: name
|
|
|
|
})
|
|
|
|
|
2018-03-25 18:37:09 +00:00
|
|
|
if (status !== 200) this.$log(`An error occurred: request to open file ended with a status ${status}.`)
|
|
|
|
}
|
2017-04-15 14:16:14 +00:00
|
|
|
},
|
2017-07-30 21:11:21 +00:00
|
|
|
delThis (item) {
|
2018-04-23 22:16:19 +00:00
|
|
|
this.$log(`[${(new Date()).toLocaleTimeString()}]: Requested to delete ${item.path} - ${item.ep}. Sending...`)
|
2017-04-15 14:16:14 +00:00
|
|
|
|
2017-09-19 08:19:15 +00:00
|
|
|
this.$store.commit('localFiles/updateFiles', {
|
2017-07-06 20:01:26 +00:00
|
|
|
type: 'delete',
|
2017-07-30 21:11:21 +00:00
|
|
|
path: item.path
|
2017-07-06 20:01:26 +00:00
|
|
|
})
|
|
|
|
|
2017-12-24 04:59:30 +00:00
|
|
|
this.$axios.get(`openThis`, {
|
2017-07-03 18:22:48 +00:00
|
|
|
params: {
|
|
|
|
type: 'delete',
|
2018-03-22 03:13:17 +00:00
|
|
|
path: item.path
|
2017-07-03 18:22:48 +00:00
|
|
|
}
|
|
|
|
}).then((res) => {
|
2017-08-23 13:07:37 +00:00
|
|
|
this.$store.commit('setInfoSnackbar', `${item.name} ${item.ep} was successfully sent to Trash.`)
|
2017-09-19 21:04:40 +00:00
|
|
|
this.$store.dispatch('history/append', {
|
2017-04-24 21:49:56 +00:00
|
|
|
type: 'Delete',
|
2017-08-13 22:46:05 +00:00
|
|
|
text: `${item.name} - ${item.ep}`
|
2017-05-13 14:38:17 +00:00
|
|
|
}).catch(err => { void (err) })
|
2017-08-23 13:07:37 +00:00
|
|
|
}).catch(() => {
|
|
|
|
this.$store.commit('setInfoSnackbar', `Error while trying to delete ${item.name} ${item.ep}. Please try again later.`)
|
2017-04-15 14:16:14 +00:00
|
|
|
})
|
|
|
|
},
|
2017-05-13 14:38:17 +00:00
|
|
|
refresh () {
|
2017-09-19 08:19:15 +00:00
|
|
|
this.$store.dispatch('localFiles/refresh')
|
2017-04-24 21:49:56 +00:00
|
|
|
},
|
2017-05-13 14:38:17 +00:00
|
|
|
changePath () {
|
2017-09-19 08:19:15 +00:00
|
|
|
this.$store.dispatch('localFiles/changePath')
|
2017-04-23 00:11:51 +00:00
|
|
|
},
|
2017-05-13 14:38:17 +00:00
|
|
|
resetLocal () {
|
2018-05-20 13:53:26 +00:00
|
|
|
if (this.$store.state.isConnected) {
|
2018-05-18 09:20:13 +00:00
|
|
|
this.$store.dispatch('localFiles/reset')
|
|
|
|
} else {
|
|
|
|
this.$store.commit('setInfoSnackbar', 'You are offline.')
|
|
|
|
}
|
2017-07-17 18:13:10 +00:00
|
|
|
},
|
|
|
|
showChoices (name) {
|
2017-11-22 21:06:17 +00:00
|
|
|
this.$store.commit('setAddToChoiceTitle', name)
|
2017-07-17 18:13:10 +00:00
|
|
|
this.$store.commit('setAddToChoice', true)
|
2017-07-19 07:50:10 +00:00
|
|
|
}
|
2017-04-15 14:16:14 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
|
2017-10-16 00:13:18 +00:00
|
|
|
<style lang="stylus" scoped>
|
|
|
|
@import '~stylus/functions'
|
|
|
|
|
2017-07-06 20:01:26 +00:00
|
|
|
.fade-enter-active, .fade-leave-active
|
2017-10-16 00:13:18 +00:00
|
|
|
transition opacity .5s
|
2017-07-06 20:01:26 +00:00
|
|
|
|
|
|
|
.fade-enter, .fade-leave-to
|
2017-10-16 00:13:18 +00:00
|
|
|
opacity 0
|
2017-07-06 20:01:26 +00:00
|
|
|
|
2017-12-20 11:57:10 +00:00
|
|
|
#local-page, #empty
|
2017-12-20 11:31:48 +00:00
|
|
|
min-height calc(100vh - 48px - 24px)
|
2017-10-11 17:09:32 +00:00
|
|
|
|
2017-12-20 11:57:10 +00:00
|
|
|
#empty
|
|
|
|
position relative
|
|
|
|
|
2017-05-13 14:38:17 +00:00
|
|
|
h6
|
2017-10-16 00:13:18 +00:00
|
|
|
margin-top 0.7rem
|
|
|
|
margin-bottom 0
|
2017-05-13 14:38:17 +00:00
|
|
|
|
2017-07-13 22:08:45 +00:00
|
|
|
span
|
2017-10-16 00:13:18 +00:00
|
|
|
max-width 100%
|
|
|
|
width 100%
|
2017-05-13 14:38:17 +00:00
|
|
|
|
|
|
|
/* ------------- MENUBAR ------------- */
|
|
|
|
.menubar
|
2017-10-16 00:13:18 +00:00
|
|
|
margin-top 2px
|
2017-05-13 14:38:17 +00:00
|
|
|
|
|
|
|
.menu-eps-text
|
2017-10-16 00:13:18 +00:00
|
|
|
font-size 16px
|
|
|
|
font-weight 800
|
|
|
|
margin-top 12px
|
|
|
|
padding-left 8%
|
2017-05-13 14:38:17 +00:00
|
|
|
|
|
|
|
.refresh-button, .change-dir-button
|
2017-10-16 00:13:18 +00:00
|
|
|
display inline-block
|
2017-05-13 14:38:17 +00:00
|
|
|
|
|
|
|
.reset-cache-button:hover
|
2017-10-16 00:13:18 +00:00
|
|
|
border-color #ff9800 !important
|
|
|
|
background-color #ff9800 !important
|
2017-05-13 14:38:17 +00:00
|
|
|
|
2017-07-13 22:08:45 +00:00
|
|
|
.menu-buttons
|
2017-10-16 00:13:18 +00:00
|
|
|
display flex
|
|
|
|
justify-content center
|
2017-07-13 22:08:45 +00:00
|
|
|
|
2017-05-13 14:38:17 +00:00
|
|
|
/* -------------- ELEMS -------------- */
|
|
|
|
.elem
|
2017-10-16 00:13:18 +00:00
|
|
|
margin-bottom 10px
|
|
|
|
padding 0 4px !important
|
|
|
|
display inline-block
|
2017-05-13 14:38:17 +00:00
|
|
|
|
|
|
|
.elem-content
|
2017-10-16 00:13:18 +00:00
|
|
|
background-color rgb(60, 60, 60)
|
|
|
|
cursor default
|
2017-05-13 14:38:17 +00:00
|
|
|
|
|
|
|
.elem-content:hover
|
2017-10-16 00:13:18 +00:00
|
|
|
hover_background()
|
2017-05-13 14:38:17 +00:00
|
|
|
|
2017-07-25 22:53:10 +00:00
|
|
|
.elem-title
|
2017-10-16 00:13:18 +00:00
|
|
|
padding-left 10px
|
|
|
|
line-height 30px
|
2017-05-13 14:38:17 +00:00
|
|
|
|
2017-07-13 22:08:45 +00:00
|
|
|
.elem-ep
|
2017-10-16 00:13:18 +00:00
|
|
|
display flex
|
|
|
|
justify-content center
|
|
|
|
align-items center
|
2017-07-13 22:08:45 +00:00
|
|
|
|
2017-05-13 14:38:17 +00:00
|
|
|
.ep
|
2017-10-16 00:13:18 +00:00
|
|
|
margin 0
|
|
|
|
font-size 15px
|
|
|
|
font-weight 800
|
2017-05-13 14:38:17 +00:00
|
|
|
|
2017-07-13 22:08:45 +00:00
|
|
|
.buttons-container
|
2017-10-16 00:13:18 +00:00
|
|
|
display flex
|
|
|
|
justify-content flex-end
|
2017-10-16 05:39:58 +00:00
|
|
|
align-items space-around
|
2017-10-16 00:13:18 +00:00
|
|
|
padding 0
|
2017-07-13 22:08:45 +00:00
|
|
|
|
2017-05-13 14:38:17 +00:00
|
|
|
.genres
|
2017-10-16 00:13:18 +00:00
|
|
|
padding-left 15px
|
|
|
|
padding-right 5px
|
|
|
|
font-weight 600
|
2017-05-13 14:38:17 +00:00
|
|
|
|
2017-07-13 22:08:45 +00:00
|
|
|
.classification
|
2017-10-16 00:13:18 +00:00
|
|
|
padding-right 10px
|
2017-07-13 22:08:45 +00:00
|
|
|
|
2017-05-13 14:38:17 +00:00
|
|
|
.picture-container
|
2017-10-16 00:13:18 +00:00
|
|
|
height 220px
|
|
|
|
max-width 100%
|
2017-05-13 14:38:17 +00:00
|
|
|
|
|
|
|
.picture
|
2017-10-16 00:13:18 +00:00
|
|
|
max-width 100%
|
|
|
|
height 220px
|
2017-05-13 14:38:17 +00:00
|
|
|
|
2017-07-11 09:35:51 +00:00
|
|
|
.bottom-right-container
|
2017-10-16 00:13:18 +00:00
|
|
|
position relative
|
|
|
|
display flex
|
2017-07-11 09:35:51 +00:00
|
|
|
|
2017-05-13 14:38:17 +00:00
|
|
|
.synopsis
|
2017-10-16 00:13:18 +00:00
|
|
|
padding 2px 5px 5px 5px
|
|
|
|
text-align justify
|
|
|
|
display block
|
2017-11-02 04:57:41 +00:00
|
|
|
white-space pre-wrap
|
|
|
|
overflow-y auto
|
|
|
|
overflow-x hidden
|
|
|
|
height 10.8em
|
2017-10-16 00:13:18 +00:00
|
|
|
line-height 1.5em
|
2017-05-13 14:38:17 +00:00
|
|
|
|
|
|
|
p.year, p.status, p.mark
|
2017-10-16 00:13:18 +00:00
|
|
|
margin-bottom 0
|
2017-05-13 14:38:17 +00:00
|
|
|
|
|
|
|
.year
|
2017-10-16 00:13:18 +00:00
|
|
|
padding-left 5px
|
|
|
|
font-weight 600
|
2017-05-13 14:38:17 +00:00
|
|
|
|
|
|
|
.status
|
2017-10-16 00:13:18 +00:00
|
|
|
text-align center
|
|
|
|
font-weight 600
|
2017-05-13 14:38:17 +00:00
|
|
|
|
|
|
|
.mark
|
2017-10-16 00:13:18 +00:00
|
|
|
font-size large
|
|
|
|
font-weight 900
|
2017-05-13 14:38:17 +00:00
|
|
|
|
|
|
|
.empty-message
|
2017-10-16 00:13:18 +00:00
|
|
|
margin-top 5%
|
|
|
|
text-align center
|
2017-05-13 14:38:17 +00:00
|
|
|
|
2017-05-25 14:10:44 +00:00
|
|
|
.empty-bg
|
2017-10-16 00:13:18 +00:00
|
|
|
position absolute
|
|
|
|
bottom 0
|
|
|
|
left 5%
|
2017-05-13 14:38:17 +00:00
|
|
|
</style>
|