1
0
mirror of https://github.com/krateng/maloja.git synced 2023-08-10 21:12:55 +03:00

Disabled search provider per default and moved around some things

This commit is contained in:
Krateng 2019-08-22 22:17:04 +02:00
parent 2101b56b8c
commit 5d9ecc0557
3 changed files with 8 additions and 7 deletions

View File

@ -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)):

View File

@ -19,8 +19,7 @@ def entity_column(element,counting=[],image=None):
# html += "<td class='artists'>" + html_links(element["artists"]) + "</td>"
# html += "<td class='title'>" + html_link(element) + "</td>"
html += "<td class='track'><span class='artist_in_trackcolumn'>"
if get_settings("TRACK_SEARCH_PROVIDER") not in [None,"ASK", ""]:
html += trackSearchLink(element)
html += trackSearchLink(element)
html += html_links(element["artists"]) + "</span> " + html_link(element) + "</td>"
else:
# artist
@ -81,6 +80,8 @@ def trackLink(track):
def trackSearchLink(track):
searchProvider = get_settings("TRACK_SEARCH_PROVIDER")
if searchProvider is None: return ""
link = "<a class='trackProviderSearch' href='"
if searchProvider == "YouTube":
link += "https://www.youtube.com/results?search_query="
@ -101,7 +102,7 @@ def trackSearchLink(track):
else:
link += "https://www.google.com/search?q=" # ¯\_(ツ)_/¯
link += urllib.parse.quote(", ".join(track["artists"]) + " - " + track["title"]) + "'>&#127925;</a>"
link += urllib.parse.quote(", ".join(track["artists"]) + " " + track["title"]) + "'>&#127925;</a>"
return link
#def scrobblesTrackLink(artists,title,timekeys,amount=None,pixels=None):

View File

@ -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]