Repository navigation
feat: Add DurationStats module to the GitHub - #8242
steve020607 wants to merge 10 commits into
Conversation
|
tested and works fine probably can make it to an args to show the Shortest only or Longest only |
Fwiw I was the original creator of the module, later ported over to ML wiki. Haven't had time to look at it through again, but I didn't port it to Github because there was a few features that were requested and on my TODO:
|
ough i guess it's on another wiki copy paste, my bad. Edit: Not Much diffirent |
why not just use the 'Results' if there's no match.extradata.section?
so liked average time of all of the matches? or per section(the Longest and the Shortest have their own average time)
|
Also works, but I removed it later due to it looking a bit strange (especially for double elimination, which result is result?)
Ideally of all matches
Someone should correct me if there is a module for it, but I see in other game history Module code they use something like |
so the current pr is good already, default if no match.extradata.section is 'Results'
quite thinking how can we put it? create another table?
that could work, probably need a reworked for the code also put a space after the >>, if not it will blend with the top |
| ---@param order string | ||
| ---@return match2game[] | ||
| function Games.fetch(conditions, limit, order) | ||
| return mw.ext.LiquipediaDB.lpdb('match2game', { |
There was a problem hiding this comment.
could potentially use Lpdb.executeMassQuery
| args.edate and ConditionNode(ColumnName('date'), Comparator.le, args.edate) or nil | ||
| )) | ||
|
|
||
| local matches = mw.ext.LiquipediaDB.lpdb('match2', { |
There was a problem hiding this comment.
possibly Lpdb.executeMassQuery
| local Logic = Lua.import('Module:Logic') | ||
| local OpponentDisplay = Lua.import('Module:OpponentDisplay/Custom') | ||
|
|
||
| local Util = Lua.import('Module:Features/DurationStats/Lib/Util') |
There was a problem hiding this comment.
components should not import lib modules
rather import them in controller and pass the necessary function from controller to the function that gets called from here
or do the necessary call in controller and pass the result to the component
|
|
||
| ---@param match MatchGroupUtilMatch? | ||
| ---@return string | ||
| function Util.getStageName(match) |
There was a problem hiding this comment.
why not use the same logic as match ticker does?
There was a problem hiding this comment.
Is there a function that we can use for that? Cannot see it on lua/wikis/commons/MatchTicker/Controller.lua
Edit: the Claude said
"The ticker's logic isn't in MatchTicker/Controller.lua, it's in Widget/Match/Card.lua (_renderStageName): DisplayHelper.expandHeader(match.bracketData.inheritedHeader)[1], falling back to match.section. I now do the same in Lib/Util.getStageName (keeping the matchsection fallback for matches without an inherited header)."
Is it correct?
Summary
This module is used to display the Longest and the Shortest game, based on match2 LPDB
The module also created by Freg(on honorofkings wiki)
for the future: if this code clean enough, it can be moved to commons and used by all other wiki
How did you test this change?
live on the wiki
and after code reworked, it's test with dev