You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: lib/Padro.pm
+18-12Lines changed: 18 additions & 12 deletions
Original file line number
Diff line number
Diff line change
@@ -68,14 +68,13 @@ sub startup {
68
68
my$results = $db->query('SELECT * FROM pads WHERE name = (?)', $name);
69
69
70
70
if ($results->rows == 1) {
71
-
return$results->hash;
71
+
my$r = $db->query('select authors.name from authors JOIN pad_has_authors ON authors.ep_id = pad_has_authors.author_id WHERE pad_has_authors.pad_id = (?) ORDER BY authors.name', $name);
72
+
my$pad = $results->hash;
73
+
$pad->{authors} = $r->hashes if ($r->rows > 0);
74
+
return$pad;
72
75
} elsif ($results->rows > 1) {
73
76
$c->app->log->error('More than one row returned when looking for a pad, this is not supposed to happen!');
74
77
75
-
returnundef;
76
-
} elsif ($counter > 1) {
77
-
$c->app->log->error('There\'s a problem while fetching '.$name);
78
-
79
78
returnundef;
80
79
} else {
81
80
my$ep = $c->app->ep;
@@ -88,12 +87,14 @@ sub startup {
88
87
89
88
my$text = $ep->get_text($name);
90
89
my$html = $ep->get_html($name);
91
-
my ($s, $m, $h, $day, $month, $year) = gmtime($ep->get_last_edited($name));
90
+
my$time = $ep->get_last_edited($name);
91
+
$time =~ s/\d{3}$//;
92
+
my ($s, $m, $h, $day, $month, $year) = gmtime($time);
0 commit comments