mirror of
https://github.com/Benexl/FastAnime.git
synced 2025-12-25 12:24:52 -08:00
feat(notifier)?: add notification bell
This commit is contained in:
@@ -8,7 +8,13 @@ import requests
|
||||
from plyer import notification
|
||||
|
||||
from ....anilist import AniList
|
||||
from ....constants import APP_CACHE_DIR, APP_DATA_DIR, APP_NAME, PLATFORM
|
||||
from ....constants import (
|
||||
APP_CACHE_DIR,
|
||||
APP_DATA_DIR,
|
||||
APP_NAME,
|
||||
NOTIFICATION_BELL,
|
||||
PLATFORM,
|
||||
)
|
||||
from ..config import Config
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
@@ -91,9 +97,13 @@ def notifier(config: Config):
|
||||
message=message,
|
||||
app_name=APP_NAME,
|
||||
app_icon=ICON_PATH,
|
||||
hints={"image-path": ICON_PATH},
|
||||
hints={
|
||||
"image-path": ICON_PATH,
|
||||
"sound-file": NOTIFICATION_BELL,
|
||||
},
|
||||
timeout=notification_duration,
|
||||
)
|
||||
# os.system(f"play {NOTIFICATION_BELL}")
|
||||
time.sleep(30)
|
||||
except Exception as e:
|
||||
logger.error(e)
|
||||
|
||||
@@ -14,6 +14,10 @@ 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")
|
||||
|
||||
# --- notification bell ---
|
||||
NOTIFICATION_BELL = os.path.join(ASSETS_DIR, "tut_turu.mp3")
|
||||
|
||||
# --- icon stuff ---
|
||||
if PLATFORM == "Windows":
|
||||
ICON_PATH = os.path.join(ASSETS_DIR, "logo.ico")
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user