Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a606b79736 | ||
|
|
87559997a9 | ||
|
|
b641f7d516 | ||
|
|
b117aea7f0 |
+15
-1
@@ -10,6 +10,20 @@ steps:
|
|||||||
- go generate ./...
|
- go generate ./...
|
||||||
- go test -v ./...
|
- 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
|
- name: docker-release-tag
|
||||||
image: plugins/docker
|
image: plugins/docker
|
||||||
settings:
|
settings:
|
||||||
@@ -36,4 +50,4 @@ steps:
|
|||||||
registry: r.vmaple.dev
|
registry: r.vmaple.dev
|
||||||
when:
|
when:
|
||||||
event:
|
event:
|
||||||
- tag
|
- tag
|
||||||
|
|||||||
@@ -38,6 +38,10 @@ func (r *channelRepository) List(ctx context.Context, filter models.ChannelFilte
|
|||||||
params.FilterEventName = true
|
params.FilterEventName = true
|
||||||
params.EventName = *filter.EventName
|
params.EventName = *filter.EventName
|
||||||
}
|
}
|
||||||
|
if filter.Logged != nil {
|
||||||
|
params.FilterLogged = true
|
||||||
|
params.Logged = *filter.Logged
|
||||||
|
}
|
||||||
if filter.Limit > 0 {
|
if filter.Limit > 0 {
|
||||||
params.LimitSize = int32(filter.Limit)
|
params.LimitSize = int32(filter.Limit)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ func (r *commentRepository) Insert(ctx context.Context, comment models.Comment)
|
|||||||
CharacterID: comment.CharacterID,
|
CharacterID: comment.CharacterID,
|
||||||
Subject: comment.Subject,
|
Subject: comment.Subject,
|
||||||
Author: comment.Author,
|
Author: comment.Author,
|
||||||
CharacterName: comment.CharacterID,
|
CharacterName: comment.CharacterName,
|
||||||
Source: comment.Source,
|
Source: comment.Source,
|
||||||
CreatedDate: comment.CreatedDate.UTC(),
|
CreatedDate: comment.CreatedDate.UTC(),
|
||||||
FictionalDate: comment.FictionalDate.UTC(),
|
FictionalDate: comment.FictionalDate.UTC(),
|
||||||
@@ -73,7 +73,8 @@ func (r *commentRepository) Update(ctx context.Context, comment models.Comment,
|
|||||||
Subject: comment.Subject,
|
Subject: comment.Subject,
|
||||||
Source: comment.Source,
|
Source: comment.Source,
|
||||||
FictionalDate: comment.FictionalDate.UTC(),
|
FictionalDate: comment.FictionalDate.UTC(),
|
||||||
CharacterName: comment.ChapterID,
|
EditedDate: comment.EditedDate.UTC(),
|
||||||
|
CharacterName: comment.CharacterName,
|
||||||
CharacterID: comment.CharacterID,
|
CharacterID: comment.CharacterID,
|
||||||
ID: comment.ID,
|
ID: comment.ID,
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ UPDATE story_comment
|
|||||||
SET subject = @subject,
|
SET subject = @subject,
|
||||||
source = @source,
|
source = @source,
|
||||||
fictional_date = @fictional_date,
|
fictional_date = @fictional_date,
|
||||||
|
edited_date = @edited_date,
|
||||||
character_name = @character_name,
|
character_name = @character_name,
|
||||||
character_id = @character_id
|
character_id = @character_id
|
||||||
WHERE id = @id;
|
WHERE id = @id;
|
||||||
|
|||||||
@@ -16,16 +16,15 @@ func TSQueryFromSearch(search string) string {
|
|||||||
clearQuotes := false
|
clearQuotes := false
|
||||||
startQuotes := false
|
startQuotes := false
|
||||||
|
|
||||||
if strings.HasPrefix(token, "\"") {
|
if strings.HasPrefix(token, "\"") && len(token) > 1 {
|
||||||
if len(token) > 1 {
|
|
||||||
token = token[1:]
|
|
||||||
}
|
|
||||||
startQuotes = true
|
startQuotes = true
|
||||||
}
|
}
|
||||||
if strings.HasSuffix(token, "\"") {
|
if strings.HasSuffix(token, "\"") {
|
||||||
token = token[:len(token)-1]
|
if !startQuotes {
|
||||||
|
clearQuotes = true
|
||||||
|
}
|
||||||
|
|
||||||
startQuotes = false
|
startQuotes = false
|
||||||
clearQuotes = true
|
|
||||||
}
|
}
|
||||||
|
|
||||||
token := strings.Trim(token, ",.;:()\"")
|
token := strings.Trim(token, ",.;:()\"")
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ func TestTSQueryFromSearch(t *testing.T) {
|
|||||||
{`"asari matron" blue`, `(asari<->matron) & blue`},
|
{`"asari matron" blue`, `(asari<->matron) & blue`},
|
||||||
{`"christmas present" "wrapping paper"`, `(christmas<->present) & (wrapping<->paper)`},
|
{`"christmas present" "wrapping paper"`, `(christmas<->present) & (wrapping<->paper)`},
|
||||||
{`stuff`, `stuff`},
|
{`stuff`, `stuff`},
|
||||||
|
{`"stuff"`, `stuff`},
|
||||||
{`"her slowly, rubbing the back of his head awkwardly. "`, `(her<->slowly<->rubbing<->the<->back<->of<->his<->head<->awkwardly)`},
|
{`"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 {
|
if update.FictionalDate != nil {
|
||||||
comment.FictionalDate = *update.FictionalDate
|
comment.FictionalDate = *update.FictionalDate
|
||||||
}
|
}
|
||||||
|
comment.EditedDate = time.Now()
|
||||||
}
|
}
|
||||||
|
|
||||||
// IsChangeObject is an interface implementation to identify it as a valid
|
// 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)
|
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)
|
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
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if len(logs) >= 1 && logs[0].ID == log.ID {
|
||||||
|
logs = logs[1:]
|
||||||
|
}
|
||||||
|
|
||||||
return s.findSuggestions(ctx, log, logs)
|
return s.findSuggestions(ctx, log, logs)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user