Skip to content

Commit

Permalink
finish rest
Browse files Browse the repository at this point in the history
  • Loading branch information
Rathoz committed Oct 15, 2024
1 parent 07a9bb7 commit 6a0aa78
Show file tree
Hide file tree
Showing 13 changed files with 89 additions and 112 deletions.
15 changes: 6 additions & 9 deletions components/match2/wikis/dota2/match_group_input_custom.lua
Original file line number Diff line number Diff line change
Expand Up @@ -178,15 +178,12 @@ end
---@param games table[]
---@return table
function MatchFunctions.getLinks(match, games)
local links = {
preview = match.preview,
lrthread = match.lrthread,
recap = match.recap,
faceit = match.faceit and 'https://www.faceit.com/en/dota2/room/' .. match.faceit or nil,
stratz = {},
dotabuff = {},
datdota = {},
}
---@type table<string, string|table>
local links = MatchGroupInputUtil.getLinks(match)
links.stratz = {}
links.dotabuff = {}
links.datdota = {}

Array.forEach(
Array.filter(games, function(map) return map.publisherid ~= nil end),
function(map, mapIndex)
Expand Down
12 changes: 1 addition & 11 deletions components/match2/wikis/halo/match_group_input_custom.lua
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ function CustomMatchGroupInput.processMatch(match, options)
Table.mergeInto(match, MatchGroupInputUtil.getTournamentContext(match))

match.stream = Streams.processStreams(match)
match.links = MatchFunctions.getLinks(match)
match.links = MatchGroupInputUtil.getLinks(match)

match.games = games
match.opponents = opponents
Expand Down Expand Up @@ -144,16 +144,6 @@ function MatchFunctions.calculateMatchScore(maps)
end
end

---@param match table
---@return table
function MatchFunctions.getLinks(match)
return {
faceit = match.faceit and ('https://www.faceit.com/en/halo_infinite/room/' .. match.faceit) or nil,
halodatahive = match.halodatahive and ('https://halodatahive.com/Series/Summary/' .. match.halodatahive) or nil,
stats = match.stats,
}
end

---@param match table
---@return table
function MatchFunctions.getExtraData(match)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ function CustomMatchGroupInput.processMatchWithoutStandalone(MatchParser, match)
Table.mergeInto(match, MatchGroupInputUtil.getTournamentContext(match))

match.stream = Streams.processStreams(match)
match.links = MatchFunctions.getLinks(match)
match.links = MatchGroupInputUtil.getLinks(match)

match.games = games
match.opponents = opponents
Expand Down Expand Up @@ -168,16 +168,6 @@ function MatchFunctions.calculateMatchScore(maps)
end
end

---@param match table
---@return table
function MatchFunctions.getLinks(match)
return {
reddit = match.reddit and 'https://redd.it/' .. match.reddit or nil,
gol = match.gol and 'https://gol.gg/game/stats/' .. match.gol .. '/page-game/' or nil,
factor = match.factor and 'https://www.factor.gg/match/' .. match.factor or nil,
}
end

---@param match table
---@return table
function MatchFunctions.getExtraData(match)
Expand Down
14 changes: 1 addition & 13 deletions components/match2/wikis/osu/match_group_input_custom.lua
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ function CustomMatchGroupInput.processMatch(match, options)
Table.mergeInto(match, MatchGroupInputUtil.getTournamentContext(match))

match.stream = Streams.processStreams(match)
match.links = MatchFunctions.getLinks(match)
match.links = MatchGroupInputUtil.getLinks(match)

match.games = games
match.opponents = opponents
Expand Down Expand Up @@ -150,18 +150,6 @@ function MatchFunctions.calculateMatchScore(maps)
end
end

---@param match table
---@return table
function MatchFunctions.getLinks(match)
local links = {preview = match.preview}

for key, linkPart in Table.iter.pairsByPrefix(match, 'mplink', {requireIndex = false}) do
links[key] = 'https://osu.ppy.sh/community/matches/' .. linkPart
end

return links
end

---@param match table
---@return table
function MatchFunctions.getExtraData(match)
Expand Down
17 changes: 1 addition & 16 deletions components/match2/wikis/overwatch/match_group_input_custom.lua
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ function CustomMatchGroupInput.processMatch(match, options)
Table.mergeInto(match, MatchGroupInputUtil.getTournamentContext(match))

match.stream = Streams.processStreams(match)
match.links = MatchFunctions.getLinks(match)
match.links = MatchGroupInputUtil.getLinks(match)

match.games = games
match.opponents = opponents
Expand Down Expand Up @@ -139,21 +139,6 @@ function MatchFunctions.getBestOf(match)
return bestof or DEFAULT_BESTOF
end

---@param match table
---@return table
function MatchFunctions.getLinks(match)
return {
owl = match.owl and 'https://web.archive.org/web/overwatchleague.com/en-us/match/' .. match.owl or nil,
jcg = match.jcg and 'https://web.archive.org/web/ow.j-cg.com/compe/view/match/' .. match.jcg or nil,
tespa = match.tespa and 'https://web.archive.org/web/compete.tespa.org/tournament/' .. match.tespa or nil,
overgg = match.overgg and 'http://www.over.gg/' .. match.overgg or nil,
pf = match.pf and 'http://www.plusforward.net/overwatch/post/' .. match.pf or nil,
wl = match.wl and 'https://www.winstonslab.com/matches/match.php?id=' .. match.wl or nil,
faceit = match.faceit and 'https://www.faceit.com/en/ow2/room/' .. match.faceit or nil,
stats = match.stats,
}
end

---@param match table
---@return table
function MatchFunctions.getExtraData(match)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ function CustomMatchGroupInput.processMatch(match, options)
Table.mergeInto(match, MatchGroupInputUtil.getTournamentContext(match))

match.stream = Streams.processStreams(match)
match.links = MatchFunctions.getLinks(match)
match.links = MatchGroupInputUtil.getLinks(match)

match.games = games
match.opponents = opponents
Expand Down Expand Up @@ -194,24 +194,6 @@ function MatchFunctions._checkForNonEmptyOpponent(opponent)
return not Opponent.isTbd(opponent)
end

---@param match table
---@return table
function MatchFunctions.getLinks(match)
local links = {}

-- Shift (formerly Octane)
for key, shift in Table.iter.pairsByPrefix(match, 'shift', {requireIndex = false}) do
links[key] = 'https://www.shiftrle.gg/matches/' .. shift
end

-- Ballchasing
for key, ballchasing in Table.iter.pairsByPrefix(match, 'ballchasing', {requireIndex = false}) do
links[key] = 'https://ballchasing.com/group/' .. ballchasing
end

return links
end

---@param opponents table[]
---@param tier integer?
---@return boolean
Expand Down
11 changes: 1 addition & 10 deletions components/match2/wikis/smite/match_group_input_custom.lua
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ function CustomMatchGroupInput.processMatch(match, options)
Table.mergeInto(match, MatchGroupInputUtil.getTournamentContext(match))

match.stream = Streams.processStreams(match)
match.links = MatchFunctions.getLinks(match)
match.links = MatchGroupInputUtil.getLinks(match)

match.games = games
match.opponents = opponents
Expand Down Expand Up @@ -126,15 +126,6 @@ function MatchFunctions.calculateMatchScore(maps)
end
end

---@param match table
---@return table
function MatchFunctions.getLinks(match)
return {
stats = match.stats,
smiteesports = match.smiteesports and ('https://www.smiteesports.com/matches/' .. match.smiteesports) or nil,
}
end

---@param match table
---@return table
function MatchFunctions.getExtraData(match)
Expand Down
14 changes: 4 additions & 10 deletions components/match2/wikis/teamfortress/match_group_input_custom.lua
Original file line number Diff line number Diff line change
Expand Up @@ -129,16 +129,10 @@ end
---@param games table[]
---@return table
function MatchFunctions.getLinks(match, games)
local links = {
rgl = match.rgl and 'https://rgl.gg/Public/Match.aspx?m=' .. match.rgl or nil,
ozf = match.ozf and 'https://warzone.ozfortress.com/matches/' .. match.ozf or nil,
etf2l = match.etf2l and 'http://etf2l.org/matches/' .. match.etf2l or nil,
tftv = match.tftv and'http://tf.gg/' .. match.tftv or nil,
esl = match.esl and 'https://play.eslgaming.com/match/' .. match.esl or nil,
esea = match.esea and 'https://play.esea.net/match/' .. match.esea or nil,
logstf = {},
logstfgold = {},
}
---@type table<string, string|table>
local links = MatchGroupInputUtil.getLinks(match)
links.logstf = {}
links.logstfgold = {}

Array.forEach(games or {}, function(game, gameIndex)
links.logstf[gameIndex] = game.logstf and ('https://logs.tf/' .. game.logstf) or nil
Expand Down
10 changes: 1 addition & 9 deletions components/match2/wikis/valorant/match_group_input_custom.lua
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ function CustomMatchGroupInput.processMatch(match, options)
Table.mergeInto(match, MatchGroupInputUtil.getTournamentContext(match))

match.stream = Streams.processStreams(match)
match.links = MatchFunctions.getLinks(match)
match.links = MatchGroupInputUtil.getLinks(match)

match.games = games
match.opponents = opponents
Expand Down Expand Up @@ -139,14 +139,6 @@ function MatchFunctions.calculateMatchScore(maps)
end
end

---@param match table
---@return table
function MatchFunctions.getLinks(match)
return {
vlr = match.vlr and 'https://vlr.gg/' .. match.vlr or nil,
}
end

---@param match table
---@return table
function MatchFunctions.getExtraData(match)
Expand Down
31 changes: 28 additions & 3 deletions standard/links/commons/links.lua
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ local PREFIXES = {
player = 'https://www.b5csgo.com/personalCenter/',
team = 'https://www.b5csgo.com/clan/'
},
ballchasing = {
match = 'https://ballchasing.com/group/',
},
battlefy = {'https://www.battlefy.com/'},
bilibili = {
'https://space.bilibili.com/',
Expand Down Expand Up @@ -85,7 +88,8 @@ local PREFIXES = {
esea = {
'https://play.esea.net/events/',
player = 'https://play.esea.net/users/',
team = 'https://play.esea.net/teams/'
team = 'https://play.esea.net/teams/',
match = 'https://play.esea.net/match/',
},
['esea-d'] = {'https://play.esea.net/league/standings?divisionId='},
esl = {
Expand All @@ -99,6 +103,7 @@ local PREFIXES = {
'',
team = 'https://etf2l.org/teams/',
player = 'https://etf2l.org/forum/user/',
match = 'https://etf2l.org/matches/',
},
facebook = {'https://facebook.com/'},
['facebook-gaming'] = {'https://fb.gg/'},
Expand All @@ -110,14 +115,17 @@ local PREFIXES = {
['faceit-c'] = {'https://www.faceit.com/en/championship/'},
['faceit-hub'] = {'https://www.faceit.com/en/hub/'},
['faceit-org'] = {'https://www.faceit.com/en/organizers/'},
factor = {match = 'https://www.factor.gg/match/'},
fanclub = {''},
geoguessr = {'https://www.geoguessr.com/'},
gol = {match = 'https://gol.gg/game/stats/'},
gosugamers = {''},
gplus = {'http://plus.google.com/-plus'},
halodatahive = {
'https://halodatahive.com/Tournament/Detail/',
team = 'https://halodatahive.com/Team/Detail/',
player = 'https://halodatahive.com/Player/Detail/',
match = 'https://halodatahive.com/Series/Summary/',
},
home = {''},
haojiao = {
Expand All @@ -129,6 +137,7 @@ local PREFIXES = {
iccup = {'http://www.iccup.com/starcraft/gamingprofile/'},
instagram = {'https://www.instagram.com/'},
interview = {''},
jcg = {match = 'https://web.archive.org/web/ow.j-cg.com/compe/view/match/'},
kick = {'https://www.kick.com/'},
kuaishou = {'https://live.kuaishou.com/u/'},
['letsplaylive-old'] = {
Expand All @@ -150,6 +159,7 @@ local PREFIXES = {
matcherino = {'https://matcherino.com/tournaments/'},
matcherinolink = {'https://matcherino.com/t/'},
mildom = {'https://www.mildom.com/'},
mplink = {match = 'https://osu.ppy.sh/community/matches/'}, -- Should this key be renamed?
niconico = {'https://www.nicovideo.jp/'},
nimotv = {'https://www.nimo.tv/'},
['nwc3l'] = {
Expand All @@ -165,6 +175,11 @@ local PREFIXES = {
'https://osu.ppy.sh/',
player = 'https://osu.ppy.sh/users/',
},
overgg = {match = 'https://www.over.gg/'},
owl = {
match = 'https://web.archive.org/web/overwatchleague.com/en-us/match/',
},
ozf = {match = 'https://warzone.ozfortress.com/matches/'},
patreon = {'https://www.patreon.com/'},
pf = {match = 'https://www.plusforward.net/quake/post/'},
playlist = {''},
Expand All @@ -185,14 +200,18 @@ local PREFIXES = {
'https://rgl.gg/Public/LeagueTable?s=',
team = 'https://rgl.gg/Public/Team?t=',
player = 'https://rgl.gg/Public/PlayerProfile?p=',
match = 'https://rgl.gg/Public/Match.aspx?m=',
},
rooter = {'https://rooter.gg/'},
royaleapi = {
'https://royaleapi.com/player/',
match = 'https://royaleapi.com/'
},
rules = {''},
shift = {'https://www.shiftrle.gg/events/'},
shift = {
'https://www.shiftrle.gg/events/',
match = 'https://www.shiftrle.gg/matches/',
},
siegegg = {
'https://siege.gg/competitions/',
team = 'https://siege.gg/teams/',
Expand All @@ -213,6 +232,7 @@ local PREFIXES = {
strikr = {'https://strikr.pro/pilot/'},
privsteam = {'https://steamcommunity.com/groups/'},
pubsteam = {'https://steamcommunity.com/groups/'},
smiteesports = {match = 'https://www.smiteesports.com/matches/'},
spotify = {'https://open.spotify.com/'},
steamalternative = {'https://steamcommunity.com/profiles/'},
stats = {''},
Expand All @@ -223,9 +243,11 @@ local PREFIXES = {
},
stream = {''},
telegram = {'https://t.me/'},
tespa = {match = 'https://web.archive.org/web/compete.tespa.org/tournament/'},
tftv = {
'https://www.teamfortress.tv/',
player = 'https://www.teamfortress.tv/user/',
match = 'http://tf.gg/',
},
tiktok = {'https://tiktok.com/@'},
tlpd = {''},
Expand Down Expand Up @@ -260,10 +282,12 @@ local PREFIXES = {
vlr = {
'https://www.vlr.gg/event/',
team = 'https://www.vlr.gg/team/',
player = 'https://www.vlr.gg/player/'
player = 'https://www.vlr.gg/player/',
match = 'https://vlr.gg/',
},
vod = {''},
weibo = {'https://weibo.com/'},
wl = {match = 'https://www.winstonslab.com/matches/match.php?id='},
yandexefir = {'https://yandex.ru/efir?stream_channel='},
youtube = {'https://www.youtube.com/'},
zhangyutv = {'http://www.zhangyu.tv/'},
Expand All @@ -279,6 +303,7 @@ local SUFFIXES = {
'',
stream = '/live',
},
gol = {match = '/page-game/'},
iccup = {'.html'},
['faceit-c'] = {'/'},
['faceit-hub'] = {'/'},
Expand Down
18 changes: 18 additions & 0 deletions standard/links/wikis/dota2/links_custom_data.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
-- @Liquipedia
-- wiki=dota2
-- page=Module:Links/CustomData
--
-- Please see https://github.com/Liquipedia/Lua-Modules to contribute
--

return {
prefixes = {
faceit = {
'',
team = 'https://www.faceit.com/en/teams/',
player = 'https://www.faceit.com/en/players/',
match = 'https://www.faceit.com/en/dota2/room/',
},
}
}
Loading

0 comments on commit 6a0aa78

Please sign in to comment.