Fixing race condition and adding a icon to be used in t-shirts.

This commit is contained in:
Sergiotarxz 2023-08-23 18:28:55 +02:00
parent a021a27955
commit d80c4a5efd
4 changed files with 91 additions and 4 deletions

View File

@ -8,20 +8,24 @@ use warnings;
use feature 'signatures';
use Moo::Role;
use Scalar::Util qw/blessed/;
has alternative => (
is => 'rw'
);
sub regenerate_alternative($self) {
sub clone($self) {
my $class = blessed $self;
$self = $class->new;
$self->alternative(rand());
return $self;
}
sub weight {
return 25;
}
sub seconds {
sub seconds($self) {
return 5;
}

View File

@ -47,8 +47,7 @@ sub get_next ( $self, $current_ad_number = undef ) {
if ( !defined $current_ad_number ) {
$current_ad_number = 0;
}
my $ad = $self->get_rand_ad($array);
$ad->regenerate_alternative;
my $ad = $self->get_rand_ad($array)->clone;
return {
ad => $ad->serialize,
continue => 1,

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

After

Width:  |  Height:  |  Size: 61 KiB

View File

@ -0,0 +1,84 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
width="503"
height="503"
viewBox="0 0 133.08626 133.08625"
version="1.1"
id="svg5"
xml:space="preserve"
inkscape:version="1.2.2 (b0a8486541, 2022-12-01)"
sodipodi:docname="burguillos-chad.svg"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg"><sodipodi:namedview
id="namedview7"
pagecolor="#ffffff"
bordercolor="#000000"
borderopacity="0.25"
inkscape:showpageshadow="2"
inkscape:pageopacity="0.0"
inkscape:pagecheckerboard="0"
inkscape:deskcolor="#d1d1d1"
inkscape:document-units="mm"
showgrid="false"
inkscape:zoom="0.49260385"
inkscape:cx="226.34821"
inkscape:cy="261.87371"
inkscape:window-width="1920"
inkscape:window-height="1011"
inkscape:window-x="0"
inkscape:window-y="0"
inkscape:window-maximized="1"
inkscape:current-layer="layer1" /><defs
id="defs2"><rect
x="191.8733"
y="296.26283"
width="89.250046"
height="103.92693"
id="rect4068" /><rect
x="139.23143"
y="151.75457"
width="247.98071"
height="75.725623"
id="rect5849" /></defs><g
inkscape:label="Layer 1"
inkscape:groupmode="layer"
id="layer1"><path
style="fill:#e7e199;fill-opacity:1;stroke:#8400b4;stroke-width:2.99006;stroke-dasharray:none;stroke-opacity:1"
d="M 6.8388673,49.486943 C 9.710041,63.904664 15.711789,79.81748 20.100936,99.274117 63.184262,149.793 83.520623,134.0439 110.52452,97.267545 c 3.9245,-18.049198 12.30395,-32.34215 13.6179,-46.206138 L 132.15172,3.7760956 93.012498,19.289294 C 87.693797,13.842901 58.504869,7.2958746 40.643873,18.407972 L 5.2415547,3.7524623 Z"
id="path3088"
sodipodi:nodetypes="ccccccccc" /><path
style="fill:#8400b4;fill-opacity:1;stroke:#8400b4;stroke-width:2.9583;stroke-dasharray:none;stroke-opacity:0.00202613"
d="M 98.829592,20.678924 C 111.74147,17.201321 122.09575,12.902401 129.84127,6.8589711 124.62182,18.463581 124.8887,30.068192 123.6809,41.672802 120.47315,31.639427 117.527,24.825552 98.829592,20.678924 Z"
id="path4962"
sodipodi:nodetypes="cccc" /><path
style="fill:#505050;fill-opacity:1;stroke:#8400b4;stroke-width:3.08523;stroke-dasharray:none"
d="M 108.23155,41.554893 C 84.057171,55.597846 51.145571,29.573919 23.711647,41.679913 33.998888,48.286132 37.834765,56.949934 35.80359,67.484965 47.866927,68.138992 63.71903,65.407262 64.403925,45.917284 70.953505,57.486783 73.124416,67.639331 94.301247,65.903038 92.577577,56.93105 99.512779,49.123086 108.23155,41.55489 Z"
id="path352"
sodipodi:nodetypes="cccccc" /><path
style="fill:#000000;fill-opacity:0;stroke:#8400b4;stroke-width:3.43476"
d="m 61.437092,77.412144 6.391036,-4.218917 3.387061,3.919856 -6.861119,3.759523 z"
id="path354" /><path
style="fill:#8400b4;fill-opacity:1;stroke:#8400b4;stroke-width:2.65144;stroke-dasharray:none"
d="m 6.2386512,50.303 16.9469698,-8.443852 7.769115,6.35664 C 21.097731,44.230492 12.909867,48.053389 6.2386512,50.303 Z"
id="path2078"
sodipodi:nodetypes="cccc" /><path
style="fill:#8400b4;fill-opacity:1;stroke:#8400b4;stroke-width:2.65144;stroke-dasharray:none"
d="m 107.24129,42.319422 19.85616,9.828401 c -6.85788,-2.517928 -16.74095,-6.670596 -25.48397,-2.658996 z"
id="path2548"
sodipodi:nodetypes="cccc" /><text
xml:space="preserve"
transform="scale(0.264585)"
id="text4066"
style="fill:#8400b4;-inkscape-font-specification:'monospace, Normal';font-family:monospace;font-size:66.66666667px;stroke:#8400b4;stroke-width:7.34740157;fill-opacity:1;stroke-dasharray:none;white-space:pre;shape-inside:url(#rect4068)" /><g
aria-label="I"
id="text4074"
style="font-size:17.639px;font-family:monospace;-inkscape-font-specification:'monospace, Normal';fill:#8400b4;stroke:#8400b4;stroke-width:0;stroke-dasharray:none"
transform="matrix(0.01434129,-2.7957787,5.7069091,0.09231839,-441.96754,288.98807)"><path
d="m 67.459633,82.859003 c 2.16276,1.661141 4.308209,2.061983 7.088328,0 v 1.343596 l -2.601002,1.367555 -0.09454,6.037127 2.69554,1.526784 v 1.343596 c -2.418748,-1.695052 -4.78008,-1.651346 -7.088328,0 V 93.134065 L 70.055,91.700252 70.301915,85.570154 67.459633,84.202599 Z"
id="path4076"
style="stroke-width:0;stroke-dasharray:none"
sodipodi:nodetypes="ccccccccccccc" /></g></g></svg>

After

Width:  |  Height:  |  Size: 4.6 KiB