Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve bookmark metadata formatting for Netscape exports #1857

Merged
merged 2 commits into from
Sep 24, 2022

Conversation

virtualtam
Copy link
Member

Changed

  • When a bookmark's update date is set, set the LAST_MODIFIED attribute
  • Ensure the PRIVATE attribute contains an integer value

Diff

Default bookmarks exported from the current master version (extract with <DT><A> elements):

<DT><A HREF="/shaare/f6PbvA" ADD_DATE="1654256014" PRIVATE="" TAGS="shaarli,help">Shaarli - The personal, minimalist, super-fast, database free, bookmarking service</A>
<DT><A HREF="/shaare/poWYsQ" ADD_DATE="1654256014" PRIVATE="1" TAGS="shaarli,help">Note: Shaare descriptions</A>
<DT><A HREF="https://www.youtube.com/watch?v=DVEUcbPkb-c" ADD_DATE="1654256014" PRIVATE="1" TAGS="shaarli,help,thumbnail">Calm Jazz Music - YouTube (private bookmark with thumbnail demo)</A>

Default bookmarks exported from the PR branch (extract with <DT><A> elements):

<DT><A HREF="/shaare/WJe-Cw" ADD_DATE="1654255845" PRIVATE="0" TAGS="shaarli,help">Shaarli - The personal, minimalist, super-fast, database free, bookmarking service</A>
<DT><A HREF="/shaare/gbH9Bg" ADD_DATE="1654255845" PRIVATE="1" TAGS="shaarli,help">Note: Shaare descriptions</A>
<DT><A HREF="https://www.youtube.com/watch?v=DVEUcbPkb-c" ADD_DATE="1654255845" LAST_MODIFIED="1654255845" PRIVATE="1" TAGS="shaarli,help,thumbnail">Calm Jazz Music - YouTube (private bookmark with thumbnail demo)</A>

Signed-off-by: VirtualTam <virtualtam@flibidi.net>
Signed-off-by: VirtualTam <virtualtam@flibidi.net>
Copy link
Member

@nodiscc nodiscc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

  • How does this affect re-importing bookmarks with LAST_MODIFIED attribute set into Shaarli? I don't think it is considered at all during import [1]), so no impact?
  • How does this affect importing HTML exports to a web browser? For example does Firefox import this attribute/date as last modification time in its bookmarks db?

@virtualtam
Copy link
Member Author

How does this affect re-importing bookmarks with LAST_MODIFIED attribute set into Shaarli?
I don't think it is considered at all during import [1]), so no impact?

AFAIK the LAST_MODIFIED field is mostly used by Web browsers, and is present in the test input data for NetscapeBookmarkParser:

The parser itself (and as you mention, the Shaarli import utility) does not handle this attribute, so adding it to the Netscape-formatted exports would have no change when re-importing.

How does this affect importing HTML exports to a web browser? For example does Firefox import this attribute/date as last modification time in its bookmarks db?

My guess would be that this makes no difference from a user's point of view, as creation and update dates are not visible from eg Firefox's bookmark list. This would require some testing with different browsers though, as I'm not sure how metadata is handled when re-importing bookmarks.

@virtualtam virtualtam merged commit 6180c85 into shaarli:master Sep 24, 2022
@virtualtam virtualtam deleted the export branch September 24, 2022 13:00
@virtualtam
Copy link
Member Author

Thanks for the reviews 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants