Skip to content

Commit

Permalink
修复bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Izumiko committed Nov 20, 2023
1 parent 6717e83 commit d71e6c0
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions ede.js
Original file line number Diff line number Diff line change
Expand Up @@ -475,6 +475,10 @@
"mode": "cors"
}).then(res => res.json());
playingInfo = sessionInfo[0].NowPlayingItem;
if (sessionInfo[0] && !playingInfo) {
showDebugInfo('闲置中');
return 'Idle';
}
}
showDebugInfo('成功 ' + playingInfo.SeriesName);
return playingInfo;
Expand Down Expand Up @@ -531,10 +535,14 @@
if (session != 1) {
animeName += ' ' + session;
}
} else {
} else if (item.Type == 'Movie') {
_id = item.Id;
animeName = item.Name;
episode = 'movie';
} else {
_id = item.Id;
animeName = item.Name;
episode = '';
}
let _id_key = '_anime_id_rel_' + _id;
let _name_key = '_anime_name_rel_' + _id;
Expand All @@ -555,7 +563,7 @@
}

let searchUrl = apiPrefix + 'https://api.dandanplay.net/api/v2/search/episodes?anime=' + animeName + '&withRelated=true';
if (is_auto) {
if (is_auto && episode.toString().length > 0) {
searchUrl += '&episode=' + episode;
}
let animaInfo = await makeGetRequest(searchUrl)
Expand Down Expand Up @@ -644,12 +652,13 @@
if (!comments) {
return;
}

let wrapper = document.getElementById('danmakuWrapper');
wrapper && wrapper.parentNode.removeChild(wrapper);
if (window.ede.danmaku != null) {
window.ede.danmaku.clear();
window.ede.danmaku.destroy();
window.ede.danmaku = null;
let wrapper = document.getElementById('danmakuWrapper');
wrapper.parentNode.removeChild(wrapper);
}
let _comments = danmakuFilter(danmakuParser(comments));
showDebugInfo('弹幕加载成功: ' + _comments.length);
Expand Down Expand Up @@ -679,7 +688,7 @@
// showDebugInfo(_comments[0].text)
// showDebugInfo(_container.id + ' ' + _media.className)

const wrapper = document.createElement('div');
wrapper = document.createElement('div');
wrapper.id = 'danmakuWrapper';
wrapper.style.position = 'relative';
wrapper.style.width = '100%';
Expand Down

0 comments on commit d71e6c0

Please sign in to comment.