diff --git a/components/match2/commons/match.lua b/components/match2/commons/match.lua index efdc52ef1b5..aa6273479cf 100644 --- a/components/match2/commons/match.lua +++ b/components/match2/commons/match.lua @@ -322,6 +322,8 @@ end ---@param match table function Match._prepareMatchRecordForStore(match) + match.links = match.links or {} + match.vod = match.vod or match.links.vod match.dateexact = Logic.readBool(match.dateexact) and 1 or 0 match.finished = Logic.readBool(match.finished) and 1 or 0 match.match2bracketdata = match.match2bracketdata or match.bracketdata diff --git a/components/match2/commons/match_group_display_helper.lua b/components/match2/commons/match_group_display_helper.lua index c82f4aaf903..5f08ee1ab6a 100644 --- a/components/match2/commons/match_group_display_helper.lua +++ b/components/match2/commons/match_group_display_helper.lua @@ -88,8 +88,7 @@ components. function DisplayHelper.defaultMatchHasDetails(match) return match.dateIsExact or (match.timestamp and match.timestamp ~= Date.defaultTimestamp) - or Logic.isNotEmpty(match.vod) - or not Table.isEmpty(match.links) + or Table.isNotEmpty(match.links) or Logic.isNotEmpty(match.comment) or 0 < #match.games end diff --git a/components/match2/commons/match_group_util.lua b/components/match2/commons/match_group_util.lua index 39ffb965d7a..1cf801c01c5 100644 --- a/components/match2/commons/match_group_util.lua +++ b/components/match2/commons/match_group_util.lua @@ -535,7 +535,6 @@ function MatchGroupUtil.matchFromRecord(record) timestamp = tonumber(Table.extract(extradata, 'timestamp')), tournament = record.tournament, type = nilIfEmpty(record.type) or 'literal', - vod = nilIfEmpty(record.vod), walkover = walkover and walkover:lower() or nil, winner = tonumber(record.winner), } diff --git a/components/match2/commons/match_summary_base.lua b/components/match2/commons/match_summary_base.lua index 8363a66e29d..bcbbdbefa5a 100644 --- a/components/match2/commons/match_summary_base.lua +++ b/components/match2/commons/match_summary_base.lua @@ -636,12 +636,6 @@ end ---@param footer MatchSummaryFooter ---@return MatchSummaryFooter function MatchSummary.addVodsToFooter(match, footer) - if match.vod then - footer:addElement(VodLink.display{ - vod = match.vod, - }) - end - for gameIndex, game in ipairs(match.games) do if game.vod then footer:addElement(VodLink.display{ diff --git a/components/match2/commons/starcraft_starcraft2/match_group_input_starcraft.lua b/components/match2/commons/starcraft_starcraft2/match_group_input_starcraft.lua index 14feb3c18bb..639d1838e98 100644 --- a/components/match2/commons/starcraft_starcraft2/match_group_input_starcraft.lua +++ b/components/match2/commons/starcraft_starcraft2/match_group_input_starcraft.lua @@ -91,7 +91,6 @@ function StarcraftMatchGroupInput.processMatch(match, options) Table.mergeInto(match, MatchGroupInputUtil.getTournamentContext(match)) match.stream = Streams.processStreams(match) - match.vod = Logic.nilIfEmpty(match.vod) match.games = games match.opponents = opponents diff --git a/components/match2/commons/starcraft_starcraft2/match_group_input_starcraft_ffa.lua b/components/match2/commons/starcraft_starcraft2/match_group_input_starcraft_ffa.lua index 974356de116..f6fa0691534 100644 --- a/components/match2/commons/starcraft_starcraft2/match_group_input_starcraft_ffa.lua +++ b/components/match2/commons/starcraft_starcraft2/match_group_input_starcraft_ffa.lua @@ -48,7 +48,6 @@ function StarcraftFfaMatchGroupInput.processMatch(match, options) match.links = MatchGroupInputUtil.getLinks(match) match.stream = Streams.processStreams(match) - match.vod = Logic.nilIfEmpty(match.vod) Table.mergeInto(match, MatchGroupInputUtil.getTournamentContext(match)) diff --git a/components/match2/commons/starcraft_starcraft2/match_group_util_starcraft.lua b/components/match2/commons/starcraft_starcraft2/match_group_util_starcraft.lua index df5ec01b7de..902b44606c7 100644 --- a/components/match2/commons/starcraft_starcraft2/match_group_util_starcraft.lua +++ b/components/match2/commons/starcraft_starcraft2/match_group_util_starcraft.lua @@ -332,8 +332,7 @@ function StarcraftMatchGroupUtil.matchHasDetails(match) return key ~= 'headtohead' end) return match.dateIsExact - or String.isNotEmpty(match.vod) - or not Table.isEmpty(linksWithoutH2H) + or Table.isNotEmpty(linksWithoutH2H) or String.isNotEmpty(match.comment) or String.isNotEmpty(match.casters) or 0 < #match.vetoes diff --git a/components/match2/wikis/ageofempires/match_legacy.lua b/components/match2/wikis/ageofempires/match_legacy.lua index d60f5225dd4..aec1766101b 100644 --- a/components/match2/wikis/ageofempires/match_legacy.lua +++ b/components/match2/wikis/ageofempires/match_legacy.lua @@ -39,7 +39,7 @@ function MatchLegacy.storeGames(match, match2) game.extradata.gamenumber = gameIndex game.extradata.mapmode = game2.extradata.mapmode game.extradata.tournament = match.tournament - game.extradata.vodmatch = match.vod + game.extradata.vodmatch = match.links.vod if game.mode == 'team' then Array.forEach(opponents, function(opponent, opponentIndex) -- opponent.players can have gaps diff --git a/components/match2/wikis/counterstrike/match_summary.lua b/components/match2/wikis/counterstrike/match_summary.lua index c6bd5e22267..014bd2e8f92 100644 --- a/components/match2/wikis/counterstrike/match_summary.lua +++ b/components/match2/wikis/counterstrike/match_summary.lua @@ -168,7 +168,7 @@ function CustomMatchSummary.addToFooter(match, footer) end end - if not Table.isEmpty(vods) or not Table.isEmpty(match.links) or not Logic.isEmpty(match.vod) then + if not Table.isEmpty(vods) or not Table.isEmpty(match.links) then return CustomMatchSummary._createFooter(match, vods, secondVods) end @@ -255,12 +255,12 @@ function CustomMatchSummary._createFooter(match, vods, secondVods) -- Match vod if Table.isNotEmpty(secondVods[0]) then - addVodLink(nil, match.vod, 1) + addVodLink(nil, match.links.vod, 1) Array.forEach(secondVods[0], function(vodlink, vodindex) addVodLink(nil, vodlink, vodindex + 1) end) else - addVodLink(nil, match.vod, nil) + addVodLink(nil, match.links.vod, nil) end -- Game Vods @@ -276,7 +276,7 @@ function CustomMatchSummary._createFooter(match, vods, secondVods) end if Table.isNotEmpty(match.links) then - if Logic.isNotEmpty(vods) or match.vod then + if Logic.isNotEmpty(vods) or match.links.vod then footer:addElement(separator) end else diff --git a/components/match2/wikis/criticalops/match_group_input_custom.lua b/components/match2/wikis/criticalops/match_group_input_custom.lua index 2166274e046..39a2db82377 100644 --- a/components/match2/wikis/criticalops/match_group_input_custom.lua +++ b/components/match2/wikis/criticalops/match_group_input_custom.lua @@ -76,8 +76,6 @@ function CustomMatchGroupInput.processMatch(match, options) match.stream = Streams.processStreams(match) - match.vod = Logic.emptyOr(match.vod, Variables.varDefault('vod')) - match.games = games match.opponents = opponents diff --git a/components/match2/wikis/fighters/brkts_wiki_specific.lua b/components/match2/wikis/fighters/brkts_wiki_specific.lua index f8bc6ae1b66..495a25f52f8 100644 --- a/components/match2/wikis/fighters/brkts_wiki_specific.lua +++ b/components/match2/wikis/fighters/brkts_wiki_specific.lua @@ -19,8 +19,7 @@ local WikiSpecific = Table.copy(BaseWikiSpecific) ---@return boolean function WikiSpecific.matchHasDetails(match) return match.dateIsExact - or Logic.isNotEmpty(match.vod) - or not Table.isEmpty(match.links) + or Table.isNotEmpty(match.links) or Logic.isNotEmpty(match.comment) or 0 < #match.games end diff --git a/components/match2/wikis/warcraft/brkts_wiki_specific.lua b/components/match2/wikis/warcraft/brkts_wiki_specific.lua index 8866d35f830..f731052f934 100644 --- a/components/match2/wikis/warcraft/brkts_wiki_specific.lua +++ b/components/match2/wikis/warcraft/brkts_wiki_specific.lua @@ -24,8 +24,7 @@ end) ---@return boolean function WikiSpecific.matchHasDetails(match) return match.dateIsExact - or match.vod - or not Table.isEmpty(match.links) + or Table.isNotEmpty(match.links) or match.comment or match.casters or 0 < #match.vetoes diff --git a/components/match_table/commons/match_table.lua b/components/match_table/commons/match_table.lua index 255243b7ae3..662f74f95b8 100644 --- a/components/match_table/commons/match_table.lua +++ b/components/match_table/commons/match_table.lua @@ -417,8 +417,8 @@ end ---@return {index: number, link: string}[] function MatchTable:vodsFromRecord(record) local vods = {} - if String.nilIfEmpty(record.vod) then - vods = {{index = 0, link = record.vod}} + if String.nilIfEmpty(record.links.vod) then + vods = {{index = 0, link = record.links.vod}} end Array.forEach(record.match2games, function(game, gameIndex) diff --git a/components/match_ticker/commons/match_ticker_display_components.lua b/components/match_ticker/commons/match_ticker_display_components.lua index 2d632bd0e5c..5aecb200872 100644 --- a/components/match_ticker/commons/match_ticker_display_components.lua +++ b/components/match_ticker/commons/match_ticker_display_components.lua @@ -311,7 +311,7 @@ function Details:countdown(matchPageIcon) local gameVods = Array.map(Array.map(match.match2games, Operator.property('vod')), makeVod) - countdownDisplay:node(makeVod(match.vod)) + countdownDisplay:node(makeVod(match.links.vod)) Array.forEach(gameVods, function(vod) countdownDisplay:node(vod) end) diff --git a/standard/links/commons/links.lua b/standard/links/commons/links.lua index b0a70b5bdc5..1842683fa5e 100644 --- a/standard/links/commons/links.lua +++ b/standard/links/commons/links.lua @@ -284,7 +284,7 @@ local PREFIXES = { player = 'https://www.vlr.gg/player/', match = 'https://vlr.gg/', }, - vod = {''}, + vod = {'', match = ''}, weibo = {'https://weibo.com/'}, wl = {match = 'https://www.winstonslab.com/matches/match.php?id='}, yandexefir = {'https://yandex.ru/efir?stream_channel='}, @@ -533,6 +533,10 @@ local MATCH_ICONS = { icon = 'File:Teamfortress.tv.png', text = 'TFTV Match Page' }, + vod = { + icon = 'File:VOD Icon.png', + text = 'Watch VOD' + }, vlr = { icon = 'File:VLR icon.png', text = 'Matchpage and Stats on VLR'