mirror of
https://github.com/idanoo/autobrr
synced 2025-07-23 16:59:12 +00:00
feat(lists): add option to skip cleaning of Plaintext data (#2036)
* Added: Plaintext untouched * Revert "Added: Plaintext untouched" This reverts commit e6ceaec5f4776cfc8335ae2c02e1caa4a2bbb0bc. * Added: skipCleanSanitize * TS definition for List object doesn't yet know about the new skip_clean_sanitize property * Update: ListForms.tsx with the bypass option * Update: Database internals for skip_clean_sanitize * Fix: Snake case
This commit is contained in:
parent
9caf7807de
commit
4ce2241991
7 changed files with 49 additions and 12 deletions
|
@ -44,6 +44,7 @@ func (r *ListRepo) List(ctx context.Context) ([]*domain.List, error) {
|
|||
"tags_excluded",
|
||||
"include_unmonitored",
|
||||
"include_alternate_titles",
|
||||
"skip_clean_sanitize",
|
||||
"last_refresh_time",
|
||||
"last_refresh_status",
|
||||
"last_refresh_data",
|
||||
|
@ -73,7 +74,7 @@ func (r *ListRepo) List(ctx context.Context) ([]*domain.List, error) {
|
|||
var lastRefreshTime sql.Null[time.Time]
|
||||
var clientID sql.Null[int]
|
||||
|
||||
err = rows.Scan(&list.ID, &list.Name, &list.Enabled, &list.Type, &clientID, &url, pq.Array(&list.Headers), &list.APIKey, &list.MatchRelease, pq.Array(&list.TagsInclude), pq.Array(&list.TagsExclude), &list.IncludeUnmonitored, &list.IncludeAlternateTitles, &lastRefreshTime, &lastRefreshStatus, &lastRefreshData, &list.CreatedAt, &list.UpdatedAt)
|
||||
err = rows.Scan(&list.ID, &list.Name, &list.Enabled, &list.Type, &clientID, &url, pq.Array(&list.Headers), &list.APIKey, &list.MatchRelease, pq.Array(&list.TagsInclude), pq.Array(&list.TagsExclude), &list.IncludeUnmonitored, &list.IncludeAlternateTitles, &list.SkipCleanSanitize, &lastRefreshTime, &lastRefreshStatus, &lastRefreshData, &list.CreatedAt, &list.UpdatedAt)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
@ -107,6 +108,7 @@ func (r *ListRepo) FindByID(ctx context.Context, listID int64) (*domain.List, er
|
|||
"tags_excluded",
|
||||
"include_unmonitored",
|
||||
"include_alternate_titles",
|
||||
"skip_clean_sanitize",
|
||||
"last_refresh_time",
|
||||
"last_refresh_status",
|
||||
"last_refresh_data",
|
||||
|
@ -135,7 +137,7 @@ func (r *ListRepo) FindByID(ctx context.Context, listID int64) (*domain.List, er
|
|||
var url, apiKey sql.Null[string]
|
||||
var clientID sql.Null[int]
|
||||
|
||||
err = row.Scan(&list.ID, &list.Name, &list.Enabled, &list.Type, &clientID, &url, pq.Array(&list.Headers), &list.APIKey, &list.MatchRelease, pq.Array(&list.TagsInclude), pq.Array(&list.TagsExclude), &list.IncludeUnmonitored, &list.IncludeAlternateTitles, &list.LastRefreshTime, &list.LastRefreshStatus, &list.LastRefreshData, &list.CreatedAt, &list.UpdatedAt)
|
||||
err = row.Scan(&list.ID, &list.Name, &list.Enabled, &list.Type, &clientID, &url, pq.Array(&list.Headers), &list.APIKey, &list.MatchRelease, pq.Array(&list.TagsInclude), pq.Array(&list.TagsExclude), &list.IncludeUnmonitored, &list.IncludeAlternateTitles, &list.SkipCleanSanitize, &list.LastRefreshTime, &list.LastRefreshStatus, &list.LastRefreshData, &list.CreatedAt, &list.UpdatedAt)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
@ -169,6 +171,7 @@ func (r *ListRepo) Store(ctx context.Context, list *domain.List) error {
|
|||
"tags_excluded",
|
||||
"include_unmonitored",
|
||||
"include_alternate_titles",
|
||||
"skip_clean_sanitize",
|
||||
).
|
||||
Values(
|
||||
list.Name,
|
||||
|
@ -183,6 +186,7 @@ func (r *ListRepo) Store(ctx context.Context, list *domain.List) error {
|
|||
pq.Array(list.TagsExclude),
|
||||
list.IncludeUnmonitored,
|
||||
list.IncludeAlternateTitles,
|
||||
list.SkipCleanSanitize,
|
||||
).Suffix("RETURNING id").RunWith(tx)
|
||||
|
||||
//query, args, err := qb.ToSql()
|
||||
|
@ -226,6 +230,7 @@ func (r *ListRepo) Update(ctx context.Context, list *domain.List) error {
|
|||
Set("tags_excluded", pq.Array(list.TagsExclude)).
|
||||
Set("include_unmonitored", list.IncludeUnmonitored).
|
||||
Set("include_alternate_titles", list.IncludeAlternateTitles).
|
||||
Set("skip_clean_sanitize", list.SkipCleanSanitize).
|
||||
Set("updated_at", sq.Expr("CURRENT_TIMESTAMP")).
|
||||
Where(sq.Eq{"id": list.ID})
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue