§
   (-[=#ó`Vã                   ó  — d Z i dd“dd“dd“dd“d	d
“dd“dd“dd“dd“dd“dd“dd“dd“dd“dd“dd “d!d"“d#d$d%d&d'd(d)d*d+d,d-œ
¥Zd.Zd/Zd0Zeez   Zd1Zd2Zd3„ ZdEd5„Z	dEd6„Z
d7„ ZdFd9„Zd:„ Zd;Zd<d=d=d=d>d>d>d?d@œZdA„ ZdB„ ZdGdD„Zd4S )Hu[  The genres of the browser (docs/plan/genre-browser/010 Â§Å½Ã¡nry). Pure: no Kodi, no network.

A genre of the browser is not a TMDb id: films and series have their own genre lists. Every entry says which TMDb ids it
asks for each media (OR), so the genre page can switch between Filmy / SeriÃ¡ly / Oboje on the same genre:

  * Filmy  -> the 19 film genres,
  * SeriÃ¡ly -> the 16 series genres (the combined ones as they are: "AkÄ�nÃ­ a dobrodruÅ¾nÃ½"),
  * VÅ¡e / Oboje -> the film genres with the series genres folded in (TV "Sci-Fi & Fantasy" -> Sci-Fi and Fantasy), like
    wcs/foryou/features.folded_genres, plus the TV-only genres.

TV-only genres (Kids, News, Reality, Soap, Talk) are hidden unless the widget says otherwise. Names are our own strings
(cs/sk/en, TMDb does not translate the series genres); a genre TMDb adds later keeps TMDb's name.
Úaction)i­Š  )é   ©i*  Ú	adventure)i®Š  )é   r   Ú	animation)i¯Š  ©é   r   Úcomedy)i°Š  ©é#   r   Úcrime)i±Š  ©éP   r   Údocumentary)i²Š  ©éc   r   Údrama)i³Š  ©é   r   Úfamily)i´Š  ©iÿ)  r   Úfantasy)iµŠ  )é   ©i*  Úhistory)i¶Š  )é$   © Úhorror)i·Š  )é   r   Úmusic)i¸Š  )i¢(  r   Úmystery)i¹Š  ©i°%  r"   Úromance)iºŠ  )iý)  r   Úscifi)i»Š  )én  r   Útvmovie)i¼Š  )i*  r   Úthriller)i½Š  )é5   r   )i¾Š  ©i *  ©i*  )i¿Š  ©é%   r+   )iÀŠ  )r   r   r   )iÁŠ  )r%   r   r   )iÂŠ  r)   r*   )iÃŠ  r   )i
*  )iÄŠ  r   )i*  )iÅŠ  r   )i*  )iÆŠ  r   )i*  )iÇŠ  r   )i*  )
ÚwarÚwesternÚaction_adventureÚscifi_fantasyÚwar_politicsÚkidsÚnewsÚrealityÚsoapÚtalk)r2   r3   r4   r5   r6   )r   r   r   r
   r   r   r   r   r   r   r   r    r!   r#   r$   r&   r'   r-   r.   )r/   r   r
   r   r   r   r   r2   r!   r3   r4   r0   r5   r6   r1   r.   )r   r
   r'   r   r   r#   r   r   r   r!   r   r$   r   r0   r/   r   r   r-   r    r&   r.   r2   r5   r1   r4   r6   r3   Útmdbc                 óD   — | dk    rt           n| dk    rt          nt          S )NÚmovieÚtv)ÚMOVIEÚTVÚALL)Úmodes    ú`/Users/chudy/Library/Application Support/Kodi/addons/plugin.video.milionar/wcs/genres/catalog.pyÚ	mode_keysr@   >   s    € Ø˜G’O�O�5ˆ5¨t°tª|¨|­¨ÅÐDó    Nc                 óÔ   — | t           v rt           |          |dk    rdnd         S |pi                      | ¦  «        }|r*t          |d                              |¦  «        pd¦  «        ndS )zSTMDb genre ids of `key` for `media` (empty: the genre has no titles of that media).r9   é   é   Úidsr   )ÚGENRESÚgetÚtuple)ÚkeyÚmediaÚextraÚentrys       r?   rE   rE   B   sn   € à
