# 007d - Play Selection (MyTV AppleTV Inline Dialog)

**Status:** COMPLETED
**Updated:** 2026-02-22 23:35
**XML:** `DialogMyTV_appletv.xml` [L2919-3487](file:///Users/chudy/Library/Application%20Support/Kodi/addons/plugin.video.milionar/resources/skins/Default/1080i/ai/DialogMyTV_appletv.xml#L2919-L3487)
**Python:** `DialogMyTV.py` [L1748-1882](file:///Users/chudy/Library/Application%20Support/Kodi/addons/plugin.video.milionar/wcs/ai/DialogMyTV.py#L1748-L1882)

---

## Ucel

Dialog pro volbu akce po kliknuti na epizodu v program listu (9000) nebo hero zone (9042). Zobrazuje metadata epizody a nabizi moznosti: prehrat, prehrat serial, prehrat kanal, editovat postup, hrat Milionare.

---

## Aktivace

- **Trigger:** klik na epizodu v program listu (9000) nebo hero zone (9042)
- **Metoda:** [_show_play_selection_dialog()](file:///Users/chudy/Library/Application%20Support/Kodi/addons/plugin.video.milionar/wcs/ai/DialogMyTV.py#L1752)
- **Property:** `WCS.MyTV.PlaySelection` = `true`
- **Zavreni:** ESC/Back nebo [_hide_play_selection_dialog()](file:///Users/chudy/Library/Application%20Support/Kodi/addons/plugin.video.milionar/wcs/ai/DialogMyTV.py#L1870)

---

## 5 vizualnich variant (setting)

Setting `mytv_play_selection_style` mapuje na `WCS.PlaySelect.Style`:

| Setting value | Style key | XML oblast | Popis |
|---------------|-----------|------------|-------|
| Fullscreen | `fullscreen` | L2919-3063 | Fullscreen fanart + fade |
| Inline Detail | `inline` | L3064-3162 | Maly panel pod program listem |
| Side Panel+ | `sidepanel` | L3163-3267 | Pravy panel |
| **Modal Card** | `modal` | L3268-3487 | **Default.** 1600x720 card (matching Grid/Detail) |
| Klasický | `classic` | (starsi layout) | Jednoduchy dialog |

Kazda varianta pouziva stejne control IDs a properties, lisi se jen layoutem.

---

## Control ID mapa (sdilene vsemi variantami)

| ID | Typ | Ucel |
|----|-----|------|
| 9023 | button | Přehrát epizodu (dynamicky label: "Pokračovat" pokud resume) |
| 9020 | button | Přehrát kanál (od této epizody) |
| 9021 | button | Pouze seriál |
| 9026 | button | Upravit postup → otevře Edit Progress (007e) |
| 9027 | button | Milionář (episode mode) |
| 9022 | button | Zavřít / Zrušit |
| 9025 | button | Přesunout (program reorder) |

---

## Window Properties

| Property | Popis |
|----------|-------|
| `WCS.MyTV.PlaySelection` | `true` = dialog viditeln |
| `WCS.MyTV.PlaySelection.ScrollLock` | `true` = zamceni scrollu program listu |
| `WCS.PlaySelect.Style` | Vizualni varianta (`modal`, `fullscreen`, ...) |
| `WCS.PlaySelect.SeriesName` | Nazev serialu |
| `WCS.PlaySelect.EpCode` | Formatovany kod ("Sezona 1 Epizoda 5") |
| `WCS.PlaySelect.EpTitle` | Nazev epizody |
| `WCS.PlaySelect.Plot` | Popis |
| `WCS.PlaySelect.Poster` | Poster URL |
| `WCS.PlaySelect.Fanart` | Fanart URL |
| `WCS.PlaySelect.Still` | Episode still (thumb) |
| `WCS.PlaySelect.SeriesLogo` | Clearlogo |
| `WCS.PlaySelect.MetaLine` | Rok | Zanr | Runtime | Rating |
| `WCS.PlaySelect.Year` | Rok |
| `WCS.PlaySelect.Genre` | Zanr |
| `WCS.PlaySelect.Runtime` | Delka |
| `WCS.PlaySelect.Rating` | ★ 8.2/10 |
| `WCS.PlaySelect.PlayEpLabel` | "Přehrát epizodu" nebo "Pokračovat" |

---

## onClick routing

| Control | Metoda | Popis |
|---------|--------|-------|
| 9023 | `_play_single_episode()` | Prehrani jedne epizody |
| 9020 | `_play_channel_from_selected()` | Playlist od vybrane epizody |
| 9021 | `_play_series_only()` | Playlist pouze z jednoho serialu |
| 9026 | `_show_edit_progress_dialog()` | Otevre Edit Progress (007e) |
| 9027 | `_show_game_dialog()` | Milionar (episode context) |
| 9022 | `_hide_play_selection_dialog()` | Zavre dialog |
| 9025 | `_enter_program_reorder_mode()` | Reorder program listu |

---

## Resume detekce

`_show_play_selection_dialog()` [L1828-1844](file:///Users/chudy/Library/Application%20Support/Kodi/addons/plugin.video.milionar/wcs/ai/DialogMyTV.py#L1828-L1844):
- Kontroluje `ChannelHistory.get_resume_point(channel_id, tmdb_id)`
- Pokud `position > 10` → label "Pokračovat" misto "Přehrát epizodu"

---

## Zavislosti

- `ChannelHistory` -- resume points
- `PlaylistBuilder` -- sestaveni playlistu
- `MillionaireMyTVAdapter` -- Milionar z epizody
- Edit Progress sub-dialog (007e) -- editace postupu
- `ProgressManager` -- sledovani postupu
