From 11d6312daa96588a62873f9595385735477f94ad Mon Sep 17 00:00:00 2001 From: Daniele Ricci Date: Sun, 14 Feb 2021 19:47:03 +0100 Subject: [PATCH] Do not search if query is not for 'any' Mopidy-Radionet will crash (and make the Mopidy search system crash with it) if the query has no key "any". This happens when searching specific fields. Since searching for a radio name only makes sense with "any", my patch will make mopidy-radionet skip the search entirely if "any" isn't present. --- mopidy_radionet/library.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mopidy_radionet/library.py b/mopidy_radionet/library.py index 060e419..29f47cd 100644 --- a/mopidy_radionet/library.py +++ b/mopidy_radionet/library.py @@ -85,6 +85,8 @@ class RadioNetLibraryProvider(backend.LibraryProvider): return [] def search(self, query=None, uris=None, exact=False): + if 'any' not in query: + return None result = []