From 5d9ecc0557b768cbbfc1fdc039bec474a5393ff3 Mon Sep 17 00:00:00 2001 From: Krateng Date: Thu, 22 Aug 2019 22:17:04 +0200 Subject: [PATCH] Disabled search provider per default and moved around some things --- database.py | 4 ++-- htmlgenerators.py | 7 ++++--- settings/default.ini | 4 ++-- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/database.py b/database.py index f8bee61..cfcd54c 100644 --- a/database.py +++ b/database.py @@ -656,7 +656,7 @@ def post_scrobble(**keys): except: time = int(datetime.datetime.now(tz=datetime.timezone.utc).timestamp()) - log("Incoming scrobble (native API): Client " + client + ", ARTISTS: " + str(artists) + ", TRACK: " + title,module="debug") + log("Incoming scrobble (native API): Client " + client + ", ARTISTS: " + str(artists) + ", TRACK: " + title,module="debug") (artists,title) = cla.fullclean(artists,title) ## this is necessary for localhost testing @@ -953,7 +953,7 @@ def sync(): # all entries by file collected # so we don't open the same file for every entry - log("Syncing",module="debug") + #log("Syncing",module="debug") entries = {} for idx in range(len(SCROBBLES)): diff --git a/htmlgenerators.py b/htmlgenerators.py index 94e0642..e443fd7 100644 --- a/htmlgenerators.py +++ b/htmlgenerators.py @@ -19,8 +19,7 @@ def entity_column(element,counting=[],image=None): # html += "" + html_links(element["artists"]) + "" # html += "" + html_link(element) + "" html += "" - if get_settings("TRACK_SEARCH_PROVIDER") not in [None,"ASK", ""]: - html += trackSearchLink(element) + html += trackSearchLink(element) html += html_links(element["artists"]) + " – " + html_link(element) + "" else: # artist @@ -81,6 +80,8 @@ def trackLink(track): def trackSearchLink(track): searchProvider = get_settings("TRACK_SEARCH_PROVIDER") + if searchProvider is None: return "" + link = "🎵" + link += urllib.parse.quote(", ".join(track["artists"]) + " " + track["title"]) + "'>🎵" return link #def scrobblesTrackLink(artists,title,timekeys,amount=None,pixels=None): diff --git a/settings/default.ini b/settings/default.ini index bf1390f..30be3a2 100644 --- a/settings/default.ini +++ b/settings/default.ini @@ -18,8 +18,8 @@ CACHE_EXPIRE_NEGATIVE = 30 # after how many days negative results should be trie CACHE_EXPIRE_POSITIVE = 300 # after how many days positive results should be refreshed # Can be 'YouTube', 'YouTube Music', 'Google Play Music', 'Spotify', 'Tidal', 'SoundCloud', 'Deezer', 'Amazon Music' -# Leave empty to disable -TRACK_SEARCH_PROVIDER = "YouTube" +# Omit or set to none to disable +TRACK_SEARCH_PROVIDER = None [Database]