media: remove extra 1s play-time

it was made by original author, idk why.
in result we were getting tracks to be starting all over again for 1-2 seconds, sometimes.

now is all good
This commit is contained in:
Sattva
2025-05-20 10:14:21 +03:00
parent e875e4a6cc
commit 0ffd48db48
+16 -9
View File
@@ -15699,15 +15699,22 @@ function LeaPlusLC:RunOnce()
LeaPlusLC.TrackTimer:Cancel()
end
if trackTime then
LeaPlusLC.TrackTimer = LibCompat.NewTimer(trackTime + 1, function()
-- Automatic mark track after listened fully
MarkCurrentTrackListened()
StopMusic()
if tracknumber > #playlist then
tracknumber = 1
end
PlayTrack()
end)
-- Convert trackTime (which is a string) to a number before using it
local numericTrackTime = tonumber(trackTime)
if numericTrackTime then -- Ensure conversion was successful
LeaPlusLC.TrackTimer = LibCompat.NewTimer(numericTrackTime, function()
-- Automatic mark track after listened fully
MarkCurrentTrackListened()
StopMusic()
if tracknumber > #playlist then
tracknumber = 1
end
PlayTrack()
end)
else
-- Handle case where trackTime couldn't be converted (optional, for robustness)
-- LeaPlusLC:Print("Error: Invalid trackTime format for " .. LastPlayed)
end
end
-- Обновить статус