local s=3600 function calculateShowTimes()local I=nil local c=nil local M=(DateTime.now()).UnixTimestampMillis/1000 local e=FIRST_EVER_SHOW-M if e>0 then I=e else I=e%s c=s-I end return I,c end function loadPreShowVenue()local s,I=calculateShowTimes()PSV_SCENE:SetAttribute("\084\105\109\101\076\101\110\103\116\104",s)EventSequencer.loadScene(PSV_SCENE.Name)end

local RESHOWING_FREQUENCY = 60*60


function calculateShowTimes()
	local timeUntilNextShow = nil
	local timeIntoShow = nil
	local currentTime = DateTime.now().UnixTimestampMillis/1000
	local timeUntilFirstShow = FIRST_EVER_SHOW - currentTime
	if timeUntilFirstShow > 0 then
		timeUntilNextShow = timeUntilFirstShow
	else
		timeUntilNextShow = timeUntilFirstShow % RESHOWING_FREQUENCY
		timeIntoShow = RESHOWING_FREQUENCY - timeUntilNextShow
	end
	return timeUntilNextShow, timeIntoShow
end


function loadPreShowVenue()
	-- The PreShowVenue scene length needs to be adjusted to match the time until the next show.
	local timeUntilNextShow, timeIntoShow = calculateShowTimes()
	PSV_SCENE:SetAttribute("TimeLength", timeUntilNextShow)
	EventSequencer.loadScene(PSV_SCENE.Name)
end

