Forráskód Böngészése

Fix Apprise logic to handle feed service URLs

Frédéric Guillot 2 éve
szülő
commit
a96702757e

+ 1 - 1
internal/integration/apprise/apprise.go

@@ -28,7 +28,7 @@ func NewClient(serviceURL, baseURL string) *Client {
 
 func (c *Client) SendNotification(entry *model.Entry) error {
 	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"

+ 4 - 2
internal/integration/integration.go

@@ -370,16 +370,17 @@ func PushEntries(feed *model.Feed, entries model.Entries, userIntegrations *mode
 					slog.Int64("user_id", userIntegrations.UserID),
 					slog.Int64("entry_id", entry.ID),
 					slog.String("entry_url", entry.URL),
+					slog.String("apprise_url", userIntegrations.AppriseURL),
 				)
 
-				appriseServiceURLs := userIntegrations.AppriseURL
+				appriseServiceURLs := userIntegrations.AppriseServicesURL
 				if feed.AppriseServiceURLs != "" {
 					appriseServiceURLs = feed.AppriseServiceURLs
 				}
 
 				client := apprise.NewClient(
-					userIntegrations.AppriseServicesURL,
 					appriseServiceURLs,
+					userIntegrations.AppriseURL,
 				)
 
 				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("entry_id", entry.ID),
 						slog.String("entry_url", entry.URL),
+						slog.String("apprise_url", userIntegrations.AppriseURL),
 						slog.Any("error", err),
 					)
 				}