moved stuff to config
This commit is contained in:
parent
5f3728cc9f
commit
6b4e8bad15
2 changed files with 27 additions and 9 deletions
|
|
@ -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 json
|
||||
# import requests
|
||||
|
|
@ -51,10 +59,6 @@ import json
|
|||
# print(f"[LIDARR ERROR] Annat fel vid tillägg av MBID {mbid}: {e}")
|
||||
# return False
|
||||
|
||||
from config import *
|
||||
import requests
|
||||
import json
|
||||
|
||||
def lidarr_api_add_artist(mbid, verbose=False):
|
||||
lookup_url = f"{LIDARR_URL}/api/v1/artist/lookup?term=mbid:{mbid}"
|
||||
headers = {"X-Api-Key": LIDARR_API_KEY}
|
||||
|
|
@ -70,16 +74,27 @@ def lidarr_api_add_artist(mbid, verbose=False):
|
|||
return False
|
||||
|
||||
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 = {
|
||||
"foreignArtistId": mbid,
|
||||
"artistName": artist["artistName"],
|
||||
"monitored": True,
|
||||
"monitored": MONITORED,
|
||||
"qualityProfileId": QUALITY_PROFILE_ID,
|
||||
"metadataProfileId": 1,
|
||||
"rootFolderPath": ROOT_FOLDER_PATH,
|
||||
"addOptions": {
|
||||
"monitor": "all",
|
||||
"searchForMissingAlbums": True
|
||||
"monitor": MONITOR_NEW_ITEMS,
|
||||
"searchForMissingAlbums": SEARCH_FOR_MISSING_ALBUMS
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue