Skip to content

Commit

Permalink
Add game vods
Browse files Browse the repository at this point in the history
  • Loading branch information
Rathoz committed Sep 21, 2023
1 parent b8d304e commit 7e404ac
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions components/match2/wikis/apexlegends/match_summary.lua
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ local Ordinal = require('Module:Ordinal')
local Page = require('Module:Page')
local Table = require('Module:Table')
local Timezone = require('Module:Timezone')
local VodLink = require('Module:VodLink')

local MatchGroupUtil = Lua.import('Module:MatchGroup/Util', {requireDevIfEnabled = true})
local OpponentLibraries = require('Module:OpponentLibraries')
Expand Down Expand Up @@ -409,19 +410,21 @@ function CustomMatchSummary._countdownIcon(game)
end

function CustomMatchSummary._gameCountdown(game)
--- TODO Add VOD for completed games
local timestamp = Date.readTimestamp(game.date)
if not timestamp then
return
end
-- TODO Use local TZ
local dateString = Date.formatTimestamp('F j, Y - H:i', timestamp) .. ' ' .. Timezone.getTimezoneString('UTC')

local stream = Table.merge(game.stream, {
date = dateString,
finished = game.finished and 'true' or nil,
finished = CustomMatchSummary._isFinished and 'true' or nil,
})

return mw.html.create('div'):addClass('panel-content__game-schedule__countdown'):addClass('match-countdown-block')
:node(require('Module:Countdown')._create(stream))
:node(require('Module:Countdown')._create(stream))
:node(game.vod and VodLink.display{vod = game.vod} or nil)
end

---@param placementStart string|number|nil
Expand Down

0 comments on commit 7e404ac

Please sign in to comment.