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:
parent
2101b56b8c
commit
5d9ecc0557
@ -656,7 +656,7 @@ def post_scrobble(**keys):
|
|||||||
except:
|
except:
|
||||||
time = int(datetime.datetime.now(tz=datetime.timezone.utc).timestamp())
|
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)
|
(artists,title) = cla.fullclean(artists,title)
|
||||||
|
|
||||||
## this is necessary for localhost testing
|
## this is necessary for localhost testing
|
||||||
@ -953,7 +953,7 @@ def sync():
|
|||||||
|
|
||||||
# all entries by file collected
|
# all entries by file collected
|
||||||
# so we don't open the same file for every entry
|
# so we don't open the same file for every entry
|
||||||
log("Syncing",module="debug")
|
#log("Syncing",module="debug")
|
||||||
entries = {}
|
entries = {}
|
||||||
|
|
||||||
for idx in range(len(SCROBBLES)):
|
for idx in range(len(SCROBBLES)):
|
||||||
|
@ -19,8 +19,7 @@ def entity_column(element,counting=[],image=None):
|
|||||||
# html += "<td class='artists'>" + html_links(element["artists"]) + "</td>"
|
# html += "<td class='artists'>" + html_links(element["artists"]) + "</td>"
|
||||||
# html += "<td class='title'>" + html_link(element) + "</td>"
|
# html += "<td class='title'>" + html_link(element) + "</td>"
|
||||||
html += "<td class='track'><span class='artist_in_trackcolumn'>"
|
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>"
|
html += html_links(element["artists"]) + "</span> – " + html_link(element) + "</td>"
|
||||||
else:
|
else:
|
||||||
# artist
|
# artist
|
||||||
@ -81,6 +80,8 @@ def trackLink(track):
|
|||||||
|
|
||||||
def trackSearchLink(track):
|
def trackSearchLink(track):
|
||||||
searchProvider = get_settings("TRACK_SEARCH_PROVIDER")
|
searchProvider = get_settings("TRACK_SEARCH_PROVIDER")
|
||||||
|
if searchProvider is None: return ""
|
||||||
|
|
||||||
link = "<a class='trackProviderSearch' href='"
|
link = "<a class='trackProviderSearch' href='"
|
||||||
if searchProvider == "YouTube":
|
if searchProvider == "YouTube":
|
||||||
link += "https://www.youtube.com/results?search_query="
|
link += "https://www.youtube.com/results?search_query="
|
||||||
@ -101,7 +102,7 @@ def trackSearchLink(track):
|
|||||||
else:
|
else:
|
||||||
link += "https://www.google.com/search?q=" # ¯\_(ツ)_/¯
|
link += "https://www.google.com/search?q=" # ¯\_(ツ)_/¯
|
||||||
|
|
||||||
link += urllib.parse.quote(", ".join(track["artists"]) + " - " + track["title"]) + "'>🎵</a>"
|
link += urllib.parse.quote(", ".join(track["artists"]) + " " + track["title"]) + "'>🎵</a>"
|
||||||
return link
|
return link
|
||||||
|
|
||||||
#def scrobblesTrackLink(artists,title,timekeys,amount=None,pixels=None):
|
#def scrobblesTrackLink(artists,title,timekeys,amount=None,pixels=None):
|
||||||
|
@ -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
|
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'
|
# Can be 'YouTube', 'YouTube Music', 'Google Play Music', 'Spotify', 'Tidal', 'SoundCloud', 'Deezer', 'Amazon Music'
|
||||||
# Leave empty to disable
|
# Omit or set to none to disable
|
||||||
TRACK_SEARCH_PROVIDER = "YouTube"
|
TRACK_SEARCH_PROVIDER = None
|
||||||
|
|
||||||
[Database]
|
[Database]
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user