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
|
||||
*.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"
|
||||
LASTFM_API_KEY = "din_lastfm_api_nyckel"
|
||||
|
||||
LIDARR_URL = "http://localhost:8686"
|
||||
LIDARR_API_KEY = "din_lidarr_api_nyckel"
|
||||
# config.py
|
||||
try:
|
||||
from config_local import *
|
||||
except ImportError:
|
||||
print("⚠️ Du måste skapa en config_local.py med dina API-nycklar.")
|
||||
|
||||
ROOT_FOLDER = "/media/music2"
|
||||
QUALITY_PROFILE_ID = 1
|
||||
|
|
|
|||
|
|
@ -4,6 +4,10 @@ from collections import defaultdict
|
|||
from datetime import datetime, timedelta
|
||||
|
||||
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/"
|
||||
params.update({
|
||||
"method": method,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue