1515
1616from ._log import log as cw_log
1717
18- from .jellyfin ._common import normalize as jelly_normalize , key_of as jelly_key_of , _pair_scope as _jf_pair_scope , state_file as _jf_state_file
18+ from .jellyfin ._common import normalize as jelly_normalize , key_of as jelly_key_of , _pair_scope as _jf_pair_scope , state_file as _jf_state_file , _is_capture_mode as _jf_capture_mode
1919from .jellyfin import _watchlist as feat_watchlist
2020from .jellyfin import _history as feat_history
2121from .jellyfin import _ratings as feat_ratings
@@ -74,10 +74,12 @@ def _confirmed_keys(key_of, items: Iterable[Mapping[str, Any]], unresolved: Any)
7474except Exception :
7575 ctx = None # type: ignore[assignment]
7676
77- __VERSION__ = "3.3.0"
77+ __VERSION__ = "1.0"
78+ os .environ .setdefault ("CW_JELLYFIN_VERSION" , __VERSION__ )
79+ os .environ .setdefault ("CW_JELLYFIN_UA" , f"CrossWatch/{ __VERSION__ } (Jellyfin)" )
7880__all__ = ["get_manifest" , "JELLYFINModule" , "OPS" ]
7981
80- _DEF_UA = os .environ .get ("CW_UA" , f"CrossWatch/{ __VERSION__ } (Jellyfin)" )
82+ _DEF_UA = os .environ .get ("CW_JELLYFIN_UA" ) or os . environ . get ( " CW_UA") or f"CrossWatch/{ __VERSION__ } (Jellyfin)"
8183
8284
8385def _pick_instance_id (provider : str ) -> str :
@@ -140,7 +142,7 @@ def _error(feature: str, msg: str, **fields: Any) -> None:
140142
141143
142144def _save_health_shadow (payload : Mapping [str , Any ]) -> None :
143- if _jf_pair_scope () is None :
145+ if _jf_pair_scope () is None or _jf_capture_mode () :
144146 return
145147 try :
146148 path = str (_jf_state_file (_HEALTH_SHADOW_NAME ))
@@ -167,7 +169,7 @@ def get_manifest() -> Mapping[str, Any]:
167169 "features" : {
168170 "watchlist" : True ,
169171 "history" : True ,
170- "ratings" : False ,
172+ "ratings" : True ,
171173 "playlists" : False ,
172174 "progress" : True ,
173175 },
@@ -366,7 +368,7 @@ def manifest(self) -> Mapping[str, Any]:
366368
367369 @staticmethod
368370 def supported_features () -> dict [str , bool ]:
369- toggles = {"watchlist" : True , "history" : True , "ratings" : False , "playlists" : False , "progress" : True }
371+ toggles = {"watchlist" : True , "history" : True , "ratings" : True , "playlists" : False , "progress" : True }
370372 present = _present_flags ()
371373 return {k : bool (toggles .get (k , False ) and present .get (k , False )) for k in toggles .keys ()}
372374
@@ -511,7 +513,7 @@ def feature_names(self) -> tuple[str, ...]:
511513 def build_index (self , feature : str , ** kwargs : Any ) -> Mapping [str , dict [str , Any ]]:
512514 f = (feature or "watchlist" ).lower ()
513515 if not self ._is_enabled (f ):
514- _dbg (f , "build index skipped " , reason = "feature disabled " )
516+ _info (f , "index_skipped " , reason = "feature_disabled " )
515517 return {}
516518 mod = _FEATURES .get (f )
517519 if not mod :
@@ -531,7 +533,7 @@ def add(
531533 ) -> Mapping [str , Any ]:
532534 f = (feature or "watchlist" ).lower ()
533535 if not self ._is_enabled (f ):
534- _dbg (f , "add skipped" , reason = "feature disabled " )
536+ _info (f , "write_skipped" , op = "add" , reason = "feature_disabled " )
535537 return {"ok" : True , "count" : 0 , "unresolved" : []}
536538 if dry_run :
537539 return self ._dry_result (items )
@@ -558,7 +560,7 @@ def remove(
558560 ) -> Mapping [str , Any ]:
559561 f = (feature or "watchlist" ).lower ()
560562 if not self ._is_enabled (f ):
561- _dbg (f , "remove skipped" , reason = "feature disabled " )
563+ _info (f , "write_skipped" , op = "remove" , reason = "feature_disabled " )
562564 return {"ok" : True , "count" : 0 , "unresolved" : []}
563565 if dry_run :
564566 return self ._dry_result (items )
@@ -644,4 +646,4 @@ def remove(
644646 def health (self , cfg : Mapping [str , Any ]) -> Mapping [str , Any ]:
645647 return self ._adapter (cfg ).health ()
646648
647- OPS = _JellyfinOPS ()
649+ OPS = _JellyfinOPS ()
0 commit comments