mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-01-03 00:06:46 +01:00
added method to clear selected episodes
This commit is contained in:
parent
1e8e45431d
commit
221061ea30
@ -118,12 +118,15 @@ export default {
|
|||||||
toggleSelectEpisode(index) {
|
toggleSelectEpisode(index) {
|
||||||
this.$set(this.selectedEpisodes, String(index), !this.selectedEpisodes[String(index)])
|
this.$set(this.selectedEpisodes, String(index), !this.selectedEpisodes[String(index)])
|
||||||
},
|
},
|
||||||
|
clearSelectedEpisodes() {
|
||||||
|
Object.keys(this.selectedEpisodes).forEach((key, idx) => this.$set(this.selectedEpisodes, String(idx), false))
|
||||||
|
},
|
||||||
submit() {
|
submit() {
|
||||||
var episodesToDownload = []
|
var episodesToDownload = []
|
||||||
if (this.episodesSelected.length) {
|
if (this.episodesSelected.length) {
|
||||||
episodesToDownload = this.episodesSelected.map((episodeIndex) => this.episodes[Number(episodeIndex)])
|
episodesToDownload = this.episodesSelected.map((episodeIndex) => this.episodes[Number(episodeIndex)])
|
||||||
}
|
}
|
||||||
this.selectedEpisodes = []
|
this.clearSelectedEpisodes()
|
||||||
|
|
||||||
var payloadSize = JSON.stringify(episodesToDownload).length
|
var payloadSize = JSON.stringify(episodesToDownload).length
|
||||||
var sizeInMb = payloadSize / 1024 / 1024
|
var sizeInMb = payloadSize / 1024 / 1024
|
||||||
|
Loading…
Reference in New Issue
Block a user