@@ -90,6 +90,9 @@ export default {
9090 // return 50
9191 return this .nowPlayTime / this .maxPlayTime || 0
9292 },
93+ isAPITemp () {
94+ return this .setting .apiSource == ' temp'
95+ },
9396 },
9497 mounted () {
9598 this .setProgessWidth ()
@@ -249,7 +252,8 @@ export default {
249252 },
250253 handleNext () {
251254 // if (this.list.listName === null) return
252- if (! this .list .length ) return
255+ const list = this .isAPITemp ? this .list .filter (s => s .source == ' kw' ) : this .list
256+ if (! list .length ) return
253257 let index
254258 switch (this .setting .player .togglePlayMethod ) {
255259 case ' listLoop' :
@@ -267,14 +271,17 @@ export default {
267271 if (index < 0 ) return
268272 this .setPlayIndex (index)
269273 },
270- hanldeListLoop () {
271- return this .playIndex === this .list .length - 1 ? 0 : this .playIndex + 1
274+ hanldeListLoop (index = this .playIndex ) {
275+ index = index === this .list .length - 1 ? 0 : index + 1
276+ return this .isAPITemp && this .list [index].source != ' kw' ? this .hanldeListLoop (index) : index
272277 },
273- hanldeListNext () {
274- return this .playIndex === this .list .length - 1 ? - 1 : this .playIndex + 1
278+ hanldeListNext (index = this .playIndex ) {
279+ index = index === this .list .length - 1 ? - 1 : index + 1
280+ return this .isAPITemp && this .list [index].source != ' kw' ? this .hanldeListNext (index) : index
275281 },
276- hanldeListRandom () {
277- return getRandom (0 , this .list .length )
282+ hanldeListRandom (index = this .playIndex ) {
283+ index = getRandom (0 , this .list .length )
284+ return this .isAPITemp && this .list [index].source != ' kw' ? this .hanldeListRandom (index) : index
278285 },
279286 startPlay () {
280287 this .isPlay = true
@@ -314,6 +321,7 @@ export default {
314321 setUrl (targetSong ) {
315322 let type = this .getPlayType (this .setting .player .highQuality , targetSong)
316323 this .musicInfo .url = targetSong .typeUrl [type]
324+ this .status = ' 歌曲链接获取中...'
317325
318326 let urlP = this .musicInfo .url
319327 ? Promise .resolve ()
@@ -323,6 +331,8 @@ export default {
323331
324332 urlP .then (() => {
325333 this .audio .src = this .musicInfo .url
334+ }).catch (err => {
335+ this .status = err .message
326336 })
327337 },
328338 setImg (targetSong ) {
0 commit comments