Skip to content

Commit

Permalink
do some more
Browse files Browse the repository at this point in the history
  • Loading branch information
Rathoz committed Oct 15, 2024
1 parent 8f4a4dd commit f235255
Show file tree
Hide file tree
Showing 11 changed files with 31 additions and 100 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ function StarcraftMatchGroupInput.processMatch(match, options)

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

match.games = games
match.opponents = opponents
Expand Down Expand Up @@ -211,20 +211,6 @@ function MatchFunctions.getBestOf(bestofInput)
return bestof
end

---@param match table
---@return table
function MatchFunctions.getLinks(match)
return {
preview = match.preview,
preview2 = match.preview2,
interview = match.interview,
interview2 = match.interview2,
review = match.review,
recap = match.recap,
lrthread = match.lrthread,
}
end

---@param match table
---@param numberOfGames integer
---@return table
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ function StarcraftFfaMatchGroupInput.processMatch(match, options)

match.stream = Streams.processStreams(match)
match.vod = Logic.nilIfEmpty(match.vod)
match.links = BaseMatchFunctions.getLinks(match)
match.links = MatchGroupInputUtil.getLinks(match)

Table.mergeInto(match, MatchGroupInputUtil.getTournamentContext(match))

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ function CustomMatchGroupInput.processMatch(match, options)

match.mode = Opponent.toLegacyMode(opponents[1].type, opponents[2].type)
match.stream = Streams.processStreams(match)
match.links = CustomMatchGroupInput._getLinks(match)
match.links = MatchGroupInputUtil.getLinks(match)

match.games = games
match.opponents = opponents
Expand Down Expand Up @@ -229,23 +229,6 @@ function CustomMatchGroupInput._getMapsAndGame(match)
return match.game or data.game, Logic.emptyOr(mapsInfo, (Json.parse(data.maps)))
end

---@param match table
function CustomMatchGroupInput._getLinks(match)
local links = {}

match.civdraft1 = match.civdraft1 or match.civdraft
for key, value in Table.iter.pairsByPrefix(match, 'civdraft') do
links[key] = 'https://aoe2cm.net/draft/' .. value
end

match.mapdraft1 = match.mapdraft1 or match.mapdraft
for key, value in Table.iter.pairsByPrefix(match, 'mapdraft') do
links[key] = 'https://aoe2cm.net/draft/' .. value
end

return links
end

---@param maps table[]
---@return fun(opponentIndex: integer): integer
function CustomMatchGroupInput.calculateMatchScore(maps)
Expand Down
16 changes: 1 addition & 15 deletions components/match2/wikis/arenafps/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 @@ -142,20 +142,6 @@ function MatchFunctions.calculateMatchScore(maps)
end
end

---@param match table
---@return table
function MatchFunctions.getLinks(match)
return {
preview = match.preview,
quakehistory = match.quakehistory and ('http://www.quakehistory.com/en/matches/' .. match.quakehistory) or nil,
dbstats = match.dbstats and ('https://quakelife.ru/diabotical/stats/matches/?matches=' .. match.dbstats) or nil,
qrindr = match.qrindr and ('https://qrindr.com/match/' .. match.qrindr) or nil,
esl = match.esl and ('https://play.eslgaming.com/match/' .. match.esl) or nil,
pf = match.pf and ('https://www.plusforward.net/quake/post/' .. match.pf) or nil,
stats = match.stats,
}
end

--
-- map related functions
--
Expand Down
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 @@ -137,12 +137,6 @@ function MatchFunctions.calculateMatchScore(maps)
end
end

---@param match table
---@return table
function MatchFunctions.getLinks(match)
return {}
end

---@param match table
---@return table
function MatchFunctions.getExtraData(match)
Expand Down
12 changes: 1 addition & 11 deletions components/match2/wikis/callofduty/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 @@ -135,16 +135,6 @@ function MatchFunctions.getBestOf(match)
return bestof or DEFAULT_BESTOF
end

---@param match table
---@return table
function MatchFunctions.getLinks(match)
return {
reddit = match.reddit and 'https://redd.it/' .. match.reddit or nil,
cdl = match.cdl and 'https://callofdutyleague.com/en-us/match/' .. match.cdl or nil,
breakingpoint = match.breakingpoint and 'https://www.breakingpoint.gg/match/' .. match.breakingpoint or nil,
}
end

---@param match table
---@return table
function MatchFunctions.getExtraData(match)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,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.vod = Logic.emptyOr(match.vod, Variables.varDefault('vod'))

Expand Down Expand Up @@ -162,12 +162,6 @@ function MatchFunctions.calculateMatchScore(maps)
end
end

---@param match table
---@return table
function MatchFunctions.getLinks(match)
return {}
end

--
-- map related functions
--
Expand Down
11 changes: 1 addition & 10 deletions components/match2/wikis/clashroyale/match_group_input_custom.lua
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ local OPPONENT_CONFIG = {
resolveRedirect = true,
pagifyTeamNames = true,
}
local ROYALE_API_PREFIX = 'https://royaleapi.com/'

