mirror of
https://github.com/Jerryplusy/rc-plugin.git
synced 2025-10-14 16:19:18 +00:00
🐞 fix: 修复油管解析时间显示的问题
This commit is contained in:
parent
e05f7d2901
commit
f48da3b91f
@ -30,9 +30,15 @@ export function removeParams(url) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function convertToSeconds(timeStr) {
|
export function convertToSeconds(timeStr) {
|
||||||
const [hour, minutes, seconds] = timeStr.split(':').map(Number); // 拆分并转换为数字
|
const parts = timeStr.split(':').map(Number);
|
||||||
if (!seconds) return timeStr;
|
if (parts.length === 2) {
|
||||||
return hour * 3600 + minutes * 60 + seconds; // 分钟转化为秒并加上秒数
|
const [minutes, seconds] = parts;
|
||||||
|
return minutes * 60 + seconds;
|
||||||
|
} else if (parts.length === 3) {
|
||||||
|
const [hours, minutes, seconds] = parts;
|
||||||
|
return hours * 3600 + minutes * 60 + seconds;
|
||||||
|
}
|
||||||
|
return timeStr;
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function autoSelectMusicOrVideoSend() {
|
export async function autoSelectMusicOrVideoSend() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user