summaryrefslogtreecommitdiff
path: root/rhimport.pm
diff options
context:
space:
mode:
Diffstat (limited to 'rhimport.pm')
-rw-r--r--rhimport.pm18
1 files changed, 13 insertions, 5 deletions
diff --git a/rhimport.pm b/rhimport.pm
index 5827bb2..4db154c 100644
--- a/rhimport.pm
+++ b/rhimport.pm
@@ -38,8 +38,8 @@ sub get_dropboxes
$path =~ s/\/\*$//;
my $name = $path;
$name =~ s/^\/programm\///;
- if($name =~ /^([0-9]{2}-[A-Za-z]+)\/([0-9]{4})-([01]{4})-([0-9]{3})-(.*)$/) {
- $name = "$1 - $2: $5 ($3, $4)";
+ if($name =~ /^([0-9]{2}-[A-Za-z]+)\/([0-9]{2})([0-9]{2})-([01]{4})-([0-9]{3})-(.*)$/) {
+ $name = "$1 - $2:$3 - $6 ($4, $5)";
}
elsif($name =~ /^([0-9]{2}-[A-Za-z]+)\/programmvorschau_(.*)$/) {
$name = "Programmvorschau - $1 - $2";
@@ -92,12 +92,13 @@ sub get_used_carts
return @carts;
}
-sub empty_carts
+sub clear_carts
{
my $dbh = shift;
my $group = shift;
my ($low_cart, $high_cart) = get_cart_range($dbh, $group);
+ print "clearing Carts $low_cart - $high_cart\n";
my $cart = $low_cart;
while($cart <= $high_cart) {
my $sql = qq{select CUT_NAME from CUTS where CART_NUMBER='$cart';};
@@ -107,7 +108,7 @@ sub empty_carts
my $filename = "/var/snd/$cut_name.wav";
### call unlink!!!
- print "deleting $filename\n";
+ print " - deleting $filename\n";
}
$sth->finish();
@@ -143,11 +144,18 @@ sub import_playlist
return 0;
}
+sub import_single
+{
+ my ($file, $dropbox) = @_;
+ print "Starting import from file $file to $dropbox\n";
+ import_file($file, $dropbox);
+}
+
sub import_file
{
my ($file, $dropbox) = @_;
- print "importing $file to $dropbox .. ";
+ print " - importing $file to $dropbox .. ";
$| = 1;
sleep(1);