+
    Ki  c                   s    ^ RI t ^ RIt^ RIHt ^ RIHt ^ RIHt ^ RIH	t	 ^ RI
Ht ^ RIHt ^ RIHt ^ R	IHt ^ R
IHt ^ RIHtHt ^ RIHt  ! R R]4      t ! R R]4      t ! R R]4      tR# )    N)gettext)List)Image)settings)	PLATFORMS)BaseService)ServiceGame)ServiceMedia)system)DOLPHIN_GAME_CACHE_FILEDolphinCacheReader)slugifyc                   st    ] tR t^tRtRtRtR.t]P                  P                  ]P                  R4      tRtR# )DolphinBannerdolphinlocalz%s.pngzdolphin/banners/small N)i`   i    )__name__
__module____qualname____firstlineno__serviceZsourceZsizeZfile_patternsospathZjoinr   Z	CACHE_DIRZ	dest_path__static_attributes__r       </usr/lib/python3.14/site-packages/lutris/services/dolphin.pyr   r      s3    GFDJMX//1HIIr   r   c                   sr   a  ] tR t^t o RtRt]! R4      tRtRt	R]
/tR tR tR tR tV 3R	 lR
 ltRtV tR# )DolphinServicer   DolphinTiconc                s    \         P                  ! \        4      '       g   R # \        4       pVP	                  4        Uu. uF  p\
        P                  V4      NK  	  ppV F  pVP                  4        K  	  V# u upi N)r	   Zpath_existsr
   r   Z	get_gamesDolphinGamenew_from_cachesave)selfZcache_readergameZdolphin_gamess   &   r   loadZDolphinService.load"   sh    !!"9::)+FRF\F\F^_F^d33D9F^_!DIIK " `s   A:c                s    \         P                  ! VR ,          4      pRVR,          RRRVR,          RV P                  V4      RV P                  V4      RRR	VR
,          RVR,          ///# )detailsnameZversionr   slugZ	game_slugrunnerscriptr#   	main_filer   platform)jsonloadsZget_installed_slugget_installed_runner_name)r"   db_gamer%   s   && r   generate_installerZ!DolphinService.generate_installer+   su    **WY/0GFOyGFO009d44W=gfoz7:CVW	
 		
r   c                s    V P                   # r   )r(   )r"   r/      &&r   r.   Z(DolphinService.get_installed_runner_name8   s    {{r   c                sj    \         P                  P                  VR,          R,          R,          4      # )z$Pull install location from installerr)   r#   r*   )r   r   Zdirname)r"   Z	installerr1   r   get_game_directoryZ!DolphinService.get_game_directory;   s$    wwy26:;GHHr   c                s6   < V ^8  d   QhRS[ RS[S[,          /# )i   r/   Zreturn)Zdictr   str)Zformat__classdict__s   "r   Z__annotate__ZDolphinService.__annotate__?   s      $ 49 r   c                sl   VP                  R 4      pV'       d   \        P                  ! V4      pV'       d}   VP                  R4      '       df   VR,          pVP                  4       '       dD   \	        VR,          4      p^ Tu;8:  d   \        \        4      8  d   M V.# \        V,          pV.# V.# . # )r%   r+   )Zgetr,   r-   ZisdigitZintlenr   )r"   r/   Zdetails_jsonr%   Zplatform_valueZplatform_numberr+   s   &&     r   get_game_platformsZ!DolphinService.get_game_platforms?   s    {{9-jj.G7;;z22!(!4!))++&)'**=&>OO<c)n< ''' $-_#= (z)&''	r   r   N)r   r   r   r   Zidr   _r&   r(   r   r   Zmediasr$   r0   r.   r2   r6   r   __classdictcell__r4      @r   r   r      sK     	BDY<DFEm$F
I r   r   c                   sV   a  ] tR t^Ot o RtRtRtRt]R 4       t	]
R 4       tR tRtV tR# )r   zGame for the Dolphin emulatorr   c                sv   VR,          ;'       g.    \         P                  P                  VR,          4      ^ ,          pV ! 4       pW#n        \	        VR,          4      Vn        \        V4      Vn        VP                  V4      Vn	        \        P                  ! RVR,          RVR,          RR /4      Vn        V# )	z:Create a service game from an entry from the Dolphin cacheZinternal_nameZ	file_nameZgame_idr   Z	file_pathr+   Ni)r   r   Zsplitextr&   r3   appidr   r'   
get_bannerr   r,   Zdumpsr%   )Zclscache_entryr&   Zservice_games   &&  r   r    ZDolphinGame.new_from_cacheV   s     ?+\\rww/?/?K@X/YZ[/\u  Y!78#DM(33K@#zz6;{3KZYdeoYpqtrtYu*vwr   c                s    V R ,          p\        VP                  4       4      ^8  d   ^M^ p\        V\        VP                  4       4      V,          ,          4      # )Z
long_names)r5   Zkeysr3   Zlist)r=   ZnamesZ
name_indexs   &  r   get_game_nameZDolphinGame.get_game_namec   sE    L)ejjl+a/QQ
5ejjl+J7899r   c                sH   \        4       pVP                  V P                  4      ^ ,          P                  p\        P                  P                  V4      '       d   V# VR,          w  w  rEpV'       d/   \        P                  ! RWE3VRR4      pVP                  V4       V# R# )r    Zvolume_bannerZRGBZrawZBGRXZ )	r   Zget_possible_media_pathsr;   r   r   Zexistsr   Z	frombytesr!   )r"   r=   ZbannerZbanner_pathZwidthZheightZdataZimgs   &&      r   r<   ZDolphinGame.get_banneri   s    55djjA!DII77>>+&& +O <//%%$PC HH[!r   r   N)r   r   r   r   Z__doc__r   r(   Zinstaller_slugZclassmethodr    Zstaticmethodr>   r<   r   r8   r9   r:   r   r   r   O   sG     'GFN
 
 : :
 r   r   )r,   r   r   r7   Ztypingr   ZPILr   Zlutrisr   Zlutris.runners.dolphinr   Zlutris.services.baser   Zlutris.services.service_gamer   Zlutris.services.service_mediar   Zlutris.utilr	   Z lutris.util.dolphin.cache_readerr
   r   Zlutris.util.stringsr   r   r   r   r   r   r   <module>r?      sS     	      , , 4 6  X 'JL J2[ 2j)+ )r   