Skip to content
This repository has been archived by the owner on Jun 7, 2024. It is now read-only.

Commit

Permalink
删除 set_arcsize
Browse files Browse the repository at this point in the history
  • Loading branch information
WindyCloudCute committed Nov 12, 2023
1 parent c764068 commit 33c1ec6
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions lib/LANraragi/Utils/Database.pm
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ sub add_archive_to_redis ( $id, $file, $redis ) {
$redis->hset( $id, "name", redis_encode($name) );
$redis->hset( $id, "tags", "" );
if ( defined($file) && -e $file ) {
set_arcsize( $redis, $id, -s $file );
$redis->hset( $id, "arcsize", -s $file );
}

# Don't encode filenames.
Expand Down Expand Up @@ -73,7 +73,7 @@ sub change_archive_id ( $old_id, $new_id ) {

# Update archive size
my $file = $redis->hget( $new_id, "file" );
set_arcsize( $redis, $new_id, -s $file );
$redis->hset( $new_id, "arcsize", -s $file );
$redis->quit;

# Update categories that contain the ID.
Expand Down Expand Up @@ -537,13 +537,8 @@ sub get_computed_tagrules {
}

sub add_arcsize ( $redis, $id ) {
my $file = $redis->hget( $id, "file" );
my $arcsize = -s $file;
set_arcsize( $redis, $id, $arcsize );
}

sub set_arcsize ( $redis, $id, $arcsize ) {
$redis->hset( $id, "arcsize", $arcsize );
my $file = $redis->hget( $id, "file" );
$redis->hset( $id, "arcsize", -s $file );
}

sub get_arcsize ( $redis, $id ) {
Expand Down

0 comments on commit 33c1ec6

Please sign in to comment.