local CustomMatchGroupInput = {}
local MatchFunctions = {}
Expand Down Expand Up @@ -76,7 +75,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.vod = Logic.nilIfEmpty(match.vod)
match.extradata = MatchFunctions.getExtraData(match, #games)

Expand All @@ -86,14 +85,6 @@ function CustomMatchGroupInput.processMatch(match, options)
return match
end

---@param match table
---@return table
function MatchFunctions.getLinks(match)
return {
royaleapi = match.royaleapi and (ROYALE_API_PREFIX .. match.royaleapi) or nil,
}
end

---@param match table
---@param opponents table[]
---@return table[]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,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.vod = Logic.emptyOr(match.vod, Variables.varDefault('vod'))

Expand Down Expand Up @@ -143,12 +143,6 @@ function MatchFunctions.calculateMatchScore(maps)
end
end

---@param match table
---@return table
function MatchFunctions.getLinks(match)
return {}
end

---@param match table
---@return table
function MatchFunctions.getExtraData(match)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,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 @@ -149,12 +149,6 @@ function MatchFunctions.calculateMatchScore(maps)
end
end

---@param match table
---@return table
function MatchFunctions.getLinks(match)
return {}
end

---@param match table
---@return table
function MatchFunctions.getExtraData(match)
Expand Down
23 changes: 21 additions & 2 deletions standard/links/commons/links.lua
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,9 @@ local PREFIXES = {
['bilibili-stream'] = {'https://live.bilibili.com/'},
booyah = {'https://booyah.live/'},
bracket = {''},
breakingpoint = {match = 'https://www.breakingpoint.gg/match/'},
cc = {'https://cc.163.com/'},
cdl = {match = 'https://callofdutyleague.com/en-us/match/'},
challengermode = {
'https://www.challengermode.com/tournaments/',
player = 'https://www.challengermode.com/users/',
Expand All @@ -58,6 +60,7 @@ local PREFIXES = {
player = 'https://challonge.com/users/',
},
chzzk = {'https://chzzk.naver.com/live/'},
civdraft = {match = 'https://aoe2cm.net/draft/'},
cntft = {'https://lol.qq.com/tft/#/masterDetail/'},
corestrike = {'https://corestrike.gg/lookup/'},
cfs = {'https://www.crossfirestars.com/'},
Expand All @@ -67,6 +70,7 @@ local PREFIXES = {
team = 'https://www.datdota.com/teams/'
},
daumcafe = {'http://cafe.daum.net/'},
dbstats = {match = 'https://quakelife.ru/diabotical/stats/matches/?matches='},
discord = {'https://discord.gg/'},
dlive = {'https://www.dlive.tv/'},
dotabuff = {
Expand Down Expand Up @@ -124,6 +128,7 @@ local PREFIXES = {
huyatv = {'https://www.huya.com/'},
iccup = {'http://www.iccup.com/starcraft/gamingprofile/'},
instagram = {'https://www.instagram.com/'},
interview = {''},
kick = {'https://www.kick.com/'},
kuaishou = {'https://live.kuaishou.com/u/'},
['letsplaylive-old'] = {
Expand All @@ -140,6 +145,8 @@ local PREFIXES = {
linkedin = {'https://www.linkedin.com/in/'},
loco = {'https://loco.gg/streamers/'},
lolchess = {'https://lolchess.gg/profile/'},
lrthread = {''},
mapdraft = {match = 'https://aoe2cm.net/draft/'},
matcherino = {'https://matcherino.com/tournaments/'},
matcherinolink = {'https://matcherino.com/t/'},
mildom = {'https://www.mildom.com/'},
Expand All @@ -159,19 +166,31 @@ local PREFIXES = {
player = 'https://osu.ppy.sh/users/',
},
patreon = {'https://www.patreon.com/'},
pf = {match = 'https://www.plusforward.net/quake/post/'},
playlist = {''},
preview = {''},
qrindr = {match = 'https://qrindr.com/match/'},
quakehistory = {match = 'http://www.quakehistory.com/en/matches/'},
r6esports = {
match = 'https://www.ubisoft.com/en-us/esports/rainbow-six/siege/match/',
},
reddit = {'https://www.reddit.com/user/'},
reddit = {
'https://www.reddit.com/user/',
match = 'https://redd.it/',
},
replay = {''},
recap = {''},
review = {''},
rgl = {
'https://rgl.gg/Public/LeagueTable?s=',
team = 'https://rgl.gg/Public/Team?t=',
player = 'https://rgl.gg/Public/PlayerProfile?p=',
},
rooter = {'https://rooter.gg/'},
royaleapi = {'https://royaleapi.com/player/'},
royaleapi = {
'https://royaleapi.com/player/',
match = 'https://royaleapi.com/'
},
rules = {''},
shift = {'https://www.shiftrle.gg/events/'},
siegegg = {
Expand Down

0 comments on commit f235255

Please sign in to comment.