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:
+16
-9
@@ -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
|
||||
|
||||
-- Обновить статус
|
||||
|
||||
Reference in New Issue
Block a user