diff options
author | Yorhel <git@yorhel.nl> | 2021-03-11 10:17:40 +0100 |
---|---|---|
committer | Yorhel <git@yorhel.nl> | 2021-03-16 08:27:59 +0100 |
commit | 7ffe7fa485c49b3d44150ed7b63d9062ae654ac8 (patch) | |
tree | 38cb0a9e04b8e2bd6d09a4818082cd65b541bdb5 /lib/Multi | |
parent | 6230c78005170af72b6d1d126ce466d1f3055819 (diff) |
ExtLinks: Merge DLsite (eng) into DLsite
Diffstat (limited to 'lib/Multi')
-rw-r--r-- | lib/Multi/DLsite.pm | 18 |
1 files changed, 3 insertions, 15 deletions
diff --git a/lib/Multi/DLsite.pm b/lib/Multi/DLsite.pm index 46a0263c..a09f0325 100644 --- a/lib/Multi/DLsite.pm +++ b/lib/Multi/DLsite.pm @@ -12,7 +12,7 @@ use VNDB::Config; my %C = ( url => 'https://www.dlsite.com/%s/work/=/product_id/%s.html', clean_timeout => 48*3600, - check_timeout => 5*60, + check_timeout => 1*60, ); @@ -22,10 +22,7 @@ sub run { %C = (%C, @_); push_watcher schedule 0, $C{clean_timeout}, sub { - pg_cmd q{DELETE FROM shop_dlsite WHERE id NOT IN( - SELECT l_dlsite FROM releases WHERE NOT hidden - UNION ALL - SELECT l_dlsiteen FROM releases WHERE NOT hidden)}; + pg_cmd q{DELETE FROM shop_dlsite WHERE id NOT IN(SELECT l_dlsite FROM releases WHERE NOT hidden)}; }; push_watcher schedule 0, $C{check_timeout}, sub { pg_cmd q{ @@ -34,15 +31,7 @@ sub run { FROM releases WHERE NOT hidden AND l_dlsite <> '' AND NOT EXISTS(SELECT 1 FROM shop_dlsite WHERE id = l_dlsite) - }, [], sub { - pg_cmd q{ - INSERT INTO shop_dlsite (id) - SELECT DISTINCT l_dlsiteen - FROM releases - WHERE NOT hidden AND l_dlsiteen <> '' - AND NOT EXISTS(SELECT 1 FROM shop_dlsite WHERE id = l_dlsiteen) - }, [], \&sync - } + }, [], \&sync } } @@ -61,7 +50,6 @@ sub data { $body =~ m{<i class="work_jpy">([0-9,]+) JPY</i></span>} ? sprintf('JP¥ %d', $1 =~ s/,//gr) : ''; $shop = $body =~ /,"category":"([^"]+)"/ ? $1 : ''; - $shop = 'ecchi-eng' if $shop eq 'ecchieng'; # Both work, but DLsite seems to prefer a dash. return AE::log warn => "$prefix Product found, but no price ($price) or shop ($shop)" if $found && (!$price || !$shop); |