处理仓库链接回放问题
This commit is contained in:
@@ -11,7 +11,7 @@ async function getPlaybackData(programId, timeout = 6000) {
|
||||
return resp.body?.program[0]?.content
|
||||
}
|
||||
|
||||
async function updatePlaybackDataByMigu(program, filePath, timeout = 6000) {
|
||||
async function updatePlaybackDataByMigu(program, filePath, timeout = 6000, githubAnd8 = 0) {
|
||||
// 今日节目数据
|
||||
const playbackData = await getPlaybackData(program.pID, timeout)
|
||||
if (!playbackData) {
|
||||
@@ -30,7 +30,7 @@ async function updatePlaybackDataByMigu(program, filePath, timeout = 6000) {
|
||||
const contName = playbackData[i].contName.replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">").replaceAll("\"", """).replaceAll("'", "'");
|
||||
|
||||
appendFileSync(filePath,
|
||||
` <programme channel="${program.name}" start="${getDateTimeString(new Date(playbackData[i].startTime))} +0800" stop="${getDateTimeString(new Date(playbackData[i].endTime))} +0800">\n` +
|
||||
` <programme channel="${program.name}" start="${getDateTimeString(new Date(playbackData[i].startTime + githubAnd8))} +0800" stop="${getDateTimeString(new Date(playbackData[i].endTime + githubAnd8))} +0800">\n` +
|
||||
` <title lang="zh">${contName}</title>\n` +
|
||||
` </programme>\n`
|
||||
)
|
||||
@@ -38,7 +38,7 @@ async function updatePlaybackDataByMigu(program, filePath, timeout = 6000) {
|
||||
return true
|
||||
}
|
||||
|
||||
async function updatePlaybackDataByCntv(program, filePath, timeout = 6000) {
|
||||
async function updatePlaybackDataByCntv(program, filePath, timeout = 6000, githubAnd8 = 0) {
|
||||
// 今日节目数据
|
||||
const date = new Date()
|
||||
const today = getDateString(date)
|
||||
@@ -62,7 +62,7 @@ async function updatePlaybackDataByCntv(program, filePath, timeout = 6000) {
|
||||
const contName = playbackData[i].t.replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">").replaceAll("\"", """).replaceAll("'", "'");
|
||||
|
||||
appendFileSync(filePath,
|
||||
` <programme channel="${program.name}" start="${getDateTimeString(new Date(playbackData[i].st * 1000))} +0800" stop="${getDateTimeString(new Date(playbackData[i].et * 1000))} +0800">\n` +
|
||||
` <programme channel="${program.name}" start="${getDateTimeString(new Date(playbackData[i].st * 1000 + githubAnd8))} +0800" stop="${getDateTimeString(new Date(playbackData[i].et * 1000 + githubAnd8))} +0800">\n` +
|
||||
` <title lang="zh">${contName}</title>\n` +
|
||||
` </programme>\n`
|
||||
)
|
||||
@@ -70,11 +70,11 @@ async function updatePlaybackDataByCntv(program, filePath, timeout = 6000) {
|
||||
return true
|
||||
}
|
||||
|
||||
async function updatePlaybackData(program, filePath, timeout = 6000) {
|
||||
async function updatePlaybackData(program, filePath, timeout = 6000, githubAnd8 = 0) {
|
||||
if (cntvNames[program.name]) {
|
||||
return updatePlaybackDataByCntv(program, filePath, timeout)
|
||||
return updatePlaybackDataByCntv(program, filePath, timeout, githubAnd8)
|
||||
}
|
||||
return updatePlaybackDataByMigu(program, filePath, timeout)
|
||||
return updatePlaybackDataByMigu(program, filePath, timeout, githubAnd8)
|
||||
|
||||
}
|
||||
export { updatePlaybackData }
|
||||
|
||||
Reference in New Issue
Block a user