Template talk:VideoGallery: Difference between revisions

Jump to navigation Jump to search
Line 33: Line 33:


:Please excuse me if you're already aware, but as I understand it there's two separate things going on with the random videos. First of all, templates on the wiki seem to work off a cached version on page refresh, and don't update until the page they're on or a called template/subtemplate is edited. You can see this by first trying to refresh the page on [[Template:Random number/doc]], then going into edit on it and hitting preview over and over. The former will give the same numbers, the latter will have them change normally. The second problem is that the rand calls in VideoGallery are seeded with "1", "2", and "3". This means that the random choices are sequential, i.e. for a single first random video, you'll always get the same next two "random" videos after it. The second behavior could probably be improved with better seeds, but this might make it possible to get two of the same results without adding more ugly checks, I'm not sure about that. The first one though is a sitewide behavioral quirk and "fixing" that might lead to a huge performance hit. For example, I used to have a ton of dpls on my talk page, and dpl's documentation is covered in warnings about server load. It might not be the best thing to have those refresh every time I wanted to look at the results of the same search. - [[User:Xerxes|Xerxes]] ([[User talk:Xerxes|talk]]) 02:33, 17 July 2017 (CEST)
:Please excuse me if you're already aware, but as I understand it there's two separate things going on with the random videos. First of all, templates on the wiki seem to work off a cached version on page refresh, and don't update until the page they're on or a called template/subtemplate is edited. You can see this by first trying to refresh the page on [[Template:Random number/doc]], then going into edit on it and hitting preview over and over. The former will give the same numbers, the latter will have them change normally. The second problem is that the rand calls in VideoGallery are seeded with "1", "2", and "3". This means that the random choices are sequential, i.e. for a single first random video, you'll always get the same next two "random" videos after it. The second behavior could probably be improved with better seeds, but this might make it possible to get two of the same results without adding more ugly checks, I'm not sure about that. The first one though is a sitewide behavioral quirk and "fixing" that might lead to a huge performance hit. For example, I used to have a ton of dpls on my talk page, and dpl's documentation is covered in warnings about server load. It might not be the best thing to have those refresh every time I wanted to look at the results of the same search. - [[User:Xerxes|Xerxes]] ([[User talk:Xerxes|talk]]) 02:33, 17 July 2017 (CEST)
:: Thank you for providing some more specific details. I wasn't clear regarding the deficiencies in the randomization. Things still work somewhat as intended (i.e. a random set of videos get thumbnails, outside the order they appear on the page preventing editors from easily controlling the order on the page). Though I guess since random updates change the order, that may lead to random edits to force resets for those in the know. It still provides some discouragement to playing with video order. I'd need to look more closely, but I'd presume there's probably a better way of handling the randomization seed, though that may have impact on performance since a properly randomized seed likely impacts caching of pages. Perhaps a date based seed using the day could work out, so it would still rotate regularly but still allow a page to be cached for a while.
:: I think some of this also comes round to something I think we've been trying to avoid, which is more general care taking of the posted videos. There's many links that can be purged (i.e. whole lists of playthrough videos's rather than just the first clip, odd ball recordings with cameras, obnoxious commentary, etc.). We might want to rethink the handling somewhat generally, perhaps pruning things down to a few "curated" videos and providing a search link into Youtube for others. It might be possible to even surface search results on the page via the Youtube API, though particularly for rarer/less unique title names that may have some odd content. [[User:Kolano|Kolano]] ([[User talk:Kolano|talk]]) 06:12, 17 July 2017 (CEST)


=== Square Brackets Example ===
=== Square Brackets Example ===