history search bugfixes

This commit is contained in:
sawka 2023-03-05 13:53:24 -08:00
parent 56b74f35f3
commit 7516f880ae
2 changed files with 4 additions and 2 deletions

View File

@ -1887,7 +1887,9 @@ func HistoryViewAllCommand(ctx context.Context, pk *scpacket.FeCommandPacketType
opts.FromTs = int64(fromTs)
}
}
opts.NoMeta = resolveBool(pk.Kwargs["meta"], false)
if pk.Kwargs["meta"] != "" {
opts.NoMeta = !resolveBool(pk.Kwargs["meta"], true)
}
if err != nil {
return nil, fmt.Errorf("invalid meta arg (must be boolean): %v", err)
}

View File

@ -247,7 +247,7 @@ func runHistoryQuery(tx *TxWrap, opts HistoryQueryOpts) ([]*HistoryItemType, err
queryArgs = append(queryArgs, "%"+likeArg+"%")
}
if opts.FromTs > 0 {
whereClause += fmt.Sprintf(" AND ts > %d", opts.FromTs)
whereClause += fmt.Sprintf(" AND ts <= %d", opts.FromTs)
}
if opts.RemoteId != "" {
whereClause += fmt.Sprintf(" AND remoteid = '%s'", opts.RemoteId)