�f€}€}Ý�cŒ{ ¨Ò 0Ð 0˜1˜1°aÔ8Ð8Øˆ[�b×Ò˜cÑ"Ô"€EØ38Ð@�5��u”×!Ò! %Ñ(Ô(Ð.¨BÑ/Ô/Ð/¸bÐ@rA   c                 óP   ‡ ‡— |dvrdn|f}t          ˆˆ fd„|D ¦   «         ¦  «        S )z•The media the genre page asks for: `wanted` is 'movie', 'tv' or '' (both); a genre without titles of a media
    drops it ('' -> only the other one).©r9   r:   c              3   ó>   •K  — | ]}t          ‰|‰¦  «        ¯|V — Œd S ©N)rE   )Ú.0ÚmrK   rI   s     €€r?   ú	<genexpr>zmedia_of.<locals>.<genexpr>N   s4   øè è € Ð9Ð9�q¥c¨#¨q°%Ñ&8Ô&8Ð9�Ð9Ð9Ð9Ð9Ð9Ð9rA   )rH   )rI   ÚwantedrK   Úmediass   ` ` r?   Úmedia_ofrV   J   sA   øø€ ð !'¨oÐ =Ð =ˆ_ˆ_ÀFÀ9€FÝÐ9Ð9Ð9Ð9Ð9˜FÐ9Ñ9Ô9Ñ9Ô9Ð9rA   c                 ó”  — d„ dD ¦   «         }i }dD ]¶}| pi                       |¦  «        pg D ]š}|                      d¦  «        }|rt          |¦  «        ||         v rŒ1|                     t          t	          |¦  «        z   |                      d¦  «        pt	          |¦  «        i dœ¦  «        }t          |¦  «        f|d         |<   Œ›Œ·|S )z§Genres TMDb has that the table does not: {'tmdb<id>': {'name', 'ids': {media: (id,)}}}.
    `api_lists`: {'movie': [{'id', 'name'}], 'tv': [...]} (genre/<media>/list).c                 ó\   ‡— i | ](Š‰ˆfd „t                                ¦   «         D ¦   «         “Œ)S )c                 ó:   •— h | ]}|‰d k    rdnd         D ]}|’ŒŒS )r9   rC   rD   r   )rQ   rL   ÚirJ   s      €r?   ú	<setcomp>z$extras.<locals>.<dictcomp>.<setcomp>T   s;   ø€ ÐaÐaÐa˜5¸UÈÐQXÒHXÐHXÀ1À1Ð^_Ô=`ÐaÐa¸�QÐaÐaÐaÐarA   )rF   Úvalues)rQ   rJ   s    @r?   ú
<dictcomp>zextras.<locals>.<dictcomp>T   s9   ø€ ÐÐÐÐfkˆUÐaÐaÐaÐa¥F§M¢M¡O¤OÐaÑaÔaÐÐÐrA   rN   ÚidÚname)r_   rE   rE   )rG   ÚintÚ
setdefaultÚEXTRAÚstr)Ú	api_listsÚknownÚfoundrJ   ÚgenreÚgidrL   s          r?   Úextrasri   Q   sê   € ð @ÐÐo~ÐÑÔ€EØ€EØ ð .ð .ˆØ�o 2×*Ò*¨5Ñ1Ô1Ð7°Rð 	.ð 	.ˆEØ—)’)˜D‘/”/ˆCØð �#˜c™(œ( e¨E¤lÐ2Ð2ØØ×$Ò$¥U­S°©X¬XÑ%5ÀÇ	Â	È&Ñ@QÔ@QÐ@]ÕUXÐY\ÑU]ÔU]ÐfhÐ7iÐ7iÑjÔjˆEÝ#& s¡8¤8 +ˆE�%ŒL˜ÑÐð	.ð €LrA   Fc                 óî   ‡ ‡— ˆ ˆfd„t           D ¦   «         }t          |pi                      ¦   «         ¦  «        D ]:\  }}‰ dv r|d                              ‰ ¦  «        sŒ%|                     |¦  «         Œ;|S )zOThe genre keys of a mode in the fixed order (popularity, then the TMDb extras).c                 óL   •— g | ] }|t          ‰¦  «        v ¯‰s	|t          v¯|‘Œ!S r   )r@   ÚTV_ONLY)rQ   Úkr>   Úshow_tv_onlys     €€r?   ú
<listcomp>zlisted.<locals>.<listcomp>b   s9   ø€ ÐaÐaÐa�! Q­)°D©/¬/Ð%9Ð%9¸|Ð%9ÈqÕX_ÐO_ÐO_ˆAÐO_ÐO_ÐO_rA   rN   rE   )Ú
POPULARITYÚsortedÚitemsrG   Úappend)r>   rn   rK   ÚkeysrI   rL   s   ``    r?   Úlistedru   `   sŠ   øø€ àaÐaÐaÐaÐa•zÐaÑaÔa€DÝ˜e˜k r×0Ò0Ñ2Ô2Ñ3Ô3ð ð ‰
ˆˆUØ�?Ð"Ð"¨5°¬<×+;Ò+;¸DÑ+AÔ+AÐ"ØØ�Š�CÑÔÐÐØ€KrA   c                 ó”   — ddl m} | t          vrdS t          |          \  }}}t          |¦  «        pt           ||¦  «        ¦  «        S )zÝThe folded (film) genre ids a genre stands for in the Pro tebe profile (wcs/foryou/features.folded_genres):
    its film ids (Fantasy is 14, not the 878 its series genre folds onto too), else its folded series ids (Kids).é    )Úfolded_genresr   )Úwcs.foryou.featuresrx   rF   rH   )rI   rx   Ú_stringr9   r:   s        r?   Ú	taste_idsr{   j   sY   € ð 2Ð1Ð1Ð1Ð1Ð1Ø
•&ÐÐØˆrÝ œÑ€GˆU�BÝ�‰<Œ<Ð3�5  ¨rÑ!2Ô!2Ñ3Ô3Ð3rA   )ÚlibraryÚwatchedÚlikeÚdisliker|   r}   r~   r   )Úlistr}   ÚstartedÚtriedr~   Úpickrg   r   c                 ó–  — d„ t           D ¦   «         }| D ]˜\  }}}t                               |¦  «        }|r|sŒ%t          t	          |¦  «        ¦  «        t          |¦  «        z  }|D ]D}||                              t          |¦  «        d¦  «        |z   ||         t          |¦  «        <   ŒEŒ™d„ |                     ¦   «         D ¦   «         S )zÛ{source: {genre id: weight}} from the Pro tebe seeds [(kind, weight, folded genre ids)]; a seed counts for each
    of its genres by its weight, split over them (a drama-comedy is half of each), dislikes count negative.c                 ó   — i | ]}|i “ŒS r   r   )rQ   Úsources     r?   r]   z!genre_sources.<locals>.<dictcomp>}   s   € Ð
