[FlickrBridge] Add content option to By username (#1861)

This commit is contained in:
Joseph 2022-03-29 21:46:55 +00:00 committed by GitHub
parent ec7d2a4afb
commit a485beadd7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 22 additions and 2 deletions

View File

@ -51,6 +51,15 @@ class FlickrBridge extends BridgeAbstract {
'title' => 'Insert username (as shown in the address bar)',
'exampleValue' => 'flickr'
),
'content' => array(
'name' => 'Content',
'type' => 'list',
'values' => array(
'Uploads' => 'uploads',
'Favorites' => 'faves',
),
'defaultValue' => 'uploads',
),
'media' => array(
'name' => 'Media',
'type' => 'list',
@ -156,8 +165,14 @@ class FlickrBridge extends BridgeAbstract {
. '&sort=' . $this->getInput('sort') . '&media=' . $this->getInput('media');
break;
case 'By username':
return self::URI . 'search/?user_id=' . urlencode($this->getInput('u'))
. '&sort=' . $this->getInput('sort') . '&media=' . $this->getInput('media');
$uri = self::URI . 'search/?user_id=' . urlencode($this->getInput('u'))
. '&sort=date-posted-desc&media=' . $this->getInput('media');
if ($this->getInput('content') === 'faves') {
return $uri . '&faves=1';
}
return $uri;
break;
default:
@ -175,6 +190,11 @@ class FlickrBridge extends BridgeAbstract {
return $this->getInput('q') . ' - keyword - ' . self::NAME;
break;
case 'By username':
if ($this->getInput('content') === 'faves') {
return $this->username . ' - favorites - ' . self::NAME;
}
return $this->username . ' - ' . self::NAME;
break;