]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Select the first generated thumbnail, which should be the proper size
authorMikael Nordfeldth <mmn@hethane.se>
Wed, 20 Jul 2016 22:37:43 +0000 (00:37 +0200)
committerMikael Nordfeldth <mmn@hethane.se>
Wed, 20 Jul 2016 22:38:16 +0000 (00:38 +0200)
...most of the time. If all works well.

classes/File_thumbnail.php

index 968883f2b86dc520656d41f68dc0e4b1d63c48db..91ba6537449b133c8caf236a5766e34d60ffb46b 100644 (file)
@@ -98,6 +98,7 @@ class File_thumbnail extends Managed_DataObject
         if ($notNullUrl) {
             $thumb->whereAdd('url IS NOT NULL');
         }
+        $thumb->orderBy('modified ASC');    // the first created, a somewhat ugly hack
         $thumb->limit(1);
         if (!$thumb->find(true)) {
             throw new NoResultException($thumb);