appears to be working
This commit is contained in:
parent
f20aa9b0d8
commit
a51cb7410b
3 changed files with 32 additions and 5 deletions
23
.gitignore
vendored
23
.gitignore
vendored
|
|
@ -12,3 +12,26 @@
|
||||||
# Built Visual Studio Code Extensions
|
# Built Visual Studio Code Extensions
|
||||||
*.vsix
|
*.vsix
|
||||||
|
|
||||||
|
# Python cache och loggar
|
||||||
|
__pycache__/
|
||||||
|
*.py[cod]
|
||||||
|
*.log
|
||||||
|
|
||||||
|
# Editorfiler
|
||||||
|
.vscode/
|
||||||
|
.idea/
|
||||||
|
*.swp
|
||||||
|
|
||||||
|
# Miljöfiler
|
||||||
|
.env
|
||||||
|
.venv/
|
||||||
|
venv/
|
||||||
|
env/
|
||||||
|
|
||||||
|
# OS-specifikt
|
||||||
|
.DS_Store
|
||||||
|
Thumbs.db
|
||||||
|
|
||||||
|
# Din lokala konfigurationsfil
|
||||||
|
config_local.py
|
||||||
|
cache.json
|
||||||
|
|
|
||||||
10
config.py
10
config.py
|
|
@ -1,8 +1,8 @@
|
||||||
LASTFM_USERNAME = "ditt_lastfm_namn"
|
# config.py
|
||||||
LASTFM_API_KEY = "din_lastfm_api_nyckel"
|
try:
|
||||||
|
from config_local import *
|
||||||
LIDARR_URL = "http://localhost:8686"
|
except ImportError:
|
||||||
LIDARR_API_KEY = "din_lidarr_api_nyckel"
|
print("⚠️ Du måste skapa en config_local.py med dina API-nycklar.")
|
||||||
|
|
||||||
ROOT_FOLDER = "/media/music2"
|
ROOT_FOLDER = "/media/music2"
|
||||||
QUALITY_PROFILE_ID = 1
|
QUALITY_PROFILE_ID = 1
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,10 @@ from collections import defaultdict
|
||||||
from datetime import datetime, timedelta
|
from datetime import datetime, timedelta
|
||||||
|
|
||||||
def lf_request(method, **params):
|
def lf_request(method, **params):
|
||||||
|
# Fixa 'from_' → 'from' och 'to_' → 'to' (Last.fm accepterar inte Python-säkra namn)
|
||||||
|
for alt, real in (("from_", "from"), ("to_", "to")):
|
||||||
|
if alt in params:
|
||||||
|
params[real] = params.pop(alt)
|
||||||
url = "https://ws.audioscrobbler.com/2.0/"
|
url = "https://ws.audioscrobbler.com/2.0/"
|
||||||
params.update({
|
params.update({
|
||||||
"method": method,
|
"method": method,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue