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
dropbox-v2
Commits
7b90c02b
Commit
7b90c02b
authored
1 year ago
by
Vanja Matija
Browse files
Options
Download
Email Patches
Plain Diff
setup dropbox and update schema for photoItem
parent
58d383bf
Pipeline
#14861
passed with stage
in 37 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
dropbox_oauth/plugin.py
+9
-0
dropbox_oauth/plugin.py
dropbox_oauth/schema.py
+2
-0
dropbox_oauth/schema.py
with
11 additions
and
0 deletions
+11
-0
dropbox_oauth/plugin.py
+
9
-
0
View file @
7b90c02b
...
...
@@ -4,6 +4,7 @@ import json
from
concurrent.futures
import
Future
,
ThreadPoolExecutor
from
threading
import
Condition
,
Lock
from
typing
import
List
,
Type
,
Union
from
datetime
import
datetime
import
requests
from
loguru
import
logger
...
...
@@ -410,6 +411,13 @@ class DropboxOauthPlugin(PluginBase):
exifData
=
image
.
info
[
"exif"
]
photo_item
=
Photo
.
from_bytes
(
dlbytes
)
try
:
creation_time_str
=
datetime
.
strftime
(
file_metadata
.
client_modified
,
"%d/%m/%Y, %H:%M:%S"
)
photo_item
.
creationTime
=
creation_time_str
except
Exception
as
e
:
logger
.
warning
(
"Cannot extract creation time"
,
e
)
try
:
# extract location
location
=
self
.
extractLocationFromImageData
(
exifData
)
...
...
@@ -422,6 +430,7 @@ class DropboxOauthPlugin(PluginBase):
photo_item
.
externalId
=
external_id
photo_item
.
name
=
file_metadata
.
name
photo_item
.
filename
=
file_metadata
.
name
files
.
append
(
photo_item
.
data
)
items
+=
[
photo_item
,
photo_item
.
file
[
0
]]
edges
.
append
(
Edge
(
photo_item
,
photo_item
.
file
[
0
],
"file"
))
...
...
This diff is collapsed.
Click to expand it.
dropbox_oauth/schema.py
+
2
-
0
View file @
7b90c02b
...
...
@@ -121,6 +121,8 @@ class File(HashableItem, Post, File):
class
Photo
(
Photo
,
HashableItem
):
filename
:
Optional
[
str
]
=
None
creationTime
:
Optional
[
str
]
=
None
service
:
Optional
[
str
]
=
SERVICE_NAME
# Edges
folder
:
List
[
"Folder"
]
=
[]
...
...
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