support for F-Spot photo versioning, refs #67
[phpfspot.git] / rpc.php
diff --git a/rpc.php b/rpc.php
index 5ff334e02995b72e6c9de2e2d1fa35d82184245c..17af07376afd2f94420083bb237c10896d20653b 100644 (file)
--- a/rpc.php
+++ b/rpc.php
@@ -98,6 +98,7 @@ class PHPFSPOT_RPC {
             $phpfspot->resetNameSearch();
             $phpfspot->resetTags();
             $phpfspot->resetDateSearch();
+            $phpfspot->resetRateSearch();
             $phpfspot->resetPhotoView();
             break;
 
@@ -117,7 +118,7 @@ class PHPFSPOT_RPC {
             if(isset($_GET['last_photo']) && is_numeric($_GET['last_photo']))
                $_SESSION['last_photo'] = $_GET['last_photo'];
 
-            $phpfspot->showPhotoIndex();
+            print $phpfspot->showPhotoIndex();
             break;
    
          case 'showcredits':
@@ -134,13 +135,20 @@ class PHPFSPOT_RPC {
             }
             break;
 
+         case 'update_photo_version':
+            if(isset($_POST['photo_version']) && is_numeric($_POST['photo_version']) &&
+               isset($_POST['photo_idx']) && is_numeric($_POST['photo_idx'])) {
+               print $phpfspot->update_photo_version($_POST['photo_idx'], $_POST['photo_version']);
+            }
+            break;
+
          case 'get_export':
             /* $_GET['mode'] will be validated by getExport() */
             $phpfspot->getExport($_GET['mode']);
             break;
 
          case 'get_photo_to_show':
-            $phpfspot->getCurrentPhoto();
+            print $phpfspot->get_current_photo();
             break;
 
          case 'get_calendar_matrix':