File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed
Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change 1- import time
21import functools
2+ import time
33from typing import TYPE_CHECKING
44
55from pypresence import Presence
66
77if TYPE_CHECKING :
8- from anipy_api .provider import ProviderStream
98 from anipy_api .anime import Anime
9+ from anipy_api .provider import ProviderStream
1010
1111
1212@functools .lru_cache (maxsize = None )
@@ -17,8 +17,13 @@ def __init__(self):
1717
1818 def dc_presence_callback (self , anime : "Anime" , stream : "ProviderStream" ):
1919 anime_info = anime .get_info ()
20+ details_bytes = bytes (
21+ f"Watching via anipy-cli: { anime .name } " .encode ("utf-8" , errors = "ignore" )
22+ )
23+ details = details_bytes [:128 ].decode ("utf-8" , errors = "ignore" )
24+
2025 self .rpc_client .update (
21- details = f"Watching { anime . name } via anipy-cli" ,
26+ details = details ,
2227 state = f"Episode { stream .episode } /{ anime .get_episodes (stream .language )[- 1 ]} " ,
2328 large_image = anime_info .image or "" ,
2429 small_image = "https://raw.githubusercontent.com/sdaqo/anipy-cli/master/docs/assets/anipy-logo-dark-compact.png" ,
You can’t perform that action at this time.
0 commit comments