mirror of
https://github.com/remix-bot/fluxer.git
synced 2026-11-24 06:01:44 -05:00
testing
This commit is contained in:
1 parent
998040d33a
commit
3d8b5b3ae6
1 file changed
+23
-59
+23
-59
@@ -2281,19 +2281,7 @@ export default class Player extends EventEmitter {
|
|||||||
const remainingMs = trackOptMatch.endMs - elapsedMs;
|
const remainingMs = trackOptMatch.endMs - elapsedMs;
|
||||||
if (remainingMs > 0) {
|
if (remainingMs > 0) {
|
||||||
const match = trackOptMatch;
|
const match = trackOptMatch;
|
||||||
this._trackEndTimer = setTimeout(() => {
|
this._trackEndTimer = setTimeout(() => this._onTrackEndTimeReached(match), remainingMs);
|
||||||
if (this._destroyed || this.leaving || !this._activeTrackOpt) return;
|
|
||||||
logger.player(`[Player] TrackOptions: end time reached (${match.endMs}ms), skipping track`);
|
|
||||||
this._activeTrackOpt = null;
|
|
||||||
this._trackEndTimer = null;
|
|
||||||
this._trackEndRemainingMs = null;
|
|
||||||
this._skipping = true;
|
|
||||||
this._stopMediaPlayer().then(() => {
|
|
||||||
this._doPlayNext();
|
|
||||||
}).catch(() => {
|
|
||||||
this._doPlayNext();
|
|
||||||
});
|
|
||||||
}, remainingMs);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2338,6 +2326,24 @@ export default class Player extends EventEmitter {
|
|||||||
_trackEndTimer = null;
|
_trackEndTimer = null;
|
||||||
_trackEndRemainingMs = null;
|
_trackEndRemainingMs = null;
|
||||||
|
|
||||||
|
_onTrackEndTimeReached(match) {
|
||||||
|
if (this._destroyed || this.leaving || !this._activeTrackOpt) return;
|
||||||
|
logger.player(`[Player] TrackOptions: end time reached (${match.endMs}ms), skipping track`);
|
||||||
|
this._activeTrackOpt = null;
|
||||||
|
this._trackEndTimer = null;
|
||||||
|
this._trackEndRemainingMs = null;
|
||||||
|
if (this.queue.isEmpty()) {
|
||||||
|
logger.player("[Player] TrackOptions: queue empty after end time — letting track continue");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this._skipping = true;
|
||||||
|
this._stopMediaPlayer().then(() => {
|
||||||
|
this._doPlayNext();
|
||||||
|
}).catch(() => {
|
||||||
|
this._doPlayNext();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
_clearTrackEndTimer() {
|
_clearTrackEndTimer() {
|
||||||
if (this._trackEndTimer) {
|
if (this._trackEndTimer) {
|
||||||
clearTimeout(this._trackEndTimer);
|
clearTimeout(this._trackEndTimer);
|
||||||
@@ -2361,19 +2367,7 @@ export default class Player extends EventEmitter {
|
|||||||
}
|
}
|
||||||
const remainingMs = this._trackEndRemainingMs;
|
const remainingMs = this._trackEndRemainingMs;
|
||||||
const match = this._activeTrackOpt;
|
const match = this._activeTrackOpt;
|
||||||
this._trackEndTimer = setTimeout(() => {
|
this._trackEndTimer = setTimeout(() => this._onTrackEndTimeReached(match), remainingMs);
|
||||||
if (this._destroyed || this.leaving || !this._activeTrackOpt) return;
|
|
||||||
logger.player(`[Player] TrackOptions: end time reached (${match.endMs}ms), skipping track`);
|
|
||||||
this._activeTrackOpt = null;
|
|
||||||
this._trackEndTimer = null;
|
|
||||||
this._trackEndRemainingMs = null;
|
|
||||||
this._skipping = true;
|
|
||||||
this._stopMediaPlayer().then(() => {
|
|
||||||
this._doPlayNext();
|
|
||||||
}).catch(() => {
|
|
||||||
this._doPlayNext();
|
|
||||||
});
|
|
||||||
}, remainingMs);
|
|
||||||
this._trackEndRemainingMs = null;
|
this._trackEndRemainingMs = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2383,29 +2377,11 @@ export default class Player extends EventEmitter {
|
|||||||
const elapsedMs = Date.now() - this.startedPlaying;
|
const elapsedMs = Date.now() - this.startedPlaying;
|
||||||
const remainingMs = this._activeTrackOpt.endMs - elapsedMs;
|
const remainingMs = this._activeTrackOpt.endMs - elapsedMs;
|
||||||
if (remainingMs <= 0) {
|
if (remainingMs <= 0) {
|
||||||
this._activeTrackOpt = null;
|
this._onTrackEndTimeReached(this._activeTrackOpt);
|
||||||
this._skipping = true;
|
|
||||||
this._stopMediaPlayer().then(() => {
|
|
||||||
this._doPlayNext();
|
|
||||||
}).catch(() => {
|
|
||||||
this._doPlayNext();
|
|
||||||
});
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const match = this._activeTrackOpt;
|
const match = this._activeTrackOpt;
|
||||||
this._trackEndTimer = setTimeout(() => {
|
this._trackEndTimer = setTimeout(() => this._onTrackEndTimeReached(match), remainingMs);
|
||||||
if (this._destroyed || this.leaving || !this._activeTrackOpt) return;
|
|
||||||
logger.player(`[Player] TrackOptions: end time reached (${match.endMs}ms), skipping track`);
|
|
||||||
this._activeTrackOpt = null;
|
|
||||||
this._trackEndTimer = null;
|
|
||||||
this._trackEndRemainingMs = null;
|
|
||||||
this._skipping = true;
|
|
||||||
this._stopMediaPlayer().then(() => {
|
|
||||||
this._doPlayNext();
|
|
||||||
}).catch(() => {
|
|
||||||
this._doPlayNext();
|
|
||||||
});
|
|
||||||
}, remainingMs);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async _lookupTrackOptions(songData) {
|
async _lookupTrackOptions(songData) {
|
||||||
@@ -2486,19 +2462,7 @@ export default class Player extends EventEmitter {
|
|||||||
const remainingMs = match.endMs - elapsedMs;
|
const remainingMs = match.endMs - elapsedMs;
|
||||||
if (remainingMs > 0) {
|
if (remainingMs > 0) {
|
||||||
this._activeTrackOpt = match;
|
this._activeTrackOpt = match;
|
||||||
this._trackEndTimer = setTimeout(() => {
|
this._trackEndTimer = setTimeout(() => this._onTrackEndTimeReached(match), remainingMs);
|
||||||
if (this._destroyed || this.leaving || !this._activeTrackOpt) return;
|
|
||||||
logger.player(`[Player] TrackOptions: end time reached (${match.endMs}ms), skipping track`);
|
|
||||||
this._activeTrackOpt = null;
|
|
||||||
this._trackEndTimer = null;
|
|
||||||
this._trackEndRemainingMs = null;
|
|
||||||
this._skipping = true;
|
|
||||||
this._stopMediaPlayer().then(() => {
|
|
||||||
this._doPlayNext();
|
|
||||||
}).catch(() => {
|
|
||||||
this._doPlayNext();
|
|
||||||
});
|
|
||||||
}, remainingMs);
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
this._activeTrackOpt = match;
|
this._activeTrackOpt = match;
|
||||||
|
|||||||
Reference in new issue
Block a user