Fix Apprise logic to handle feed service URLs
This commit is contained in:
parent
f98fc1e03a
commit
a96702757e
2 changed files with 5 additions and 3 deletions
|
@ -28,7 +28,7 @@ func NewClient(serviceURL, baseURL string) *Client {
|
||||||
|
|
||||||
func (c *Client) SendNotification(entry *model.Entry) error {
|
func (c *Client) SendNotification(entry *model.Entry) error {
|
||||||
if c.baseURL == "" || c.servicesURL == "" {
|
if c.baseURL == "" || c.servicesURL == "" {
|
||||||
return fmt.Errorf("apprise: missing base URL or service URL")
|
return fmt.Errorf("apprise: missing base URL or services URL")
|
||||||
}
|
}
|
||||||
|
|
||||||
message := "[" + entry.Title + "]" + "(" + entry.URL + ")" + "\n\n"
|
message := "[" + entry.Title + "]" + "(" + entry.URL + ")" + "\n\n"
|
||||||
|
|
|
@ -370,16 +370,17 @@ func PushEntries(feed *model.Feed, entries model.Entries, userIntegrations *mode
|
||||||
slog.Int64("user_id", userIntegrations.UserID),
|
slog.Int64("user_id", userIntegrations.UserID),
|
||||||
slog.Int64("entry_id", entry.ID),
|
slog.Int64("entry_id", entry.ID),
|
||||||
slog.String("entry_url", entry.URL),
|
slog.String("entry_url", entry.URL),
|
||||||
|
slog.String("apprise_url", userIntegrations.AppriseURL),
|
||||||
)
|
)
|
||||||
|
|
||||||
appriseServiceURLs := userIntegrations.AppriseURL
|
appriseServiceURLs := userIntegrations.AppriseServicesURL
|
||||||
if feed.AppriseServiceURLs != "" {
|
if feed.AppriseServiceURLs != "" {
|
||||||
appriseServiceURLs = feed.AppriseServiceURLs
|
appriseServiceURLs = feed.AppriseServiceURLs
|
||||||
}
|
}
|
||||||
|
|
||||||
client := apprise.NewClient(
|
client := apprise.NewClient(
|
||||||
userIntegrations.AppriseServicesURL,
|
|
||||||
appriseServiceURLs,
|
appriseServiceURLs,
|
||||||
|
userIntegrations.AppriseURL,
|
||||||
)
|
)
|
||||||
|
|
||||||
if err := client.SendNotification(entry); err != nil {
|
if err := client.SendNotification(entry); err != nil {
|
||||||
|
@ -387,6 +388,7 @@ func PushEntries(feed *model.Feed, entries model.Entries, userIntegrations *mode
|
||||||
slog.Int64("user_id", userIntegrations.UserID),
|
slog.Int64("user_id", userIntegrations.UserID),
|
||||||
slog.Int64("entry_id", entry.ID),
|
slog.Int64("entry_id", entry.ID),
|
||||||
slog.String("entry_url", entry.URL),
|
slog.String("entry_url", entry.URL),
|
||||||
|
slog.String("apprise_url", userIntegrations.AppriseURL),
|
||||||
slog.Any("error", err),
|
slog.Any("error", err),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue