summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
Diffstat (limited to 'modules')
-rw-r--r--modules/tracking.py12
1 files changed, 7 insertions, 5 deletions
diff --git a/modules/tracking.py b/modules/tracking.py
index 3a11d7a..0e5ab5a 100644
--- a/modules/tracking.py
+++ b/modules/tracking.py
@@ -316,9 +316,6 @@ class Module:
return msg
def track_url(self, code, nick, channel):
- if not code:
- m = get_tracking_module('')
- return [m.get_url()]
msg = []
try:
session = Session()
@@ -331,7 +328,12 @@ class Module:
m = get_tracking_module(package.code)
msg.append(m.get_url(package.code))
if not len(msg):
- msg.append('No packages found.')
+ # Rreturn an error only if we got a code to filter with.
+ if code:
+ msg.append('No packages found.')
+ else:
+ m = get_tracking_module('')
+ msg = [m.get_url()]
finally:
session.close()
return msg
@@ -360,7 +362,7 @@ class Module:
code = args[1]
label = ' '.join(args[2:])
elif mode.lower() == 'url':
- code = ' '.join(args[1:]) if len(args) > 1 else None
+ code = ' '.join(args[1:]) if len(args) > 1 else ''
msg = None
if mode.lower() in ('start', 'add'):