summaryrefslogtreecommitdiff
path: root/tidal_dl_ng/helper/path.py
diff options
context:
space:
mode:
authorRobert Honz <exislow+github@gmail.com>2024-04-01 19:54:11 +0200
committerRobert Honz <exislow+github@gmail.com>2024-04-01 19:54:11 +0200
commit1dcfd98a757be47cd38bcca8596fa8df623af182 (patch)
tree35f11a8a670b0df1c98299dabfc9b74e79a29580 /tidal_dl_ng/helper/path.py
parentf9dd50b46420076dceebf4adb269cf7a0f8906f6 (diff)
downloadtidal-dl-ng-1dcfd98a757be47cd38bcca8596fa8df623af182.tar.gz
✨ Include dafault album image in build.
Diffstat (limited to 'tidal_dl_ng/helper/path.py')
-rw-r--r--tidal_dl_ng/helper/path.py10
1 files changed, 10 insertions, 0 deletions
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)