dump body
[cloudstore.git] / gearman / transmission.pl
index a66f771..6e6e04a 100755 (executable)
@@ -24,7 +24,8 @@ my $j = JSON::XS->new;
 $j->allow_blessed(1);
 $j->convert_blessed(0);
 
-use TokyoCabinet;
+use lib 'lib';
+use CloudStore::MD5sum;
 
 my $name = $ENV{ZSLICE} || die "need ZSLICE";
 my $torrent_dir = "/$name/torrent";
@@ -132,11 +133,7 @@ $worker->register_function( $name . '_torrent_share' => sub {
        my $path = $work;
 
        my $dir = (getpwnam($user))[7] || die "no user $user";
-       my $md5_path = "$dir/.md5";
-       my %h;
-       tie %h, "TokyoCabinet::HDB", $md5_path || die "$md5_path: $!";
-       my $md5 = $h{$path} || die "can't find $path in $md5_path";
-       untie %h;
+       my $md5 = CloudStore::MD5sum->md5_get( "$dir/$path" );
 
        warn "# $md5 $path";