fix: can't save timestamps in Plugin Options

This commit is contained in:
Kilian von Pflugk 2024-10-05 22:55:15 +02:00
parent 6fb7d05dd7
commit 486c9accf3

View File

@ -1444,24 +1444,24 @@
const lhsId = selectEpisode1.options[selectEpisode1.selectedIndex].value; const lhsId = selectEpisode1.options[selectEpisode1.selectedIndex].value;
const newLhs = { const newLhs = {
Introduction: { Introduction: {
IntroStart: getTimeInSeconds(document.getElementById('editLeftIntroEpisodeStart').value), Start: getTimeInSeconds(document.getElementById('editLeftIntroEpisodeStart').value),
IntroEnd: getTimeInSeconds(document.getElementById('editLeftIntroEpisodeEnd').value) End: getTimeInSeconds(document.getElementById('editLeftIntroEpisodeEnd').value)
}, },
Credits: { Credits: {
IntroStart: getTimeInSeconds(document.getElementById('editLeftCreditEpisodeStart').value), Start: getTimeInSeconds(document.getElementById('editLeftCreditEpisodeStart').value),
IntroEnd: getTimeInSeconds(document.getElementById('editLeftCreditEpisodeEnd').value) End: getTimeInSeconds(document.getElementById('editLeftCreditEpisodeEnd').value)
} }
}; };
const rhsId = selectEpisode2.options[selectEpisode2.selectedIndex].value; const rhsId = selectEpisode2.options[selectEpisode2.selectedIndex].value;
const newRhs = { const newRhs = {
Introduction: { Introduction: {
IntroStart: getTimeInSeconds(document.getElementById('editRightIntroEpisodeStart').value), Start: getTimeInSeconds(document.getElementById('editRightIntroEpisodeStart').value),
IntroEnd: getTimeInSeconds(document.getElementById('editRightIntroEpisodeEnd').value) End: getTimeInSeconds(document.getElementById('editRightIntroEpisodeEnd').value)
}, },
Credits: { Credits: {
IntroStart: getTimeInSeconds(document.getElementById('editRightCreditEpisodeStart').value), Start: getTimeInSeconds(document.getElementById('editRightCreditEpisodeStart').value),
IntroEnd: getTimeInSeconds(document.getElementById('editRightCreditEpisodeEnd').value) End: getTimeInSeconds(document.getElementById('editRightCreditEpisodeEnd').value)
} }
}; };
fetchWithAuth("Episode/" + lhsId + "/Timestamps", "POST", JSON.stringify(newLhs)); fetchWithAuth("Episode/" + lhsId + "/Timestamps", "POST", JSON.stringify(newLhs));