# 010 — Current state (audit 2026-09-30)

Historical snapshot taken before any skin work. Kodi 21.3 (Git
20251031-a3a448d26b) on macOS, active skin `skin.estuary` 4.0.0.

## 1. Addon entry points

- `main.py` → `wcs/router.router()` — about 150 `action=` values. The
  top of `router.py` imports almost every module (TMDb, Webshare, search,
  library, AI handler, dialogs), so every plugin call pays that import cost.
  This matters for widgets (060 §2).
- `service.py` (starts at login): one-off settings migration, AI model
  migration, autostart (addon / MyTV / MyCinema), Webshare VIP check, then
  `run_dev_harness()` (live harness listener, idle unless enabled).
- `addon.xml` extension points: `xbmc.python.pluginsource` (video) and
  `xbmc.service`. No `kodi.context.item`.

## 2. Features (user-facing)

| Area | Entry (router action) | UI |
|------|-----------------------|----|
| MyTV (TV channels from series) | `my_tv_dialog` | `ai/DialogMyTV*.xml` (4 designs), `MediaChannelManager` |
| MyCinema (film channels) | `my_cinema_dialog` | same dialog class family |
| Continue watching | `continue_watching_dialog` | dialog |
| Recently played | `recently_played` | directory listing |
| Search (TMDb movies + series) | `tmdb_universal_search` | directory listing with history (`search_history_universal.json`) |
| Source search (Webshare/Kraska for one title) | `show_search_dialog` | `search/DialogWcsSearch.xml` |
| TMDb / ČSFD browsing | `tmdb_movies`, `tmdb_series`, `csfd_*` | directory listings |
| Kraska / StreamCinema | `kraska_browse`, `kraska_browse_path` | directory listings |
| Favourite actors / directors / writers | `favorite_*`, `display_*_dialog` | listings + dialogs |
| Milionář game | `play_text_game` (`title`, `tmdb_id`, `media_type`, episode params) | `games/DialogWcsTextGame.xml` |
| Similar | `display_similar_movies_dialog`, `display_similar_series_dialog` (`tmdb_id`) | `details_extras/DialogSimilarMovies.xml` |
| AI recommendations / chat | `ai_chat_recommendation` | `ai/DialogAIChatRecommendation.xml` |
| Details | `show_wcs_details` | `details_extras/DialogWcsDetails.xml` |
| Settings | `settings` | Kodi addon settings |

Main menu (`ui.display_main_menu`) as captured: MyTV, MyCinema, Kraska,
Vyhledávání, Seriály, Filmy, Nastavení (+ optional items from settings
`menu_show_*`).

## 3. Kodi library integration

- **Adding:** `wcs/library/LibraryManager.py` writes `.strm` files into the
  folders from settings (`library_movies_folder`, series folder), content
  `plugin://plugin.video.milionar?action=play_movie_from_library&title=…&year=…`
  or `…play_episode_from_library&series_name=…&season=…&episode=…&tmdb_id=…`,
  then `UpdateLibrary(video, <folder>)` when `library_auto_update` is on.
- **Scraping:** Kodi's own `metadata.themoviedb.org.python` /
  `metadata.tvshows.themoviedb.org.python`; sources `movies` and `series` in
  `sources.xml` point to `/Users/chudy/kodi-media/{movies,series}/`
  (16 movies, 7 series today). Library items therefore carry
  `ListItem.UniqueID(tmdb)`.
- **Playback:** the `.strm` URL runs the plugin, which searches the providers
  and plays; `PlayerMonitor` then drives the info dialog with the game and the
  autoplay countdown (`docs/features/005-playback-dialogs.md`). Library
  metadata is read with JSON-RPC `VideoLibrary.Get*`.
- **Gap:** nothing in the library UI points back to the addon (no context
  menu, no info-dialog action).

## 4. Addon UI

- 40+ `WindowXMLDialog` XML files under `resources/skins/Default/1080i/<area>/`
  (ai, details_extras, devtools, games, guide, login, notifications/{classic,
  minimal, modern, premium}, search). No full `WindowXML` window.
- House style: premium notification dialogs (dark translucent cards, white
  pill focus), textures generated by `resources/media/generate_*.py`.

## 5. Fonts the addon asks for but Estuary does not define

Estuary 21.3 `Font.xml` (fontset Default) defines: `font10, font12, font13,
font14, font20_title, font23_narrow, font25_narrow, font25_title, font27,
font27_narrow, font30_title, font32, font32_title, font36_title, font37,
font40_title, font45, font45_title, font52_title, font60, font_MainMenu,
font_clock, font_flag, Mono26, WeatherTemp`.

The addon XML also uses undefined names (count of uses): `font14_bold` 89,
`font16` 57, `font24` 56, `font30` 41, `font16_bold` 21, `font12_bold` 10,
`font_fallback` 4, `font20` 2, `font40` 1, `font11` 1, `font16_italic` 1.
Kodi falls back to its default font for them today. **Decided:** the skin
keeps Estuary's font set unchanged so the addon renders exactly as in
Estuary; fixing these names is addon backlog outside this plan
(`900-decisions.md`).

## 6. How Kodi finds a dialog XML (source-verified, `WindowXML.cpp` 21.3)

For `WindowXMLDialog('<area>/<Name>.xml', addon_path, 'Default', '1080i')`:

1. the **active skin**: `<skin>/xml/<area>/<Name>.xml`,
2. the addon: `resources/skins/<active skin id>/<res>/…`,
3. the addon: `resources/skins/Default/1080i/…`.

So `skin.milionar` could override addon dialogs; by decision 4 it does not.

## 7. Tooling state

- Live harness (`scripts/dialog_harness/kodi_live.py`, listener
  `wcs/devtools/harness_service.py`) works: `status`, `open`, `keys`, `shot`,
  `dialog`, `info`, `start/restart/stop` verified on 2026-09-30.
- **Kodi runs at 2560x1440 fullscreen**, not 1920x1080 as `AGENTS.md` says;
  every capture is scaled to 1920x1080 and marked "not pixel-exact". Decided
  to keep 2560x1440 and compare native captures (100 §2); `AGENTS.md` should
  be corrected in F0.
- The offline renderer (`render_dialog.py`) does not understand skin includes
  and cannot render skin windows; skin work is verified live only.
- `TexturePacker` is not installed. Estuary as installed ships only
  `media/Textures.xbt` (+ `curial.xbt`, `flat.xbt`); the loose PNG sources
  are in `xbmc/xbmc` at tag `21.3-Omega` (`addons/skin.estuary`, 938 files,
  7.35 MB, of which `media/` 689 files 0.86 MB and `language/` 1.31 MB).
- Captures from the audit: `scripts/dialog_harness/out/live/skinplan/`
  (`home.png`, `addon_menu.png`, `mytv.png`, `mycinema.png`).
