一分钟搭建影视站,支持Docker等部署方式
fix: Fixed the issue of duplicated position parameters on the playback page and inconsistent names of historical card sources
sswestb620cb0e1132
diff --git a/js/ui.js b/js/ui.jsindex f781e1f..d07b4c9 100644--- a/js/ui.js+++ b/js/ui.js@@ -476,14 +476,14 @@ function playFromHistory(url, title, episodeIndex, playbackPosition = 0) {if (url.includes('?')) {// URL已有参数,添加索引和位置参数- let playUrl = url;- if (!url.includes('index=') && episodeIndex > 0) {- playUrl += `&index=${episodeIndex}`;+ const playUrl = new URL(url);+ if (!playUrl.searchParams.has('index') && episodeIndex > 0) {+ playUrl.searchParams.set('index', episodeIndex);}if (playbackPosition > 10) {- playUrl += positionParam;+ playUrl.searchParams.set('position', Math.floor(playbackPosition).toString());}- window.open(playUrl, '_blank');+ window.open(playUrl.toString(), '_blank');} else {// 原始URL,构造player页面链接const playerUrl = `player.html?url=${encodeURIComponent(url)}&title=${encodeURIComponent(title)}&index=${episodeIndex}${positionParam}`;diff --git a/player.html b/player.htmlindex 32a4299..faf75c4 100644--- a/player.html+++ b/player.html@@ -1244,6 +1244,7 @@// 存在则更新现有记录的集数、时间戳和URLhistory[existingIndex].episodeIndex = currentEpisodeIndex;history[existingIndex].timestamp = Date.now();+ history[existingIndex].sourceName = sourceName// 更新播放进度信息history[existingIndex].playbackPosition = currentPosition > 10 ? currentPosition : history[existingIndex].playbackPosition;history[existingIndex].duration = videoDuration || history[existingIndex].duration;