summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--debian/changelog6
-rwxr-xr-xrhimport-dn8
-rwxr-xr-xrhimport-eu10
3 files changed, 20 insertions, 4 deletions
diff --git a/debian/changelog b/debian/changelog
index b6ddb39..9acbebf 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+rhimport (0.3.15-53) unstable; urgency=medium
+
+ * added pre-import converter for EU
+
+ -- Christian Pointner <equinox@helsinki.at> Mon, 13 Jun 2016 19:26:41 +0200
+
rhimport (0.3.15-52) unstable; urgency=medium
* fixe FL importer
diff --git a/rhimport-dn b/rhimport-dn
index 9a1020a..41c980b 100755
--- a/rhimport-dn
+++ b/rhimport-dn
@@ -146,12 +146,13 @@ for my $entry ($files_feed->entries) {
}
}
if($file eq "" || !(-e "$file")) {
- print "No Entry found from day in qeustion or download error - ";
+ print "No Entry found from day in question or download error - ";
if($#ARGV >= 0 && $ARGV[0] eq 'last') {
print "giving up, manual import necessary!!!\n";
} else {
print "will retry later\n";
}
+ $dbh->disconnect();
exit 1;
}
@@ -201,7 +202,7 @@ if( $! != 0) {
print "ok\n";
unlink $infile;
-print "will import $file to dropbox $dropbox (cart=$to_cart)\n\n";
+print "will import $file to dropbox $dropbox (cart=$to_cart)\n";
my $error_cb = sub {
my ($text) = @_;
@@ -213,8 +214,7 @@ my $error_cb = sub {
rhimport::check_key_file() or die "Import Key not found, use rhimport-create-id to create one\n";
my $ret;
-my $log;
-$log = rhimport::clear_carts($dbh, $group, $to_cart);
+my $log = rhimport::clear_carts($dbh, $group, $to_cart);
my $import_log;
($ret, $import_log) = rhimport::import_single($file, $dropbox, $user, 0, $error_cb);
$log .= $import_log;
diff --git a/rhimport-eu b/rhimport-eu
index c11f9c7..4678846 100755
--- a/rhimport-eu
+++ b/rhimport-eu
@@ -164,6 +164,16 @@ if($file eq "" || !(-e "$file")) {
exit 1;
}
+print "converting $file ... ";
+my $infile = $file;
+$file =~ s/\.mp3$/.wav/;
+system("ffmpeg", "-i", $infile, "-acodec", "pcm_s16le", $file);
+if( $! != 0) {
+ die "ffmpeg returned with error: " . $!;
+}
+print "ok\n";
+unlink $infile;
+
print "will import $file to dropbox $dropbox (cart=$to_cart)\n";
my $error_cb = sub {