Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a606b79736 | ||
|
|
87559997a9 | ||
|
|
b641f7d516 | ||
|
|
b117aea7f0 |
+14
@@ -10,6 +10,20 @@ steps:
|
||||
- go generate ./...
|
||||
- go test -v ./...
|
||||
|
||||
# - name: postgres-migrate
|
||||
# image: golang:1.15
|
||||
# depends_on: []
|
||||
# environment:
|
||||
# DB_CONNECT:
|
||||
# from_secret: db_connect
|
||||
# commands:
|
||||
# - go get -u github.com/pressly/goose/...
|
||||
# - cd migrations/postgres
|
||||
# - goose postgres "$DB_CONNECT" up
|
||||
# when:
|
||||
# event:
|
||||
# - tag
|
||||
|
||||
- name: docker-release-tag
|
||||
image: plugins/docker
|
||||
settings:
|
||||
|
||||
@@ -38,6 +38,10 @@ func (r *channelRepository) List(ctx context.Context, filter models.ChannelFilte
|
||||
params.FilterEventName = true
|
||||
params.EventName = *filter.EventName
|
||||
}
|
||||
if filter.Logged != nil {
|
||||
params.FilterLogged = true
|
||||
params.Logged = *filter.Logged
|
||||
}
|
||||
if filter.Limit > 0 {
|
||||
params.LimitSize = int32(filter.Limit)
|
||||
}
|
||||
|
||||
@@ -53,7 +53,7 @@ func (r *commentRepository) Insert(ctx context.Context, comment models.Comment)
|
||||
CharacterID: comment.CharacterID,
|
||||
Subject: comment.Subject,
|
||||
Author: comment.Author,
|
||||
CharacterName: comment.CharacterID,
|
||||
CharacterName: comment.CharacterName,
|
||||
Source: comment.Source,
|
||||
CreatedDate: comment.CreatedDate.UTC(),
|
||||
FictionalDate: comment.FictionalDate.UTC(),
|
||||
@@ -73,7 +73,8 @@ func (r *commentRepository) Update(ctx context.Context, comment models.Comment,
|
||||
Subject: comment.Subject,
|
||||
Source: comment.Source,
|
||||
FictionalDate: comment.FictionalDate.UTC(),
|
||||
CharacterName: comment.ChapterID,
|
||||
EditedDate: comment.EditedDate.UTC(),
|
||||
CharacterName: comment.CharacterName,
|
||||
CharacterID: comment.CharacterID,
|
||||
ID: comment.ID,
|
||||
})
|
||||
|
||||
@@ -14,6 +14,7 @@ UPDATE story_comment
|
||||
SET subject = @subject,
|
||||
source = @source,
|
||||
fictional_date = @fictional_date,
|
||||
edited_date = @edited_date,
|
||||
character_name = @character_name,
|
||||
character_id = @character_id
|
||||
WHERE id = @id;
|
||||
|
||||
@@ -16,18 +16,17 @@ func TSQueryFromSearch(search string) string {
|
||||
clearQuotes := false
|
||||
startQuotes := false
|
||||
|
||||
if strings.HasPrefix(token, "\"") {
|
||||
if len(token) > 1 {
|
||||
token = token[1:]
|
||||
}
|
||||
if strings.HasPrefix(token, "\"") && len(token) > 1 {
|
||||
startQuotes = true
|
||||
}
|
||||
if strings.HasSuffix(token, "\"") {
|
||||
token = token[:len(token)-1]
|
||||
startQuotes = false
|
||||
if !startQuotes {
|
||||
clearQuotes = true
|
||||
}
|
||||
|
||||
startQuotes = false
|
||||
}
|
||||
|
||||
token := strings.Trim(token, ",.;:()\"")
|
||||
if len(token) > 0 {
|
||||
if startQuotes {
|
||||
|
||||
@@ -13,6 +13,7 @@ func TestTSQueryFromSearch(t *testing.T) {
|
||||
{`"asari matron" blue`, `(asari<->matron) & blue`},
|
||||
{`"christmas present" "wrapping paper"`, `(christmas<->present) & (wrapping<->paper)`},
|
||||
{`stuff`, `stuff`},
|
||||
{`"stuff"`, `stuff`},
|
||||
{`"her slowly, rubbing the back of his head awkwardly. "`, `(her<->slowly<->rubbing<->the<->back<->of<->his<->head<->awkwardly)`},
|
||||
}
|
||||
|
||||
|
||||
@@ -32,6 +32,7 @@ func (comment *Comment) ApplyUpdate(update CommentUpdate) {
|
||||
if update.FictionalDate != nil {
|
||||
comment.FictionalDate = *update.FictionalDate
|
||||
}
|
||||
comment.EditedDate = time.Now()
|
||||
}
|
||||
|
||||
// IsChangeObject is an interface implementation to identify it as a valid
|
||||
|
||||
@@ -857,6 +857,10 @@ func (s *LogService) NextLogs(ctx context.Context, log *models.Log) ([]*models.L
|
||||
return logs[i].Date.Before(logs[j].Date)
|
||||
})
|
||||
|
||||
if len(logs) >= 1 && logs[0].ID == log.ID {
|
||||
logs = logs[1:]
|
||||
}
|
||||
|
||||
return s.findSuggestions(ctx, log, logs)
|
||||
}
|
||||
|
||||
@@ -868,6 +872,10 @@ func (s *LogService) PrevLogs(ctx context.Context, log *models.Log) ([]*models.L
|
||||
return nil, err
|
||||
}
|
||||
|
||||
if len(logs) >= 1 && logs[0].ID == log.ID {
|
||||
logs = logs[1:]
|
||||
}
|
||||
|
||||
return s.findSuggestions(ctx, log, logs)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user