Skip to content

Commit d5c46d5

Browse files
committed
add an option to create a show-name directory instead of just dropping the
mostly-incomprehensible nuv files into the savepath.
1 parent 488232c commit d5c46d5

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

trunk/export/NUV_SQL.pm

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/usr/bin/perl -w
2-
#Last Updated: 2004.09.26 (xris)
2+
#Last Updated: 2004.09.27 (xris)
33
#
44
# export::NUV_SQL
55
# Maintained by Chris Petersen <mythtv@forevermore.net>
@@ -26,7 +26,8 @@ package export::NUV_SQL;
2626
'enabled' => 1,
2727
'errors' => [],
2828
# Delete original files?
29-
'delete' => 0,
29+
'delete' => 0,
30+
'create_dir' => 1,
3031
};
3132
bless($self, $class);
3233

@@ -54,13 +55,22 @@ package export::NUV_SQL;
5455
}
5556
# Load the save path, if requested
5657
$self->{'path'} = query_savepath();
58+
# Create a
59+
$self->{'create_dir'} = query_text('Create a directory with the show name?',
60+
'yesno',
61+
$self->{'create_dir'} ? 'Yes' : 'No');
5762
}
5863

5964
sub export {
6065
my $self = shift;
6166
my $episode = shift;
6267
# Make sure we have finfo
6368
load_finfo($episode);
69+
# Create a show-name directory?
70+
if ($self->{'create_dir'}) {
71+
$self->{'path'} .= '/'.$episode->{'outfile'};
72+
mkdir($self->{'path'}, 0755) or die "Can't create $self->{'path'}: $!\n\n";
73+
}
6474
# Load the three files we'll be using
6575
my $txt_file = basename($episode->{'filename'}, '.nuv') . '.txt';
6676
my $sql_file = basename($episode->{'filename'}, '.nuv') . '.sql';

0 commit comments

Comments
 (0)