steal some of @tcsenpai 's changes from the PR

+ ditch the LAST FM API KEY thing
+ expose the Musixmatch urls
+ use the kerve last fm api to download similar artist data
+ use google.it instead of the Google public dns to check internet connectivity (to make it work in all environments)
+ return og Dockerfile to fix ARM support
This commit is contained in:
mungai-njoroge
2024-02-16 23:57:23 +03:00
parent 4f48c33009
commit 67f28b8a9b
11 changed files with 136 additions and 69 deletions
+6 -9
View File
@@ -235,26 +235,23 @@ class TCOLOR:
class Keys:
# get last fm api key from os environment
LASTFM_API_KEY = os.environ.get("LASTFM_API_KEY")
PLUGIN_LYRICS_AUTHORITY = os.environ.get("PLUGIN_LYRICS_AUTHORITY")
PLUGIN_LYRICS_ROOT_URL = os.environ.get("PLUGIN_LYRICS_ROOT_URL")
PLUGIN_LYRICS_AUTHORITY = os.environ.get("apic-desktop.musixmatch.com")
PLUGIN_LYRICS_ROOT_URL = os.environ.get("https://apic-desktop.musixmatch.com/ws/1.1/")
SWINGMUSIC_APP_VERSION = os.environ.get("SWINGMUSIC_APP_VERSION")
@classmethod
def load(cls):
if IS_BUILD:
cls.LASTFM_API_KEY = configs.LASTFM_API_KEY
cls.PLUGIN_LYRICS_AUTHORITY = configs.PLUGIN_LYRICS_AUTHORITY
cls.PLUGIN_LYRICS_ROOT_URL = configs.PLUGIN_LYRICS_ROOT_URL
cls.SWINGMUSIC_APP_VERSION = configs.SWINGMUSIC_APP_VERSION
cls.verify_keys()
@classmethod
def verify_keys(cls):
if not cls.LASTFM_API_KEY:
print("ERROR: LASTFM_API_KEY not set in environment")
sys.exit(0)
# if not cls.LASTFM_API_KEY:
# print("ERROR: LASTFM_API_KEY not set in environment")
# sys.exit(0)
pass
@classmethod
def get(cls, key: str):