mirror of
https://github.com/sissbruecker/linkding.git
synced 2025-08-08 03:08:29 +02:00
Prefer local snapshot over web archive link in bookmark list links (#1021)
* Prefer local snapshot over web archive link * Update latest snapshot when it is deleted * fix filter in migration * improve migration performance
This commit is contained in:
@@ -130,11 +130,20 @@ class BookmarkItem:
|
||||
self.description = bookmark.resolved_description
|
||||
self.notes = bookmark.notes
|
||||
self.tag_names = bookmark.tag_names
|
||||
self.web_archive_snapshot_url = bookmark.web_archive_snapshot_url
|
||||
if not self.web_archive_snapshot_url:
|
||||
self.web_archive_snapshot_url = generate_fallback_webarchive_url(
|
||||
bookmark.url, bookmark.date_added
|
||||
if bookmark.latest_snapshot_id:
|
||||
self.snapshot_url = reverse(
|
||||
"linkding:assets.view", args=[bookmark.latest_snapshot_id]
|
||||
)
|
||||
self.snapshot_title = "View latest snapshot"
|
||||
else:
|
||||
self.snapshot_url = bookmark.web_archive_snapshot_url
|
||||
self.snapshot_title = (
|
||||
"View snapshot on the Internet Archive Wayback Machine"
|
||||
)
|
||||
if not self.snapshot_url:
|
||||
self.snapshot_url = generate_fallback_webarchive_url(
|
||||
bookmark.url, bookmark.date_added
|
||||
)
|
||||
self.favicon_file = bookmark.favicon_file
|
||||
self.preview_image_file = bookmark.preview_image_file
|
||||
self.is_archived = bookmark.is_archived
|
||||
|
Reference in New Issue
Block a user