Skip to content

Commit

Permalink
Merge pull request #189 from kounoike:feature/interactive-auto-search
Browse files Browse the repository at this point in the history
自動検索UIの大改造と自動検索削除機能実装
  • Loading branch information
kounoike authored May 6, 2023
2 parents ef626d4 + 13a72ee commit 8409365
Show file tree
Hide file tree
Showing 34 changed files with 1,127 additions and 314 deletions.
2 changes: 1 addition & 1 deletion .devcontainer/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ services:
TZ: Asia/Tokyo
TS_HOSTNAME: tv-dev
meilisearch:
image: getmeili/meilisearch:prototype-japanese-1
image: getmeili/meilisearch:prototype-japanese-2
volumes:
- /qnap/video/develop/meili:/melili_data:rw
ports:
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ WebへのアクセスのためにはTailscaleにサインアップして、ク
- Read Messages/View Channels
- Send Messages
- Send Messages in Threads
- Manage Threads
- Read Message History
- Add Reactions
14. 一番下の GENERATED URL の Copy ボタンを押して URL をコピーします
Expand Down
4 changes: 2 additions & 2 deletions cmd/bot.go
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ func (c *BotCommand) Execute(ctx context.Context, f *flag.FlagSet, args ...inter
return subcommands.ExitFailure
}

usecase, err := dtv.NewDTVUsecase(config, asynqClient, asynqInspector, discordClient, mirakcClient, scheduler, queries, discordLogger, config.Match.KanaMatch, config.Match.FuzzyMatch, gptClient, meiliClient)
usecase, err := dtv.NewDTVUsecase(config, asynqClient, asynqInspector, discordClient, mirakcClient, scheduler, queries, discordLogger, gptClient, meiliClient)
if err != nil {
logger.Error("can't create DTVUsecase", zap.Error(err))
return subcommands.ExitFailure
Expand All @@ -246,7 +246,7 @@ func (c *BotCommand) Execute(ctx context.Context, f *flag.FlagSet, args ...inter
logMessage := fmt.Sprintf("起動しました。\ndtv-discord-go version:%s\nmirakc version:%s\n", "v"+c.version, mirakcVersion.Current)
discordClient.SendMessage(discord.InformationCategory, discord.LogChannel, logMessage)

discordHandler := discord_handler.NewDiscordHandler(usecase, discordClient.Session(), logger)
discordHandler := discord_handler.NewDiscordHandler(usecase, discordClient, discordClient.Session(), logger)

err = usecase.InitializeServiceChannels(ctx)
if err != nil {
Expand Down
4 changes: 0 additions & 4 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,6 @@ type Config struct {
ScriptPath string `required:"true" env:"TRANSCRIPTION_SCRIPT_PATH"`
ModelSize string `required:"true" env:"TRANSCRIPTION_MODEL_SIZE"`
}
Match struct {
KanaMatch bool `default:"true" env:"KANA_MATCH"`
FuzzyMatch bool `default:"true" env:"FUZZY_MATCH"`
}
OpenAI struct {
Enabled bool `default:"false" env:"PARSE_TITLE_WITH_GPT"`
Token string `default:"" env:"OPENAI_TOKEN"`
Expand Down
163 changes: 163 additions & 0 deletions db/auto_search.sql.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

95 changes: 95 additions & 0 deletions db/auto_search_found_message.sql.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

49 changes: 49 additions & 0 deletions db/auto_search_message.sql.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion db/component_version.sql.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion db/db.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion db/discord_server.sql.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion db/encode_task.sql.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions db/migrations/20230504225800-create-auto_search_found_message.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
CREATE TABLE IF NOT EXISTS `auto_search_found_message` (
`id` INT UNSIGNED NOT NULL AUTO_INCREMENT,
`thread_id` TEXT NOT NULL,
`program_id` BIGINT UNSIGNED NOT NULL,
`message_id` TEXT NOT NULL,
`created_at` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
`updated_at` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`id`),
INDEX `auto_search_found_message_message_id_idx` (`message_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
Loading

0 comments on commit 8409365

Please sign in to comment.