diff options
| author | pep <yes@peepee.me> | 2020-07-21 20:48:09 +0000 |
|---|---|---|
| committer | pep <yes@peepee.me> | 2020-07-21 20:48:09 +0000 |
| commit | 789dbb1e734885bd7cf5ad25f0d2f47765a13657 (patch) | |
| tree | 090b79ed96465dbe135f4191468776cbf7a6a954 /search/bin/fix-files | |
| parent | 97bee7fe1a48acb4c34e207863af56894c198151 (diff) | |
attempt at merge
Diffstat (limited to 'search/bin/fix-files')
| -rw-r--r-- | search/bin/fix-files | 41 |
1 files changed, 0 insertions, 41 deletions
diff --git a/search/bin/fix-files b/search/bin/fix-files deleted file mode 100644 index b56d377..0000000 --- a/search/bin/fix-files +++ /dev/null @@ -1,41 +0,0 @@ -#!/usr/bin/perl -use strict; -use lib "../lib"; -use Bucky; - -my $bucky = new Bucky; -my $file_list = $bucky->db->select("file", {'thread = 2833'}); -my $file_map = {}; -foreach my $f (@$file_list) { - $file_map->{ $f->{'filename'} } = $f->{'id'}; -} - -my $base = "/var/www/vhosts/carbonpictures.com/bucky/data/"; -opendir(DIR, $base) or die $!; -my @dirs = readdir(DIR); -closedir(DIR); - -print scalar @dirs; - -foreach my $thread_id (@dirs) { - my $dir = $base . $thread_id; - - next unless (-d $dir && $thread_id !~ /^\./); - - opendir (THREAD, $dir); - my @local_files = readdir(THREAD); - closedir (THREAD); - - foreach my $filename (@local_files) { - next unless exists($file_map->{$filename}); - - my $file_id = $file_map->{$filename}; - - $bucky->db->update_by_id('file', { - "id" => $file_id, - "record" => { - "thread" => $thread_id - } - }); - } -}
\ No newline at end of file |
