From a5fff37ba0ed17b775775346474c5f1fc948442b Mon Sep 17 00:00:00 2001 From: Bel LaPointe Date: Thu, 17 Feb 2022 12:15:21 -0700 Subject: [PATCH] put with readonly uses put value --- crawler/main.sh | 4 ++++ crawler/notes.sh | 1 + server/leaf.go | 1 + 3 files changed, 6 insertions(+) diff --git a/crawler/main.sh b/crawler/main.sh index 82af7ea..e36b96b 100644 --- a/crawler/main.sh +++ b/crawler/main.sh @@ -148,6 +148,10 @@ crawl_with() { echo "$sum" )" ID="${ID%/}" + if [ "${#expanded[@]}" == 1 ]; then + ID="$pid" + CONTENT="$(printf "%s\n\n%s", "$crawlable_source" "$CONTENT")" + fi log " $ID ($TITLE): ${#CONTENT}" push_crawled "$ID" "$TITLE" "$CONTENT" log " /$ID ($TITLE): ${#CONTENT}" diff --git a/crawler/notes.sh b/crawler/notes.sh index a1e1b58..2b5b247 100644 --- a/crawler/notes.sh +++ b/crawler/notes.sh @@ -106,6 +106,7 @@ notes() ( _nncurl \ -X PUT \ -H "Title: $title" \ + -H "Read-Only: true" \ -d "$body" \ $NOTES_ADDR/api/v0/files/$id >&2 } diff --git a/server/leaf.go b/server/leaf.go index 5c2d0ad..67c0769 100644 --- a/server/leaf.go +++ b/server/leaf.go @@ -62,6 +62,7 @@ func (base Leaf) Merge(updated Leaf) Leaf { base.Meta.Title = "Untitled" } base.Meta.Deleted = updated.Meta.Deleted + base.Meta.ReadOnly = updated.Meta.ReadOnly base.Content = updated.Content return base }