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:
Alexander Navarro 2024-12-20 14:59:43 -03:00
parent 1788241cd5
commit b0506c3eab
9 changed files with 99 additions and 72 deletions

View file

@ -5,11 +5,14 @@ import (
mfApi "miniflux.app/v2/client"
)
type Filter = mfApi.Filter
type MinifluxConfig struct {
Host string
User string
Token string
FeedId int64
Host string
User string
Token string
FeedId int64
FeedFilter *Filter
}
type Miniflux struct {
@ -18,11 +21,13 @@ type Miniflux struct {
}
func (mf *Miniflux) GetEntries() (*mfApi.EntryResultSet, error) {
filter := &mfApi.Filter{
Statuses: []string{mfApi.EntryStatusRead, mfApi.EntryStatusRemoved},
}
mf.FeedFilter.Statuses = []string{mfApi.EntryStatusRead, mfApi.EntryStatusRemoved}
return mf.client.FeedEntries(mf.FeedId, filter)
if mf.FeedId == -1 {
return mf.client.Entries(mf.FeedFilter)
} else {
return mf.client.FeedEntries(mf.FeedId, mf.FeedFilter)
}
}
func NewMiniflux(config MinifluxConfig) (*Miniflux, error) {