diff options
author | Cédric Bonhomme <cedric@cedricbonhomme.org> | 2017-06-01 23:41:57 +0200 |
---|---|---|
committer | Cédric Bonhomme <cedric@cedricbonhomme.org> | 2017-06-01 23:41:57 +0200 |
commit | de239ffba0d6954fc39a34e3c73110aea4e0afbb (patch) | |
tree | 5790aeb5e82f78d7722013840cd605021e6df7ca /src/web/views/bookmark.py | |
parent | Updated translations. (diff) | |
download | newspipe-de239ffba0d6954fc39a34e3c73110aea4e0afbb.tar.gz newspipe-de239ffba0d6954fc39a34e3c73110aea4e0afbb.tar.bz2 newspipe-de239ffba0d6954fc39a34e3c73110aea4e0afbb.zip |
Bookmarklet now get the title of the document.
Diffstat (limited to 'src/web/views/bookmark.py')
-rw-r--r-- | src/web/views/bookmark.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/web/views/bookmark.py b/src/web/views/bookmark.py index e7a4181e..31026405 100644 --- a/src/web/views/bookmark.py +++ b/src/web/views/bookmark.py @@ -203,6 +203,10 @@ def bookmarklet(): if not href: flash(gettext("Couldn't add bookmark: url missing."), "error") raise BadRequest("url is missing") + title = (request.args if request.method == 'GET' else request.form)\ + .get('title', None) + if not title: + title = href bookmark_exists = bookmark_contr.read(**{'href': href}).all() if bookmark_exists: @@ -213,7 +217,7 @@ def bookmarklet(): bookmark_attr = {'href': href, 'description': '', - 'title': href, + 'title': title, 'shared': False, 'to_read': True} |