Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
eolie
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
6
Issues
6
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
World
eolie
Commits
5166932d
Commit
5166932d
authored
Feb 09, 2019
by
Cédric Bellegarde
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update guid if uri match
parent
a4a71da9
Pipeline
#57691
passed with stage
in 10 minutes and 13 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
16 deletions
+33
-16
database_bookmarks.py
eolie/database_bookmarks.py
+11
-0
firefox_sync.py
eolie/firefox_sync.py
+22
-16
No files found.
eolie/database_bookmarks.py
View file @
5166932d
...
...
@@ -527,6 +527,17 @@ class DatabaseBookmarks:
return
v
[
0
]
return
5
def
set_guid
(
self
,
bookmark_id
,
guid
):
"""
Set bookmark guid
@param bookmark_id as int
@param guid as str
"""
with
SqlCursor
(
self
)
as
sql
:
sql
.
execute
(
"UPDATE bookmarks
\
SET guid=?
\
WHERE rowid=?"
,
(
bookmark_id
,
guid
))
def
set_title
(
self
,
bookmark_id
,
title
):
"""
Set bookmark title
...
...
eolie/firefox_sync.py
View file @
5166932d
...
...
@@ -597,23 +597,8 @@ class SyncWorker:
elif
"type"
in
bookmark
.
keys
()
and
bookmark
[
"type"
]
==
"bookmark"
\
and
bookmark
[
"id"
]
is
not
None
\
and
bookmark
[
"title"
]:
# Add a new bookmark
if
bookmark_id
is
None
:
# Use parent name if no bookmarks tags
if
"tags"
not
in
bookmark
.
keys
()
or
\
not
bookmark
[
"tags"
]:
if
"parentName"
in
bookmark
.
keys
()
and
\
bookmark
[
"parentName"
]:
bookmark
[
"tags"
]
=
[
bookmark
[
"parentName"
]]
else
:
bookmark
[
"tags"
]
=
[]
bookmark_id
=
App
()
.
bookmarks
.
add
(
bookmark
[
"title"
],
bookmark
[
"bmkUri"
],
bookmark
[
"id"
],
bookmark
[
"tags"
],
0
)
# Update bookmark
els
e
:
if
bookmark_id
is
not
Non
e
:
App
()
.
bookmarks
.
set_title
(
bookmark_id
,
bookmark
[
"title"
])
App
()
.
bookmarks
.
set_uri
(
bookmark_id
,
...
...
@@ -637,6 +622,27 @@ class SyncWorker:
tag_id
=
App
()
.
bookmarks
.
add_tag
(
tag
)
App
()
.
bookmarks
.
add_tag_to
(
tag_id
,
bookmark_id
)
# Add a new bookmark
else
:
bookmark_id
=
App
()
.
bookmarks
.
get_id
(
bookmark
[
"bmkUri"
])
# Add a new bookmark
if
bookmark_id
is
None
:
# Use parent name if no bookmarks tags
if
"tags"
not
in
bookmark
.
keys
()
or
\
not
bookmark
[
"tags"
]:
if
"parentName"
in
bookmark
.
keys
()
and
\
bookmark
[
"parentName"
]:
bookmark
[
"tags"
]
=
[
bookmark
[
"parentName"
]]
else
:
bookmark
[
"tags"
]
=
[]
bookmark_id
=
App
()
.
bookmarks
.
add
(
bookmark
[
"title"
],
bookmark
[
"bmkUri"
],
bookmark
[
"id"
],
bookmark
[
"tags"
],
0
)
else
:
# Update guid
App
()
.
bookmarks
.
set_guid
(
bookmark_id
,
bookmark
[
"id"
])
# Update parent name if available
if
bookmark_id
is
not
None
and
"parentName"
in
bookmark
.
keys
():
App
()
.
bookmarks
.
set_parent
(
bookmark_id
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a 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