mirror of
https://github.com/truewhile/MeBox.git
synced 2026-10-07 05:46:38 +08:00
fix cloud library mounts and artwork caching
This commit is contained in:
@@ -108,6 +108,11 @@ func (s *NotifyChannelService) Create(ctx context.Context, in ChannelInput) (*ch
|
||||
if err := s.repo.NotifyChannel.Create(ctx, n); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if n.Type == "telegram" && n.Enabled {
|
||||
if err := registerTelegramBotCommands(ctx, telegramStringConfigFromAny(in.Config)); err != nil && s.log != nil {
|
||||
s.log.Warn("telegram setMyCommands failed", zap.Error(sanitizeTelegramError(err)))
|
||||
}
|
||||
}
|
||||
v := toView(*n)
|
||||
return &v, nil
|
||||
}
|
||||
@@ -147,6 +152,11 @@ func (s *NotifyChannelService) Update(ctx context.Context, id string, in Channel
|
||||
if err := s.repo.NotifyChannel.Update(ctx, existing); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if existing.Type == "telegram" && existing.Enabled {
|
||||
if err := registerTelegramBotCommands(ctx, telegramStringConfigFromAny(in.Config)); err != nil && s.log != nil {
|
||||
s.log.Warn("telegram setMyCommands failed", zap.Error(sanitizeTelegramError(err)))
|
||||
}
|
||||
}
|
||||
row, err := s.repo.NotifyChannel.FindByID(ctx, id)
|
||||
if err != nil || row == nil {
|
||||
return nil, err
|
||||
|
||||
Reference in New Issue
Block a user