Skip to content

Commit

Permalink
0.0.1
Browse files Browse the repository at this point in the history
Signed-off-by: Julien Veyssier <[email protected]>
  • Loading branch information
Julien Veyssier committed Oct 1, 2020
1 parent b08fd35 commit d33b8e1
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 23 deletions.
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# Google integration in Nextcloud

🇬 Google integration allows you to automatically import your Google calendars and contacts into Nextcloud.

## Releases

...
Google photos import is on the way.
4 changes: 2 additions & 2 deletions appinfo/info.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
<info>
<id>integration_google</id>
<name>Google integration</name>
<summary>Integration of Google services</summary>
<description><![CDATA[Google integration allows you to automatically import your Google calendars, contacts and photos into Nextcloud.]]></description>
<summary>Import Google data into Nextcloud</summary>
<description><![CDATA[Google integration allows you to automatically import your Google calendars and contacts into Nextcloud.]]></description>
<version>0.0.1</version>
<licence>agpl</licence>
<author>Julien Veyssier</author>
Expand Down
6 changes: 3 additions & 3 deletions lib/Service/GoogleAPIService.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public function __construct (string $appName,
* @param string $targetPath
* @return array
*/
public function importPhotos(string $accessToken, string $userId, string $targetPath = 'Google', int $maxDownloadNumber = 2): array {
public function importPhotos(string $accessToken, string $userId, string $targetPath = 'Google', ?int $maxDownloadNumber = null): array {
// create root folder
$userFolder = $this->root->getUserFolder($userId);
if (!$userFolder->nodeExists($targetPath)) {
Expand Down Expand Up @@ -117,7 +117,7 @@ public function importPhotos(string $accessToken, string $userId, string $target
foreach ($result['mediaItems'] as $photo) {
if ($this->getPhoto($accessToken, $userId, $photo, $albumFolder)) {
$nbDownloaded++;
if ($nbDownloaded === $maxDownloadNumber) {
if ($maxDownloadNumber && $nbDownloaded === $maxDownloadNumber) {
return [
'nbDownloaded' => $nbDownloaded,
'targetPath' => $targetPath,
Expand All @@ -134,7 +134,7 @@ public function importPhotos(string $accessToken, string $userId, string $target
foreach ($result['mediaItems'] as $photo) {
if ($this->getPhoto($accessToken, $userId, $photo, $albumFolder)) {
$nbDownloaded++;
if ($nbDownloaded === $maxDownloadNumber) {
if ($maxDownloadNumber && $nbDownloaded === $maxDownloadNumber) {
return [
'nbDownloaded' => $nbDownloaded,
'targetPath' => $targetPath,
Expand Down
2 changes: 2 additions & 0 deletions makefile
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,8 @@ appstore: clean
--exclude=.gitlab-ci.yml \
--exclude=crowdin.yml \
--exclude=tools \
--exclude=.tx \
--exclude=.l10nignore \
--exclude=l10n/.tx \
--exclude=l10n/l10n.pl \
--exclude=l10n/templates \
Expand Down
10 changes: 0 additions & 10 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 1 addition & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,7 @@
"vue": "^2.6.11",
"vue-types": "^1.7.0",
"vuex": "^3.5.1",
"vue-click-outside": "^1.1.0",
"vue2-transitions": "^0.3.0",
"vue-awesome-countdown": "^1.0.26"
"vue-click-outside": "^1.1.0"
},
"devDependencies": {
"@nextcloud/eslint-config": "^2.2.0",
Expand Down
4 changes: 2 additions & 2 deletions src/components/PersonalSettings.vue
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
</button>
</div>
</div>
<br>
<!--br>
<div v-if="nbPhotos > 0"
id="google-photos">
<h3>{{ t('integration_google', 'Photos') }}</h3>
Expand All @@ -92,7 +92,7 @@
<span v-else>
{{ t('integration_google', 'You Google photo collection size is estimated to be bigger than your remaining space left ({formSpace})', { formSpace: humanFileSize(freeSpace) }) }}
</span>
</div>
</div-->
</div>
</div>
</div>
Expand Down

0 comments on commit d33b8e1

Please sign in to comment.