generated from alecodes/base-template
fead: expand archive options
add an option to select how to archive the entries add an option for what entries to archive change the concurrentcy limit to a semaphore instead of a ticker
This commit is contained in:
parent
1788241cd5
commit
b0506c3eab
9 changed files with 99 additions and 72 deletions
|
|
@ -52,6 +52,18 @@ func (ld *Linkding) Archive(url string) error {
|
|||
TagNames: bookmark.TagNames,
|
||||
}
|
||||
|
||||
switch ld.ServiceConfig.Method {
|
||||
case ServiceArchiveMethodArchive:
|
||||
payload.IsArchived = true
|
||||
case ServiceArchiveMethodSeen:
|
||||
payload.Unread = false
|
||||
case ServiceArchiveMethodBoth:
|
||||
payload.Unread = false
|
||||
payload.IsArchived = true
|
||||
default:
|
||||
return fmt.Errorf("Archive method is invalid")
|
||||
}
|
||||
|
||||
if payload.TagNames == nil {
|
||||
payload.TagNames = []string{}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue