From 96b728269ebd21c9368b3f809282fff3d2013c59 Mon Sep 17 00:00:00 2001 From: Adar Nimrod <nimrod@shore.co.il> Date: Wed, 4 Aug 2021 18:02:39 +0300 Subject: [PATCH] New and improved code. --- daemon/kodi_scan | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/daemon/kodi_scan b/daemon/kodi_scan index d055c78..418237c 100755 --- a/daemon/kodi_scan +++ b/daemon/kodi_scan @@ -16,10 +16,8 @@ def scan(library=None): kodi_json_rpc_url = "http://172.18.0.1:8080/jsonrpc" headers = {"content-type": "application/json"} base_request_data = {"jsonrpc": "2.0", "id": "transmission"} - audio_request_data = base_request_data.copy() - audio_request_data["method"] = "AudioLibrary.Scan" - video_request_data = base_request_data.copy() - video_request_data["method"] = "VideoLibrary.Scan" + audio_request_data = {**base_request_data, "method": "AudioLibrary.Scan"} + video_request_data = {**base_request_data, "method": "VideoLibrary.Scan"} if library == "audio": req = urllib.request.Request( -- GitLab