]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
[StoreRemoteMedia] script removeRemoteMedia.php was trying to remove already removed...
authorDiogo Cordeiro <diogo@fc.up.pt>
Thu, 18 Apr 2019 00:03:09 +0000 (01:03 +0100)
committerDiogo Cordeiro <diogo@fc.up.pt>
Thu, 18 Apr 2019 00:03:09 +0000 (01:03 +0100)
Sometimes different posts are associated with the same file, that case wasn't considered
Thanks to XRevan86 for spotting this issue.

plugins/StoreRemoteMedia/scripts/removeRemoteMedia.php

index b3b43018a90ab267f198b4eac403d392823b01fc..2a5bdebd4612299860f8a62e712b379a3e6772f7 100755 (executable)
@@ -30,7 +30,7 @@
 define('INSTALLDIR', realpath(__DIR__ . '/../../..'));
 
 $shortoptions = 'l::a::i';
-$longoptions = ['limit=','all','image'];
+$longoptions = ['limit=', 'all', 'image'];
 
 $helptext = <<<END_OF_HELP
 remove_remote_media.php [options]
@@ -43,7 +43,7 @@ In case the attachment is an image its thumbs will be removed as well.
 
 END_OF_HELP;
 
-require_once INSTALLDIR.'/scripts/commandline.inc';
+require_once INSTALLDIR . '/scripts/commandline.inc';
 
 $quiet = have_option('q', 'quiet');
 $include_previews = have_option('a', 'all');
@@ -61,7 +61,7 @@ if (empty($max_date)) {
 }
 
 $query = "
-    SELECT
+    SELECT DISTINCT
         file_to_post.file_id
     FROM
         file_to_post