From 370b1af5a1f2acea1b364f61a398724cb06a489a Mon Sep 17 00:00:00 2001 From: Chris Caron Date: Thu, 22 Sep 2022 23:04:02 -0400 Subject: [PATCH] Port is correctly placed in Bark URL if provided (#672) --- apprise/plugins/NotifyBark.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/apprise/plugins/NotifyBark.py b/apprise/plugins/NotifyBark.py index ce6dd7a0..d7b178d6 100644 --- a/apprise/plugins/NotifyBark.py +++ b/apprise/plugins/NotifyBark.py @@ -208,14 +208,13 @@ class NotifyBark(NotifyBase): super(NotifyBark, self).__init__(**kwargs) # Prepare our URL - self.notify_url = '%s://%s/push' % ( + self.notify_url = '%s://%s%s/push' % ( 'https' if self.secure else 'http', self.host, + ':{}'.format(self.port) + if (self.port and isinstance(self.port, int)) else '', ) - if isinstance(self.port, int): - self.notify_url += ':%d' % self.port - # Assign our category self.category = \ category if isinstance(category, six.string_types) else None