Changeset 36095 for main


Ignore:
Timestamp:
2022-03-10T18:18:07+13:00 (2 years ago)
Author:
kjdon
Message:

look for files in collection/tmp folder, as well as import, and cache folders.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone2/perllib/plugins/BaseMediaConverter.pm

    r30427 r36095  
    8080    my $self = shift @_;
    8181    my ($filename) = @_;
    82 
     82   
    8383    my $verbosity = $self->{'verbosity'};
    8484    my $outhandle = $self->{'outhandle'};
     
    9999    # A cached name already has the fileroot baked -in as the last directory name
    100100    # => strip it out
    101     $file =~ s/[\/\\][^\/\\]+([\/\\][^\/\\]*)$/$1/;
    102 
     101        if (defined $file) {
     102            $file =~ s/[\/\\][^\/\\]+([\/\\][^\/\\]*)$/$1/;
     103        }
    103104#       Commented out code is the previous version that looked to
    104105#       handle this situation, but ran foul of situtation where
     
    109110#   ($file) = ($filename =~ m/^$prev_cached_dir(.*?)$/);
    110111    }
    111 
     112    if (!defined $file) {
     113        # perhaps the filename is in the tmp folder? This can happen if the file was in a zip inside the import folder, eg as happens with remote gli
     114        ($file) = ($filename =~ m/^$collect_dir\/(tmp\/.*?)$/);
     115
     116    }
    112117    $file =~ s/^\/|\\//; # get rid of leading slash from relative filename
    113118
Note: See TracChangeset for help on using the changeset viewer.