-
Notifications
You must be signed in to change notification settings - Fork 4
Description
According to
https://www.flickr.com/services/api/explore/flickr.photos.search
if I set a page number greater than the number of pages, then it still returns results. Hence this now never finishes (it did when I last ran my backup a few months ago):
if (count($photos['photo']) == 0) {
Fix appears to be (I'm not a php coder by a long stretch):
diff --git a/Offlickr2.php b/Offlickr2.php
index 6a97958..2d00451 100755
--- a/Offlickr2.php
+++ b/Offlickr2.php
@@ -396,8 +396,13 @@ class Offlickr2 {
if (count($photos['photo']) == 0) {
break;
}
-
if ($page > $photos['pages']) {
-
printf ("debug: past the end of pages? $page > %s\n", $photos['pages']);
-
break;
-
foreach ($photos['photo'] as $photo) {
}
array_push($this->photo_list, $photo['id']); -
}
printf ("debug: %s %d\n", $photo['id'], $page);
$retrieved = count($this->photo_list);
$this->dialog->info(2, "Total so far: " . $retrieved . " photo(s)");
P.S. why do I need this in my local version to stave off php warnings?
diff --git a/LocalStorage.php b/LocalStorage.php
index 0eb009c..4e8b221 100644
--- a/LocalStorage.php
+++ b/LocalStorage.php
@@ -18,6 +18,8 @@ abstract class LocalItem {
}
function setup_temporary_dir() {
- $path="/tmp";
- $prefix="offlickr2.";
// FIXME: Not atomic
$tempname = tempnam($path,$prefix);
if (!$tempname) {
@@ -329,4 +331,4 @@ class LocalStorage {
}
-?>
\ No newline at end of file
+?>