+
    „°ñjÆ  ã                   óB   € R t ^ RIt^ RIt^ RIt^ RItR R ltR R ltR# )a   Enrich executed-node output entries with media metadata.

Attaches a ``metadata`` object (``kind``/``width``/``height``, plus
``duration``/``fps``/``frame_count`` for videos) to each file-type output
entry at output-processing time, so consumers of the ``executed`` message
and ``/history`` can read media properties without probing the files
themselves. Unlike asset enrichment this still runs with ``--disable-assets``:
the properties serve history/websocket consumers that don't run the assets
system at all.
Nc                ó2   € V ^8„  d   QhR\         R,          /# )é   ÚreturnN)Ústr)Úformats   "ÚDC:\Ai_Coding\apps\studio\ComfyUI\comfy_execution\media_enrichment.pyÚ__annotate__r      s   € ÷ ñ ¬¨d­
ñ ó    c                ó<  € \        V \        4      '       d   RV 9  g   RV 9  d   R# V R,          pV P                  RR4      p\        V\        4      '       d4   \        V\        4      '       d   \        V R,          \        4      '       g   R# \        P
                  ! V R,          4      pVf   R# \        P                  P                  V4      p\        P                  P                  \        P                  P                  WBV4      4      p \        P                  P                  WE.4      V8w  d   \        P                  ! RV4       R#  \        P                  P                  T4      '       g   R# T#   \         d    \        P                  ! RT4        R# i ; i)a@  Resolve a file-type output entry to an absolute path inside its base dir.

Returns ``None`` for non-file entries (no ``filename``/``type``, or
non-string fields), unknown folder types, paths that escape the
folder-type base directory (symlinks are resolved before the containment
check), and paths with no file on disk.
ÚfilenameÚtypeNÚ	subfolderÚ z,Output entry path escapes base directory: %s)Ú
isinstanceÚdictÚgetr   Úfolder_pathsÚget_directory_by_typeÚosÚpathÚrealpathÚjoinÚ
commonpathÚloggingÚwarningÚ
ValueErrorÚisfile)Úentryr   r   ÚbaseÚ	base_realÚ	real_paths   &     r   Úresolve_output_entry_pathr!      s9  € ô �eœT×"Ò" j¸Ô&=ÀÈuÔATÙØ�ZÕ €HØ—	‘	˜+ rÓ*€IÜ�h¤×$Ò$¬J°yÄ#×,FÒ,FÌjÐY^Ð_eÕYfÔhk×NlÒNlÙÜ×-Ò-¨e°F­mÓ<€DØ‚|Ùô —‘× Ñ  Ó&€IÜ—‘× Ñ ¤§¡§¡¨iÀHÓ!MÓN€IðÜ�7‰7×Ñ˜yÐ4Ó5¸ÔBÜ�OŠOÐJÈHÔUÙð Cô �7‰7�>‰>˜)×$Ò$ÙØÐøô ô Ü�ŠÐFÈÔQÚðús   Ä<E5 Å5"FÆFc                ó0   € V ^8„  d   QhR\         R\         /# )r   Ú	output_uir   )r   )r   s   "r   r   r   4   s   € ÷ *ñ *´ð *¼$ñ *r	   c           	     ó¤  €  ^ RI Hp / pT P                  4        F´  w  r4\        T\        4      '       g   YBT&   K!  . pT F‡  p \        T\        4      '       d]   RT9  dV   \        T4      pTeG   \        P                  ! TR,          RR	7      ^ ,          pT! YxR
7      p	T	'       d   \        T4      pY–R&   TP                  T4       K‰  	  YRT&   K¶  	  T#   \         d    \        P                  ! RRR7       T u # i ; i  \         dF    \        T\        4      '       d   TP                  R4      MRp
\        P                  ! RT
RR7        L™i ; i)a  Attach a ``metadata`` media-properties object to file output entries.

Runs once per produced output at output-processing time. Returns a new
dict; entries are copied before modification, and an entry that already
carries a ``metadata`` key is left untouched. Best-effort: unreadable
files, non-media types, and per-entry errors leave that entry unchanged
and never block execution.
)Úextract_media_metadataz:Media metadata extraction unavailable; skipping enrichmentT)Úexc_infoÚmetadataNr   F)Ústrict)Ú	mime_typez5Failed to enrich output entry with media metadata: %s)Ú"app.assets.services.media_metadatar%   Ú	Exceptionr   r   Úitemsr   Úlistr   r!   Ú	mimetypesÚ
guess_typer   Úappend)r#   r%   ÚenrichedÚkeyÚentriesÚnew_entriesr   Úabs_pathr)   Úmediar   s   &          r   Ú!enrich_output_with_media_metadatar7   4   s9  € ðÝMð €HØ!Ÿ™Ö)‰ˆÜ˜'¤4×(Ò(Ø#�S‰MÙØˆÛˆEðÜ˜e¤T×*Ò*¨zÀÔ/FÜ8¸Ó?�HØÒ+Ü$-×$8Ò$8¸¸zÕ9JÐSXÔ$YÐZ[Õ$\˜	Ù 6°xÔ U˜ß Ü$(¨£K˜EØ05 *Ñ-ð ×Ñ˜uÖ%ñ! ð" $�‹ñ- *ð. €Oøô? ô ô 	�ŠÐTÐ_cÕdØÒðûô. ô Ü4>¸uÄd×4KÒ4K˜5Ÿ9™9 ZÔ0ÐQU�Ü—’ØKØ t÷ðús%   ‚C ÁA2C?Ã%C<Ã;C<Ã?AEÅE)Ú__doc__r   r.   r   r   r!   r7   © r	   r   Ú<module>r:      s#   ðñ	ó Û Û 	ã õ÷D*r	   