mirror of
https://framagit.org/fiat-tux/hat-softwares/lutim.git
synced 2026-03-28 17:42:54 +01:00
Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ec6b9ce028 | ||
|
|
321b8bbf97 | ||
|
|
78ce5dc69d | ||
|
|
82289ece59 |
@@ -29,6 +29,7 @@ sqlite2:
|
||||
script:
|
||||
- make podcheck
|
||||
- MOJO_CONFIG=t/sqlite2.conf make minion &
|
||||
- sleep 3
|
||||
- MOJO_CONFIG=t/sqlite2.conf make test-sqlite
|
||||
- MOJO_CONFIG=t/sqlite2.conf make watch
|
||||
- MOJO_CONFIG=t/sqlite2.conf make cleanbdd
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
Revision history for Lutim
|
||||
|
||||
0.8.1 2017-06-13
|
||||
- Fix #46
|
||||
|
||||
0.8 2017-06-13
|
||||
- Improve statistics page
|
||||
- Add database abstraction layer (#42)
|
||||
|
||||
2
cpanfile
2
cpanfile
@@ -5,7 +5,7 @@ requires 'Data::Validate::URI';
|
||||
requires 'Net::Domain::TLD', '>= 1.73'; # Must have the last version to handle (at least) .xyz and .link
|
||||
requires 'Mojo::Pg';
|
||||
requires 'Mojolicious::Plugin::I18N';
|
||||
requires 'Mojolicious::Plugin::AssetPack';
|
||||
requires 'Mojolicious::Plugin::AssetPack', '>= 1.44';
|
||||
requires 'Mojolicious::Plugin::DebugDumperHelper';
|
||||
requires 'Mojolicious::Plugin::PgURLHelper';
|
||||
requires "Minion", "== 4.06";
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# vim:set sw=4 ts=4 sts=4 expandtab:
|
||||
package Lutim::Controller;
|
||||
use Mojo::Base 'Mojolicious::Controller';
|
||||
use Mojo::Util qw(url_escape url_unescape b64_encode);
|
||||
use Mojo::Util qw(url_escape url_unescape b64_encode encode);
|
||||
use Mojo::Asset::Memory;
|
||||
use Mojo::JSON qw(true false);
|
||||
use Lutim::DB::Image;
|
||||
@@ -656,7 +656,7 @@ sub zip {
|
||||
$c->delete_image($image);
|
||||
|
||||
# Warn user
|
||||
$zip->addString($c->l('Unable to find the image: it has been deleted.'), 'images/'.$filename.'.txt');
|
||||
$zip->addString(encode('UTF-8', $c->l('Unable to find the image: it has been deleted.')), 'images/'.$filename.'.txt');
|
||||
next;
|
||||
}
|
||||
|
||||
@@ -668,7 +668,7 @@ sub zip {
|
||||
# Delete image
|
||||
$c->delete_image($image);
|
||||
|
||||
$zip->addString($c->l('Unable to find the image: it has been deleted.'), 'images/'.$filename.'.txt');
|
||||
$zip->addString(encode('UTF-8', $c->l('Unable to find the image: it has been deleted.')), 'images/'.$filename.'.txt');
|
||||
next;
|
||||
} else {
|
||||
my $expires = ($image->delete_at_day) ? $image->delete_at_day : 360;
|
||||
@@ -679,7 +679,7 @@ sub zip {
|
||||
my $path = $image->path;
|
||||
unless ( -f $path && -r $path ) {
|
||||
$c->app->log->error("Cannot read file [$path]. error [$!]");
|
||||
$zip->addString($c->l('Unable to find the image: it has been deleted.'), 'images/'.$filename.'.txt');
|
||||
$zip->addString(encode('UTF-8', $c->l('Unable to find the image: it has been deleted.')), 'images/'.$filename.'.txt');
|
||||
next;
|
||||
}
|
||||
|
||||
@@ -704,10 +704,10 @@ sub zip {
|
||||
$c->app->log->info('[NOT FOUND] someone tried to view '.$short.' but it does\'nt exist anymore.');
|
||||
|
||||
# Warn user
|
||||
$zip->addString($c->l('Unable to find the image: it has been deleted.'), 'images/'.$image->filename.'.txt');
|
||||
$zip->addString(encode('UTF-8', $c->l('Unable to find the image: it has been deleted.')), 'images/'.$image->filename.'.txt');
|
||||
next;
|
||||
} else {
|
||||
$zip->addString($c->l('Image not found.'), 'images/'.$short.'.txt');
|
||||
$zip->addString(encode('UTF-8', $c->l('Image not found.')), 'images/'.$short.'.txt');
|
||||
next;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@ sub register {
|
||||
|
||||
# Database migration
|
||||
my $migrations = Mojo::Pg::Migrations->new(pg => $app->pg);
|
||||
if ($app->mode eq 'development') {
|
||||
if ($app->mode eq 'development' && $ENV{LUTIM_DEBUG}) {
|
||||
$migrations->from_file('utilities/migrations.sql')->migrate(0)->migrate(1);
|
||||
} else {
|
||||
$migrations->from_file('utilities/migrations.sql')->migrate(1);
|
||||
|
||||
Reference in New Issue
Block a user