Skip to content
GitLab
Explore
Projects
Groups
Snippets
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Memri
plugins
google-photos
Commits
777f7252
Commit
777f7252
authored
1 year ago
by
Alp Deniz Ogut
Browse files
Options
Download
Email Patches
Plain Diff
Limit number of imported images by default
parent
35ff1222
Pipeline
#15210
passed with stages
in 1 minute and 43 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
google_photos/constants.py
+2
-1
google_photos/constants.py
google_photos/plugin.py
+3
-1
google_photos/plugin.py
with
5 additions
and
2 deletions
+5
-2
google_photos/constants.py
+
2
-
1
View file @
777f7252
...
...
@@ -17,4 +17,5 @@ ACTION_COMPLETED = "action_completed"
SUCCESS
=
"success"
FAIL
=
"fail"
AUTH_TIMEOUT
=
120
\ No newline at end of file
AUTH_TIMEOUT
=
120
IMPORT_LIMIT
=
os
.
environ
.
get
(
"IMPORT_LIMIT"
,
100
)
\ No newline at end of file
This diff is collapsed.
Click to expand it.
google_photos/plugin.py
+
3
-
1
View file @
777f7252
...
...
@@ -16,7 +16,7 @@ from google_photos.data.schema import (
AuthenticationFlow
,
)
from
pymemri.plugin.pluginbase
import
PluginBase
from
.constants
import
SERVICE_NAME
,
CLIENT_ID
,
CLIENT_SECRET
,
PROJECT_ID
from
.constants
import
SERVICE_NAME
,
CLIENT_ID
,
CLIENT_SECRET
,
PROJECT_ID
,
IMPORT_LIMIT
from
.constants
import
IMAGE_FORMATS
,
VIDEO_FORMATS
,
THUMBNAIL_DIM
from
.constants
import
AWAIT_USER_ACTION
,
ACTION_COMPLETED
,
SUCCESS
,
FAIL
,
AUTH_TIMEOUT
...
...
@@ -323,6 +323,8 @@ class GooglePhotos(PluginBase):
if
"mediaItems"
in
items
:
self
.
number_of_images
=
len
(
items
[
'mediaItems'
])
logger
.
info
(
f
"Service has
{
self
.
number_of_images
}
images"
)
if
IMPORT_LIMIT
:
items
[
"mediaItems"
]
=
items
[
"mediaItems"
][:
int
(
IMPORT_LIMIT
)]
for
item
in
items
[
"mediaItems"
]:
executor
.
submit
(
self
.
import_media_file
,
item
)
executor
.
shutdown
()
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Explore
Projects
Groups
Snippets