moved stuff to config
This commit is contained in:
parent
5f3728cc9f
commit
6b4e8bad15
2 changed files with 27 additions and 9 deletions
|
|
@ -5,7 +5,7 @@ except ImportError:
|
||||||
print("⚠️ Du måste skapa en config_local.py med dina API-nycklar.")
|
print("⚠️ Du måste skapa en config_local.py med dina API-nycklar.")
|
||||||
|
|
||||||
ROOT_FOLDER_PATH = "/data/media/music2"
|
ROOT_FOLDER_PATH = "/data/media/music2"
|
||||||
QUALITY_PROFILE_ID = 1
|
QUALITY_PROFILE_ID = 4 #check what yours is! otherwise 1 is probably "Any"
|
||||||
|
|
||||||
MIN_PLAYS = 10
|
MIN_PLAYS = 10
|
||||||
RECENT_MONTHS = 3
|
RECENT_MONTHS = 3
|
||||||
|
|
@ -13,3 +13,6 @@ MAX_SIMILAR_PER_ART = 20
|
||||||
SIMILAR_MATCH_MIN = 0.5
|
SIMILAR_MATCH_MIN = 0.5
|
||||||
CACHE_TTL_HOURS = 24
|
CACHE_TTL_HOURS = 24
|
||||||
DEBUG_PRINT = True
|
DEBUG_PRINT = True
|
||||||
|
MONITORED = True
|
||||||
|
MONITOR_NEW_ITEMS = "all" # alternativt "none", "future", "missing", etc.
|
||||||
|
SEARCH_FOR_MISSING_ALBUMS = True
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,12 @@
|
||||||
from config import *
|
from config import (
|
||||||
|
LIDARR_URL,
|
||||||
|
LIDARR_API_KEY,
|
||||||
|
ROOT_FOLDER_PATH,
|
||||||
|
QUALITY_PROFILE_ID,
|
||||||
|
MONITORED,
|
||||||
|
MONITOR_NEW_ITEMS,
|
||||||
|
SEARCH_FOR_MISSING_ALBUMS
|
||||||
|
)
|
||||||
import requests
|
import requests
|
||||||
import json
|
import json
|
||||||
# import requests
|
# import requests
|
||||||
|
|
@ -51,10 +59,6 @@ import json
|
||||||
# print(f"[LIDARR ERROR] Annat fel vid tillägg av MBID {mbid}: {e}")
|
# print(f"[LIDARR ERROR] Annat fel vid tillägg av MBID {mbid}: {e}")
|
||||||
# return False
|
# return False
|
||||||
|
|
||||||
from config import *
|
|
||||||
import requests
|
|
||||||
import json
|
|
||||||
|
|
||||||
def lidarr_api_add_artist(mbid, verbose=False):
|
def lidarr_api_add_artist(mbid, verbose=False):
|
||||||
lookup_url = f"{LIDARR_URL}/api/v1/artist/lookup?term=mbid:{mbid}"
|
lookup_url = f"{LIDARR_URL}/api/v1/artist/lookup?term=mbid:{mbid}"
|
||||||
headers = {"X-Api-Key": LIDARR_API_KEY}
|
headers = {"X-Api-Key": LIDARR_API_KEY}
|
||||||
|
|
@ -70,16 +74,27 @@ def lidarr_api_add_artist(mbid, verbose=False):
|
||||||
return False
|
return False
|
||||||
|
|
||||||
artist = data[0]
|
artist = data[0]
|
||||||
|
#payload = {
|
||||||
|
# "foreignArtistId": mbid,
|
||||||
|
# "artistName": artist["artistName"],
|
||||||
|
# "monitored": True,
|
||||||
|
# "qualityProfileId": QUALITY_PROFILE_ID,
|
||||||
|
# "metadataProfileId": 1,
|
||||||
|
# "rootFolderPath": ROOT_FOLDER_PATH,
|
||||||
|
# "addOptions": {
|
||||||
|
# "monitor": "all",
|
||||||
|
# "searchForMissingAlbums": True
|
||||||
|
# }
|
||||||
payload = {
|
payload = {
|
||||||
"foreignArtistId": mbid,
|
"foreignArtistId": mbid,
|
||||||
"artistName": artist["artistName"],
|
"artistName": artist["artistName"],
|
||||||
"monitored": True,
|
"monitored": MONITORED,
|
||||||
"qualityProfileId": QUALITY_PROFILE_ID,
|
"qualityProfileId": QUALITY_PROFILE_ID,
|
||||||
"metadataProfileId": 1,
|
"metadataProfileId": 1,
|
||||||
"rootFolderPath": ROOT_FOLDER_PATH,
|
"rootFolderPath": ROOT_FOLDER_PATH,
|
||||||
"addOptions": {
|
"addOptions": {
|
||||||
"monitor": "all",
|
"monitor": MONITOR_NEW_ITEMS,
|
||||||
"searchForMissingAlbums": True
|
"searchForMissingAlbums": SEARCH_FOR_MISSING_ALBUMS
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue