php - List recreated album names that were previously deleted -


background

i list albums account match given name.

problem

after deleting album, recreating album exact same name, code $albumquery->setalbumname( ... ) find album name fails 404, though album created.

the following code runs fine:

// correct -- adding photographs albums works. $client = $this->login( $user, $pass, $picasa ); $picasa = $this->newphotographservice( $client );  $albumquery = $picasa->newalbumquery(); $albumquery->setuser( $user ); $albumquery->setalbumname( "17" );      // literal name of album. $albumquery->setmaxresults( 10 ); 

this line, exists after call setmaxresults, fails:

$albumfeed = $picasa->getalbumfeed( $albumquery ); 

upon executing above line following error occurs:

exception: expected response code 200, got 404

update #1

the following code works, not consistently:

echo "search album named $accountid $user\n"; $albumquery = $picasa->newalbumquery(); $albumquery->setuser( $user ); $albumquery->setalbumname( "album17" ); $albumquery->setmaxresults( 1 );  $albumid = null;  try {   echo "\nget album feed albumquery.\n";   $albumfeed = $picasa->getalbumfeed( $albumquery );    // feed returns list of photos; each photo has album id.   foreach( $albumfeed $key => $entry ) {     $albumid = $entry->getgphotoalbumid();   }    echo "\nfound album id: album17\n"; } catch( zend_gdata_app_exception $ex ) {   echo "\nerror: " . $ex->getmessage() . "\n";   echo "\ncreate album.\n";    // create album.   $albumid = $this->createalbum( $picasa, "album17" );   echo "\ncreated album id: album17\n"; } 

this performs expected until album deleted. when recreating album has been deleted, seems api cannot find recreated name. result above code creates new albums same name, undesirable.

update #2

this appears bug; have logged issue:

https://code.google.com/p/gdata-issues/issues/detail?id=4516

question

how retrieve album id using picasa's php api album deleted , recreated?

i'm not familiar particular api however...

what happens cannot recreate entry. once delete it, it's gone.

so need id of new album created, , use in code.

it seems you're confusing album's name it's id.


Comments

Popular posts from this blog

php - Why I am getting the Error "Commands out of sync; you can't run this command now" -

linux - Does gcc have any options to add version info in ELF binary file? -

java - Are there any classes that implement javax.persistence.Parameter<T>? -