Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

修复发送弹幕BUG #35

Merged
merged 1 commit into from
Feb 23, 2024
Merged

修复发送弹幕BUG #35

merged 1 commit into from
Feb 23, 2024

Conversation

Xarth-Mai
Copy link

原本没正常处理mode值导致本地发的弹幕全部变成滚动,重新加载后本地还会变成两条重复弹幕
image

@Xarth-Mai Xarth-Mai closed this Feb 23, 2024
@Xarth-Mai Xarth-Mai changed the title 回退搜番逻辑,修复发送弹幕BUG 修复发送弹幕BUG Feb 23, 2024
@Xarth-Mai Xarth-Mai reopened this Feb 23, 2024
@@ -661,9 +663,10 @@
const json = await resp.json();
if (json.errorCode == 0) {
const colorStr = `000000${color.toString(16)}`.slice(-6);
const modemap = { 6: 'ltr', 1: 'rtl', 5: 'top', 4: 'bottom' }[mode];
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

我看API文档那里,mode是个数字,你确定是用rtl这种字符串么?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image
这个danmaku跟dandanplay的不太一样

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

试了下确实是这样才正常

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

啊,我理解错了,danmaku.js的参数确实是字符串

Copy link
Author

@Xarth-Mai Xarth-Mai Feb 23, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

往服务器发送的在644行

                const danmakuUrl = apiPrefix + 'https://api.dandanplay.net/api/v2/comment/' + window.ede.episode_info.episodeId;
                const params = {
                    'time': time,
                    'mode': mode,
                    'color': color,
                    'comment': danmakuText
                };
                const resp = await fetch(danmakuUrl, {
                    method: 'POST',
                    headers: {
                        'Content-Type': 'application/json',
                        'Accept': 'application/json',
                        'User-Agent': navigator.userAgent,
                        'Authorization': 'Bearer ' + ddplayStatus.token
                    },
                    body: JSON.stringify(params)
                });

发的还是数字 但是本地播放器这个是转化成字符串

if (!sessionInfo[0].NowPlayingItem) {
await initConfig();
continue;
}
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个分支进入的前提是已经获取到认证信息了,再调用initConfig是为了换个新的?

Copy link
Author

@Xarth-Mai Xarth-Mai Feb 23, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

因为在Safari上切后台再回来 不知道Safari做了什么,会导致无法获取sessionInfo[0].NowPlayingItem 所以从头刷新一遍
而且没拿到sessionInfo[0].NowPlayingItem的话后面的代码会直接卡住image

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

哦哦,我没在Safari上测过,那就先这样吧

@Izumiko Izumiko merged commit c70f762 into Izumiko:jellyfin Feb 23, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants