1
0
mirror of https://github.com/algora-io/tv.git synced 2025-03-17 20:17:45 +02:00

fix(bug): allow index to load when there are no ads (#89)

This commit is contained in:
Paulo Daniel Gonzalez 2024-09-15 05:27:22 -05:00 committed by GitHub
parent 816781021c
commit bf8c6ac49c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -159,6 +159,10 @@ defmodule Algora.Ads do
|> Repo.insert()
end
def get_current_index([]) do
0
end
def get_current_index(ads) do
:os.system_time(:millisecond)
|> div(rotation_interval())