mirror of
https://github.com/idanoo/autobrr
synced 2025-07-23 00:39:13 +00:00
feat(filters): show enabled and disabled actions in list view (#1304)
* feat(filters): reflect enabled actions * dont store release unless enabled action found * store the release after the delay * add new parameter to FindByFilterID method
This commit is contained in:
parent
95cd053db5
commit
6e12654f6a
11 changed files with 59 additions and 45 deletions
|
@ -214,7 +214,7 @@ func TestActionRepo_FindByFilterID(t *testing.T) {
|
|||
assert.NoError(t, err)
|
||||
|
||||
// Actual test for FindByFilterID
|
||||
actions, err := repo.FindByFilterID(context.Background(), createdFilters[0].ID)
|
||||
actions, err := repo.FindByFilterID(context.Background(), createdFilters[0].ID, nil)
|
||||
assert.NoError(t, err)
|
||||
assert.NotNil(t, actions)
|
||||
assert.Equal(t, 1, len(actions))
|
||||
|
@ -235,7 +235,7 @@ func TestActionRepo_FindByFilterID(t *testing.T) {
|
|||
assert.NotNil(t, createdFilters)
|
||||
|
||||
// Actual test for FindByFilterID
|
||||
actions, err := repo.FindByFilterID(context.Background(), createdFilters[0].ID)
|
||||
actions, err := repo.FindByFilterID(context.Background(), createdFilters[0].ID, nil)
|
||||
assert.NoError(t, err)
|
||||
assert.Equal(t, 0, len(actions))
|
||||
|
||||
|
@ -244,7 +244,7 @@ func TestActionRepo_FindByFilterID(t *testing.T) {
|
|||
})
|
||||
|
||||
t.Run(fmt.Sprintf("FindByFilterID_Succeeds_With_Invalid_FilterID [%s]", dbType), func(t *testing.T) {
|
||||
actions, err := repo.FindByFilterID(context.Background(), 9999) // 9999 is an invalid filter ID
|
||||
actions, err := repo.FindByFilterID(context.Background(), 9999, nil) // 9999 is an invalid filter ID
|
||||
assert.NoError(t, err)
|
||||
assert.NotNil(t, actions)
|
||||
assert.Equal(t, 0, len(actions))
|
||||
|
@ -254,7 +254,7 @@ func TestActionRepo_FindByFilterID(t *testing.T) {
|
|||
ctx, cancel := context.WithTimeout(context.Background(), 1*time.Nanosecond)
|
||||
defer cancel()
|
||||
|
||||
actions, err := repo.FindByFilterID(ctx, 1)
|
||||
actions, err := repo.FindByFilterID(ctx, 1, nil)
|
||||
assert.Error(t, err)
|
||||
assert.Nil(t, actions)
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue