From 3eecf04629ce2a48208e2f9fe3189eba535d6597 Mon Sep 17 00:00:00 2001 From: plegall Date: Tue, 7 Oct 2008 22:01:14 +0000 Subject: feature 889 added: pwg.images.exist check the existence of a photo in the database based on its md5sum. (avoid failing on pwg.images.add). git-svn-id: http://piwigo.org/svn/trunk@2683 68402e56-0260-453c-a942-63ccdbb3a9ee --- tools/piwigo_remote.pl | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'tools/piwigo_remote.pl') diff --git a/tools/piwigo_remote.pl b/tools/piwigo_remote.pl index f11e0d457..3e3031c82 100644 --- a/tools/piwigo_remote.pl +++ b/tools/piwigo_remote.pl @@ -173,6 +173,25 @@ if ($opt{action} eq 'pwg.tags.add') { print Dumper(from_json($response->content)); } +if ($opt{action} eq 'pwg.images.exist') { + $form = { + method => $opt{action}, + }; + + foreach my $key (keys %{ $opt{define} }) { + $form->{$key} = $opt{define}{$key}; + } + + my $response = $ua->post( + $conf{base_url}.'/ws.php?format=json', + $form + ); + + use Data::Dumper; + print Dumper(from_json($response->content)->{result}); + # print Dumper($response); +} + $query = pwg_ws_get_query( method => 'pwg.session.logout' ); -- cgit v1.2.3