,Ð
,Ð
,˜&ˆ6�2Ð
,Ð
,Ð
,rA   ç        c                 óR   — i | ]$\  }}|d „ |                      ¦   «         D ¦   «         “Œ%S )c                 ó6   — i | ]\  }}|t          |d ¦  «        “ŒS )é   )Úround)rQ   ÚgÚvs      r?   r]   z,genre_sources.<locals>.<dictcomp>.<dictcomp>…   s&   € Ð?Ð?Ð?©¨¨1�Q�˜a ™œÐ?Ð?Ð?rA   )rr   )rQ   r†   r\   s      r?   r]   z!genre_sources.<locals>.<dictcomp>…   s5   € ÐbÐbÐbÁNÀFÈFˆFÐ?Ð?°·²±´Ð?Ñ?Ô?ÐbÐbÐbrA   )ÚSOURCESÚSEED_SOURCErG   ÚabsÚfloatÚlenr`   rr   )ÚseedsÚoutÚkindÚweightÚgenresr†   Úsharerh   s           r?   Úgenre_sourcesr™   z   sÜ   € ð -Ð
,¥GÐ
,Ñ
,Ô
,€CØ %ð Kð KÑˆˆf�fÝ—’ Ñ&Ô&ˆØð 	˜Vð 	ØÝ•E˜&‘M”MÑ"Ô"¥S¨¡[¤[Ñ0ˆØð 	Kð 	KˆCØ$'¨¤K§O¢OµC¸±H´H¸cÑ$BÔ$BÀUÑ$JˆC�ŒK�˜C™œÑ!Ð!ð	KàbÐbÐVY×V_ÒV_ÑVaÔVaÐbÑbÔbÐbrA   c           
      óÊ  ‡‡	— i }| D ]‹}d}t           D ]z}|pi                      |¦  «        pi Š	t          ˆ	fd„t          |¦  «        D ¦   «         pdg¦  «        }||dk    rdndt	          |                     |d¦  «        ¦  «        z  |z  z  }Œ{|||<   ŒŒt          t          |                     ¦   «         ¦  «        dgz   ¦  «        Šˆfd„|                     ¦   «         D ¦   «         S )u¸   {key: score 0..1} of the genres: Î£ weight(source) Ã— the genre's share in that source, relative to the best.
    A dislike lowers the score (weights['dislike'] is applied as a minus).r‡   c           
      ó~   •— g | ]9}‰                      |‰                      t          |¦  «        d ¦  «        ¦  «        ‘Œ:S )r‡   )rG   rc   )rQ   rŒ   r\   s     €r?   ro   zscores.<locals>.<listcomp>�   s;   ø€ ÐXÐXÐXÀA˜Ÿš A v§z¢zµ#°a±&´&¸#Ñ'>Ô'>Ñ?Ô?ÐXÐXÐXrA   r   éÿÿÿÿrC   g      ð?c                 ó2   •— i | ]\  }}|‰d k    r|‰z  nd“ŒS )rw   r‡   r   )rQ   rI   ÚvalueÚbests      €r?   r]   zscores.<locals>.<dictcomp>”   s/   ø€ ÐSÐSÐS¹¸¸eˆC $¨¢( (�%˜$‘,�,°ÐSÐSÐSrA   )rŽ   rG   Úmaxr{   r‘   r€   r\   rr   )
rt   ÚsourcesÚweightsÚrawrI   Útotalr†   rž   rŸ   r\   s
           @@r?   Úscoresr¥   ˆ   s  øø€ ð €CØð ð ˆØˆÝð 	bð 	bˆFØ�m ×(Ò(¨Ñ0Ô0Ð6°BˆFÝÐXÐXÐXÐXÍÐSVÉÌÐXÑXÔXÐaÐ]`Ð\aÑbÔbˆEØ˜F iÒ/Ð/�b�b°Q½%ÀÇÂÈFÐTWÑ@XÔ@XÑ:YÔ:YÑYÐ\aÑaÑaˆEˆEØˆˆC‰ˆÝ�t�C—J’J‘L”LÑ!Ô! S EÑ)Ñ*Ô*€DØSÐSÐSÐSÀsÇyÂyÁ{Ä{ÐSÑSÔSÐSrA   r   c                 óà   ‡ ‡‡‡‡‡— t          ‰ ||¦  «        Šˆˆ fd„}t          ˆfd„‰ D ¦   «         |¬¦  «        Š‰t          ˆˆˆfd„‰ D ¦   «         |¬¦  «        z   Š‰ˆfd„‰ D ¦   «         z   ‰fS )zÄ'My' genres (score >= threshold) by score, then the others in their given order. The genres chosen in the guide
    (`first`, onboarding D36) lead, by score among themselves. Returns (keys, mine).c                 ó@   •— ‰|           ‰                      | ¦  «        fS rP   )Úindex)rm   rf   rt   s    €€r?   ú<lambda>zordered.<locals>.<lambda>›   s   ø€ �u˜Q”x�i §¢¨A¡¤Ð/€ rA   c                 ó   •— g | ]}|‰v ¯|‘Œ	S r   r   )rQ   rm   Úfirsts     €r?   ro   zordered.<locals>.<listcomp>œ   s   ø€ Ð3Ð3Ð3˜1¨¨U¨
