mirror of
https://github.com/idanoo/autobrr
synced 2025-07-23 16:59:12 +00:00
feat(feeds): show next run (#1074)
This commit is contained in:
parent
6fd8626507
commit
a6d789ee44
4 changed files with 31 additions and 5 deletions
|
@ -52,6 +52,7 @@ type Feed struct {
|
|||
Indexerr FeedIndexer `json:"-"`
|
||||
LastRun time.Time `json:"last_run"`
|
||||
LastRunData string `json:"last_run_data"`
|
||||
NextRun time.Time `json:"next_run"`
|
||||
}
|
||||
|
||||
type FeedSettingsJSON struct {
|
||||
|
|
|
@ -91,7 +91,21 @@ func (s *service) FindByIndexerIdentifier(ctx context.Context, indexer string) (
|
|||
}
|
||||
|
||||
func (s *service) Find(ctx context.Context) ([]domain.Feed, error) {
|
||||
return s.repo.Find(ctx)
|
||||
feeds, err := s.repo.Find(ctx)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
for i, feed := range feeds {
|
||||
t, err := s.scheduler.GetNextRun(feedKey{id: feed.ID}.ToString())
|
||||
if err != nil {
|
||||
continue
|
||||
}
|
||||
feed.NextRun = t
|
||||
feeds[i] = feed
|
||||
}
|
||||
|
||||
return feeds, nil
|
||||
}
|
||||
|
||||
func (s *service) GetCacheByID(ctx context.Context, feedId int) ([]domain.FeedCacheItem, error) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue