Skip to content

Commit

Permalink
fix: remove getSessions call
Browse files Browse the repository at this point in the history
  • Loading branch information
lonzzi committed Oct 28, 2024
1 parent 94a0aa4 commit 8d11b1c
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions ede.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// @description Jellyfin弹幕插件
// @namespace https://github.com/RyoLee
// @author RyoLee
// @version 1.49
// @version 1.50
// @copyright 2022, RyoLee (https://github.com/RyoLee)
// @license MIT; https://raw.githubusercontent.com/Izumiko/jellyfin-danmaku/jellyfin/LICENSE
// @icon https://github.githubassets.com/pinned-octocat.svg
Expand Down Expand Up @@ -59,7 +59,6 @@
const originalOpen = XMLHttpRequest.prototype.open;
XMLHttpRequest.prototype.open = function (_, url) {
this.addEventListener('load', function () {
console.log('XMLHttpRequest to:', url);
if (url.endsWith('PlaybackInfo')) {
const res = JSON.parse(this.responseText);
itemId = res.MediaSources[0].Id;
Expand Down Expand Up @@ -1515,8 +1514,13 @@
}

(async () => {
while (!(await ApiClient.getSessions())) {
let retry = 0;
while (!itemId) {
await new Promise((resolve) => setTimeout(resolve, 200));
retry++;
if (retry > 10) {
throw new Error('获取itemId失败');
}
}

setInterval(() => {
Expand Down

0 comments on commit 8d11b1c

Please sign in to comment.