mirror of
https://github.com/cuiocean/ZY-Player.git
synced 2026-02-10 14:05:05 +08:00
批量检测时未检查过的优先
This commit is contained in:
@@ -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()
|
||||
})
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user