Content deleted Content added
→Nifty use of this template for a sidebar slideshow, maybe we should support this correctly?: Fixing slideshow as the source sections was renamed |
→Portals with many images: new section |
||
Line 82:
It's a pretty nifty way to elevate some content in an article to the intro. Thoughts on supporting this as a real thing, like maybe a new template or having a setting on this template so people could discover this usage? [[User:Efbrazil|Efbrazil]] ([[User talk:Efbrazil|talk]]) 20:49, 9 May 2020 (UTC)
== Portals with many images ==
{{ping|Evad37|Northamerica1000}} Portal generation can be slow and sometimes breaches the 10-second limit. [[Portal:Pakistan]] was showing "The time allocated for running scripts has expired."; I purged it at a quiet time but it's still over 9 seconds and may flip back randomly. 66% of that is one call to {{tl|Transclude files as random slideshow}} which generates 145 images. What should we do?
One option is to have the module apply a maximum image count. It might be better to tune individual portals, reducing the list of articles from which images are extracted. At least that way we have some say in which ones are removed. Another idea is to limit the number of images per article (currently hard-coded as 100 in the module, which in practice means "all"). However, doing so naively would drop the later images which might be the best ones. Ideally, the module would select the "best" pictures, but that probably involves doing all the current work (and more) before discarding the mediocre, which improves the portal but doesn't solve the timing problem.
I think that choosing 50 at random is as simple as adding the <code>, 1, 50</code> in <code>local galleryContent = table.concat(sortedLines, '\n', 1, 50)</code>, though pruning the selection earlier might be more efficient and we may want to accept a parameter to override the value of 50 that I plucked from thin air. Any thoughts? [[User:Certes|Certes]] ([[User talk:Certes|talk]]) 12:47, 30 September 2020 (UTC)
|