¨
�Q¨
¨
¨
rA   )rI   c                 óL   •— g | ] }|‰v¯‰|         d k    ¯‰|         ‰k    ¯|‘Œ!S )rw   r   )rQ   rm   Úchosenrf   Ú	thresholds     €€€r?   ro   zordered.<locals>.<listcomp>�   s?   ø€ ÐjÐjÐj !¨q¸¨¨À5ÈÄ8ÈaÂ<À<ÐTYÐZ[ÔT\Ð`iÒTiÐTi˜AÐTiÐTiÐTirA   c                 ó   •— g | ]}|‰v¯|‘Œ	S r   r   )rQ   rm   Úmines     €r?   ro   zordered.<locals>.<listcomp>ž   s   ø€ Ð4Ð4Ð4˜ a¨t m m�1 m m mrA   )r¥   rq   )	rt   r¡   r¢   r®   r«   Úrankr­   rf   r°   s	   `  `` @@@r?   Úorderedr²   —   s«   øøøøøø€ õ �4˜ 'Ñ*Ô*€EØ/Ð/Ð/Ð/Ð/€DÝÐ3Ð3Ð3Ð3 Ð3Ñ3Ô3¸Ð>Ñ>Ô>€FØ•FÐjÐjÐjÐjÐjÐj tÐjÑjÔjÐptÐuÑuÔuÑu€DØÐ4Ð4Ð4Ð4˜dÐ4Ñ4Ô4Ñ4°dÐ:Ð:rA   rP   )FN)r   )Ú__doc__rF   rl   r;   r<   r=   rp   rb   r@   rE   rV   ri   ru   r{   rŽ   r�   r™   r¥   r²   r   rA   r?   ú<module>r´      s(  ððð ð
ØÐ&ð
àÐ)ð
ð Ð&ð
ð Ð#ð	
ð
 Ð"ð
ð Ð(ð
ð Ð"ð
ð Ð)ð
ð Ð'ð
ð Ð!ð
ð Ð ð
ð Ð"ð
ð Ð(ð
ð Ð$ð
ð Ð&ð
ð  Ð$ð!
ð" Ð"ð#
ð$ 'Ø$Ø3Ø1Ø/Ø!Ø!Ø$Ø!Ø!ð7
ð 
ð 
€ð: 6€ð	d€ðM€àˆg�o€ð_€
ð 	€ðEð Eð EðAð Að Að Að:ð :ð :ð :ðð ð ðð ð ð ð4ð 4ð 4ð 4€Ø ¨YÀ9ÐW`ÐjpØ¨¸9ðFð F€ðcð cð cðTð Tð Tð;ð ;ð ;ð ;ð ;ð ;rA   