From 8bbab7af6a524f4e4eb397fee2b97920375483d2 Mon Sep 17 00:00:00 2001 From: Dobrica Pavlinusic Date: Sat, 15 Oct 2011 10:23:22 +0200 Subject: [PATCH] last fallback for slots is calendar description --- angular-server.pl | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/angular-server.pl b/angular-server.pl index 1ef3778..5d86f9a 100755 --- a/angular-server.pl +++ b/angular-server.pl @@ -230,6 +230,8 @@ use iCal::Parser; plugin 'proxy'; +my $slot_regex = '(\d+)\s*mjesta'; + get '/reservations/get/(*url)' => sub { my $self = shift; @@ -267,8 +269,9 @@ get '/reservations/get/(*url)' => sub { SUMMARY )) { next unless exists $_->{$check_slot}; - $_->{slots} = $1 if $_->{$check_slot} =~ m/(\d+)\s*mjesta/s; + $_->{slots} = $1 if $_->{$check_slot} =~ m/$slot_regex/is; } + $_->{slots} ||= $1 if $ical->{cal}->{'X-WR-CALDESC'} =~ m/$slot_regex/s; $_; } @events; -- 2.20.1