mirror of
https://github.com/Benexl/FastAnime.git
synced 2026-02-04 11:07:48 -08:00
feat(notifier): add icon
This commit is contained in:
BIN
fastanime/assets/logo.ico
Normal file
BIN
fastanime/assets/logo.ico
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 133 KiB |
BIN
fastanime/assets/logo.png
Normal file
BIN
fastanime/assets/logo.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 197 KiB |
@@ -7,7 +7,7 @@ import click
|
||||
from plyer import notification
|
||||
|
||||
from ....anilist import AniList
|
||||
from ....constants import APP_DATA_DIR, APP_NAME
|
||||
from ....constants import APP_DATA_DIR, APP_NAME, ICON_PATH
|
||||
from ..config import Config
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
@@ -26,7 +26,6 @@ def notifier(config: Config):
|
||||
timeout = 2
|
||||
if os.path.exists(notified):
|
||||
with open(notified, "r") as f:
|
||||
|
||||
past_notifications = json.load(f)
|
||||
else:
|
||||
past_notifications = {}
|
||||
@@ -62,7 +61,10 @@ def notifier(config: Config):
|
||||
json.dump(past_notifications, f)
|
||||
logger.info(message)
|
||||
notification.notify( # pyright:ignore
|
||||
title=title, message=message, app_name=APP_NAME
|
||||
title=title,
|
||||
message=message,
|
||||
app_name=APP_NAME,
|
||||
app_icon=ICON_PATH,
|
||||
)
|
||||
except Exception as e:
|
||||
logger.error(e)
|
||||
|
||||
@@ -14,6 +14,11 @@ APP_DIR = os.path.abspath(os.path.dirname(__file__))
|
||||
CONFIGS_DIR = os.path.join(APP_DIR, "configs")
|
||||
ASSETS_DIR = os.path.join(APP_DIR, "assets")
|
||||
|
||||
if PLATFORM == "Windows":
|
||||
ICON_PATH = os.path.join(ASSETS_DIR, "logo.ico")
|
||||
else:
|
||||
ICON_PATH = os.path.join(ASSETS_DIR, "logo.png")
|
||||
|
||||
# ----- user configs and data -----
|
||||
APP_DATA_DIR = dirs.user_config_dir
|
||||
if not APP_DATA_DIR:
|
||||
|
||||
Reference in New Issue
Block a user