@@ -144,6 +144,7 @@ func renderPatternTable(cmd *cobra.Command, f *cmdutil.Factory, patterns coredat
|
||||
}
|
||||
|
||||
var linkedIDs []gid.GID
|
||||
|
||||
for _, p := range patterns {
|
||||
if p.CommonThirdPartyID != nil {
|
||||
linkedIDs = append(linkedIDs, *p.CommonThirdPartyID)
|
||||
|
||||
@@ -119,6 +119,7 @@ func newCmdReenrich(f *cmdutil.Factory) *cobra.Command {
|
||||
ctx,
|
||||
func(ctx context.Context, tx pg.Tx) error {
|
||||
var ps coredata.CommonTrackerPatterns
|
||||
|
||||
requeued, err = ps.RequestEnrichmentByIDs(ctx, tx, ids, flagResetEnriched)
|
||||
|
||||
return err
|
||||
@@ -194,6 +195,7 @@ func resolveReenrichIDs(
|
||||
}
|
||||
|
||||
var tps coredata.TrackerPatterns
|
||||
|
||||
ids, err = tps.LoadAllLinkedCommonTrackerPatternIDsByCookieBannerID(ctx, conn, coredata.NewScopeFromObjectID(bannerID), bannerID)
|
||||
|
||||
return err
|
||||
@@ -204,6 +206,7 @@ func resolveReenrichIDs(
|
||||
}
|
||||
|
||||
var tps coredata.TrackerPatterns
|
||||
|
||||
ids, err = tps.LoadAllLinkedCommonTrackerPatternIDsByOrganizationID(ctx, conn, coredata.NewScopeFromObjectID(orgID), orgID)
|
||||
|
||||
return err
|
||||
@@ -218,6 +221,7 @@ func resolveReenrichIDs(
|
||||
}
|
||||
|
||||
var ps coredata.CommonTrackerPatterns
|
||||
|
||||
ids, err = ps.LoadAllIDs(ctx, conn, filter)
|
||||
|
||||
return err
|
||||
@@ -246,6 +250,7 @@ func buildReenrichFilter(
|
||||
}
|
||||
|
||||
filter.WithCommonThirdPartyID(&id)
|
||||
|
||||
hasSelector = true
|
||||
}
|
||||
|
||||
@@ -256,11 +261,13 @@ func buildReenrichFilter(
|
||||
}
|
||||
|
||||
filter.WithTrackerType(&tt)
|
||||
|
||||
hasSelector = true
|
||||
}
|
||||
|
||||
if keyword != "" {
|
||||
filter.WithKeyword(&keyword)
|
||||
|
||||
hasSelector = true
|
||||
}
|
||||
|
||||
@@ -271,6 +278,7 @@ func buildReenrichFilter(
|
||||
}
|
||||
|
||||
filter.WithState(&st)
|
||||
|
||||
hasSelector = true
|
||||
}
|
||||
|
||||
|
||||
@@ -54,11 +54,11 @@ func newCmdStats(f *cmdutil.Factory) *cobra.Command {
|
||||
filter *coredata.CommonTrackerPatternFilter
|
||||
}{
|
||||
{"total", coredata.NewCommonTrackerPatternFilter()},
|
||||
{"queued", coredata.NewCommonTrackerPatternFilter().WithState(refState(coredata.CommonTrackerPatternEnrichmentStateQueued))},
|
||||
{"enriched", coredata.NewCommonTrackerPatternFilter().WithState(refState(coredata.CommonTrackerPatternEnrichmentStateEnriched))},
|
||||
{"unenriched", coredata.NewCommonTrackerPatternFilter().WithState(refState(coredata.CommonTrackerPatternEnrichmentStateUnenriched))},
|
||||
{"linked", coredata.NewCommonTrackerPatternFilter().WithLinked(refBool(true))},
|
||||
{"unlinked", coredata.NewCommonTrackerPatternFilter().WithLinked(refBool(false))},
|
||||
{"queued", coredata.NewCommonTrackerPatternFilter().WithState(new(coredata.CommonTrackerPatternEnrichmentStateQueued))},
|
||||
{"enriched", coredata.NewCommonTrackerPatternFilter().WithState(new(coredata.CommonTrackerPatternEnrichmentStateEnriched))},
|
||||
{"unenriched", coredata.NewCommonTrackerPatternFilter().WithState(new(coredata.CommonTrackerPatternEnrichmentStateUnenriched))},
|
||||
{"linked", coredata.NewCommonTrackerPatternFilter().WithLinked(new(true))},
|
||||
{"unlinked", coredata.NewCommonTrackerPatternFilter().WithLinked(new(false))},
|
||||
}
|
||||
|
||||
for _, c := range counts {
|
||||
@@ -94,11 +94,3 @@ func newCmdStats(f *cmdutil.Factory) *cobra.Command {
|
||||
|
||||
return cmd
|
||||
}
|
||||
|
||||
func refState(s coredata.CommonTrackerPatternEnrichmentState) *coredata.CommonTrackerPatternEnrichmentState {
|
||||
return &s
|
||||
}
|
||||
|
||||
func refBool(b bool) *bool {
|
||||
return &b
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user