From 1dcfd98a757be47cd38bcca8596fa8df623af182 Mon Sep 17 00:00:00 2001 From: Robert Honz Date: Mon, 1 Apr 2024 19:54:11 +0200 Subject: ✨ Include dafault album image in build. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tidal_dl_ng/helper/path.py | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'tidal_dl_ng/helper/path.py') diff --git a/tidal_dl_ng/helper/path.py b/tidal_dl_ng/helper/path.py index 64e2d68..91fe5cf 100644 --- a/tidal_dl_ng/helper/path.py +++ b/tidal_dl_ng/helper/path.py @@ -2,6 +2,7 @@ import glob import math import os import re +import sys from pathlib import Path, PosixPath from pathvalidate import sanitize_filename, sanitize_filepath @@ -243,3 +244,12 @@ def check_file_exists(path_file: str, extension_ignore: bool = False) -> bool: result = bool(sum([glob.glob(_file) for _file in path_files], [])) return result + + +def resource_path(relative_path): + try: + base_path = sys._MEIPASS + except Exception: + base_path = os.path.abspath(".") + + return os.path.join(base_path, relative_path) -- cgit v1.3.1