From ea90b49604fd9d768f574bcd97d3149a05404259 Mon Sep 17 00:00:00 2001 From: Zamitto <167933696+zamitto@users.noreply.github.com> Date: Mon, 23 Dec 2024 10:50:35 -0300 Subject: [PATCH] chore: sonar adjustments --- python_rpc/profile_image_processor.py | 4 ++-- src/main/services/download/download-manager.ts | 2 +- src/main/services/download/real-debrid.ts | 2 +- src/main/services/download/torbox.ts | 2 +- src/main/services/python-rpc.ts | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/python_rpc/profile_image_processor.py b/python_rpc/profile_image_processor.py index 9fe8489e..45ba5160 100644 --- a/python_rpc/profile_image_processor.py +++ b/python_rpc/profile_image_processor.py @@ -15,8 +15,8 @@ class ProfileImageProcessor: mime_type = image.get_format_mimetype() return image_path, mime_type else: - newUUID = str(uuid.uuid4()) - new_image_path = os.path.join(tempfile.gettempdir(), newUUID) + ".webp" + new_uuid = str(uuid.uuid4()) + new_image_path = os.path.join(tempfile.gettempdir(), new_uuid) + ".webp" image.save(new_image_path) new_image = Image.open(new_image_path) diff --git a/src/main/services/download/download-manager.ts b/src/main/services/download/download-manager.ts index 3b1c2295..65270429 100644 --- a/src/main/services/download/download-manager.ts +++ b/src/main/services/download/download-manager.ts @@ -172,7 +172,7 @@ export class DownloadManager { if (!game) return; const totalSize = await getDirSize( - path.join(game.downloadPath!, status.folderName!) + path.join(game.downloadPath!, status.folderName) ); if (totalSize < status.fileSize) { diff --git a/src/main/services/download/real-debrid.ts b/src/main/services/download/real-debrid.ts index a6b08e45..8580a963 100644 --- a/src/main/services/download/real-debrid.ts +++ b/src/main/services/download/real-debrid.ts @@ -9,7 +9,7 @@ import type { export class RealDebridClient { private static instance: AxiosInstance; - private static baseURL = "https://api.real-debrid.com/rest/1.0"; + private static readonly baseURL = "https://api.real-debrid.com/rest/1.0"; static authorize(apiToken: string) { this.instance = axios.create({ diff --git a/src/main/services/download/torbox.ts b/src/main/services/download/torbox.ts index ed01bcd3..3eade81d 100644 --- a/src/main/services/download/torbox.ts +++ b/src/main/services/download/torbox.ts @@ -10,7 +10,7 @@ import { logger } from "../logger"; export class TorBoxClient { private static instance: AxiosInstance; - private static baseURL = "https://api.torbox.app/v1/api"; + private static readonly baseURL = "https://api.torbox.app/v1/api"; public static apiToken: string; static authorize(apiToken: string) { diff --git a/src/main/services/python-rpc.ts b/src/main/services/python-rpc.ts index df37f02a..84898c65 100644 --- a/src/main/services/python-rpc.ts +++ b/src/main/services/python-rpc.ts @@ -28,7 +28,7 @@ export class PythonRPC { private static pythonProcess: cp.ChildProcess | null = null; - public static rpc = axios.create({ + public static readonly rpc = axios.create({ baseURL: `http://localhost:${this.RPC_PORT}`, headers: { "x-hydra-rpc-password": this.RPC_PASSWORD,