diff --git a/src/components/EditSites.vue b/src/components/EditSites.vue index 5c66be8..d2f9ec8 100644 --- a/src/components/EditSites.vue +++ b/src/components/EditSites.vue @@ -433,7 +433,11 @@ export default { }, async checkAllSite () { this.checkAllSitesLoading = true - Promise.all(this.sites.map(site => this.checkSingleSite(site))).then(res => { + this.stopFlag = false + const uncheckedList = this.sites.filter(e => e.status === undefined || e.status === ' ') // 未检测过的优先 + const other = this.sites.filter(e => !uncheckedList.includes(e)) + await Promise.all(uncheckedList.map(site => this.checkSingleSite(site))) + await Promise.all(other.map(site => this.checkSingleSite(site))).then(res => { this.checkAllSitesLoading = false this.getSites() }) diff --git a/src/components/IPTV.vue b/src/components/IPTV.vue index 782afaf..0115b9c 100644 --- a/src/components/IPTV.vue +++ b/src/components/IPTV.vue @@ -416,8 +416,17 @@ export default { async checkAllChannels () { this.checkAllChannelsLoading = true this.stopFlag = false + const uncheckedList = this.iptvList.filter(e => e.status === undefined || e.status === ' ') // 未检测过的优先 + const other = this.iptvList.filter(e => !uncheckedList.includes(e)) + await this.checkChannelList(uncheckedList) + await this.checkChannelList(other).then(res => { + this.checkAllChannelsLoading = false + this.getChannels() + }) + }, + async checkChannelList (channelList) { var siteList = {} - this.iptvList.forEach(channel => { + channelList.forEach(channel => { const site = channel.url.split('/')[2] if (siteList[site]) { siteList[site].push(channel) @@ -425,10 +434,7 @@ export default { siteList[site] = [channel] } }) - Promise.all(Object.values(siteList).map(site => this.checkSingleSite(site))).then(res => { - this.checkAllChannelsLoading = false - this.getChannels() - }) + await Promise.all(Object.values(siteList).map(site => this.checkSingleSite(site))) }, async checkSingleSite (channelArray) { for (const c of channelArray) {