# Milionář library — plan of record

Status: **L0-L6 done and accepted by the user (2026-10-01); the plan is complete** - read `140-handoff.md` for the final state. Every
question is decided (`900-decisions.md`); the plan has no open questions.

The addon takes over everything the Kodi video library does for the user —
My movies / My series lists, watched and in-progress state, resume, Continue
watching, next episode across seasons, autoplay with the countdown, TMDb
metadata and caches — and `skin.milionar` shows only this data. The Kodi
library integration (`.strm` export, library playback, library context items)
stays and keeps working in other skins; it is an extension, nothing is
removed.

Builds on `docs/plan/skin-milionar/` (the skin itself, harness, widgets
infrastructure). Read its `000-index.md` "Current state" first.

## Start here: the board (2026-10-01)

| # | Task | Status | Where |
|---|------|--------|-------|
| L0 | Store, TMDb metadata cache, playback fixture provider, unit-test harness | **done** (user OK 2026-10-01) | 030 §6 |
| L1 | Canonical play URLs, service playback tracker, resume, watched, Kodi mirror sync | **done** (user tested a movie and an episode, order L2→L5 confirmed 2026-10-01) | 040 §7 |
| L2 | Next episode engine, autoplay countdown for every addon series, collection offer | **done** (user OK 2026-10-01: real source works) | 050 §6b, 140 |
| L3 | My movies / My series native browsing (Videos window listings) | **done** (user OK 2026-10-01) | 060 §6 |
| L4 | Home: menu items, widget slots, skin settings, Continue rows | **done** (user OK 2026-10-01) | 070 §6 |
| L5 | Context menu everywhere, search rows, game picker and info button on addon data | **done** (user OK 2026-10-01) | 080 §4, 090 |
| L6 | Acceptance and docs (`docs/features/013-milionar-library.md`) | **done** (user OK 2026-10-01, feature doc `docs/features/013-milionar-library.md`) | 120 §5 |

Statuses: **done**, **ready** (fully specified; build it), **blocked** (on what).

## Rules for an agent continuing this work

1. Build what the chapters specify; do not reopen decisions. If a fact found
   during implementation contradicts a decision, stop and ask the user with
   the question tool (options, recommendation), record the answer in
   `900-decisions.md` and the chapter.
2. **Reliability first.** Watched / in-progress / next-episode behaviour is the
   product here. Every rule in 040 and 050 has a unit test (120 §2) and the
   state machine is exercised live with the fixture provider (120 §3).
3. **Targeted tests only** (user rule, memory `feedback-targeted-tests-only`):
   test exactly what a step changed; never run the full skin baseline unless
   the user asks. Open / capture only screens that are in this plan and that
   the step touched; never the old My list dialog (`DialogWcsMyList`), it will
   not exist in the new skin (see `AGENTS.md`, "Verifying work").
4. **Kodi GUI is not thread-safe**: player and playlist calls happen on the
   service's main loop, never from worker threads (`AGENTS.md`).
5. **MyTV / MyCinema are separate worlds**: they never read or write the new
   store (decision 3); their channel histories stay as they are.
6. **Kodi library data never enters skin.milionar** (rows, search, game
   picker, Continue). Library features keep working in other skins.
7. Hand off after every phase with what to test; the next phase starts after
   the user's OK. Update the chapter ("Result" with numbers), this board and
   `docs/plan/skin-milionar/000-index.md` "Current state". No commits unless
   the user asks.
8. Chat in Czech, briefly; repository text in English. New strings in cs, sk,
   en.

## Goal

- **My movies, My series** as main-menu items opening native Estuary
  Videos windows (all views, sorting, info dialog), with watched ticks and
  progress bars from the addon's own data. Kodi's Movies / TV shows items are
  hidden by default (still available in skin settings).
- **Every play from the addon is tracked** (except MyTV / MyCinema): resume
  position, watched state, last activity, the exact source file used.
- **Continue** shows in-progress movies and, per series, the in-progress
  episode or the next episode — across season boundaries, specials skipped,
  unaired next episodes with their date.
- **Autoplay** of the next episode with the existing countdown dialog for
  every series played from the addon, season rollover included.
- **One context menu** (play / watched state / lists and channels /
  discovery) on every movie, series, season and episode in the skin; no
  "Add to Kodi library" anywhere in skin.milionar.
- **Configurable Home rows**: up to 6 slots per section, each with type,
  count, sort and style, chosen in skin settings.

## Locked decisions (2026-10-01)

1. Thresholds like Kodi: in progress after 180 s; watched at ≥ 90 % or when
   the next episode starts through the countdown; both editable in addon
   settings (040 §3).
2. Tracking covers everything played from the addon; lists change only by
   the user (040 §1).
3. MyTV / MyCinema write nothing to the new store, not even ticks (040 §1).
4. Clicking a Continue item resumes immediately with the same source file,
   falling back to the best automatic pick; next episodes start from 0
   (070 §4).
5. My movies / My series open native Videos windows with addon listings
   (060).
6. Home rows: slot system, all row types available, defaults in 070 §3.
7. Continue on Home: two rows by default — movies and series — then Recently
   played (070 §3).
8. Search: "In my library" rows replaced by "In My movies / My series" (090).
9. Specials (season 0) are skipped by Continue and autoplay (050 §2).
10. Finished-but-running series stay in Continue with the next episode's air
    date, not playable until it airs (050 §3).
11. Clean start for watch state and history; My movies (3) and My series (12)
    lists are kept (030 §5).
12. Context menu groups: playback, watch state, lists and channels, discovery
    (080).
13. Kodi's own watched / resume items stay usable: the addon mirrors its
    state into Kodi and adopts changes made there (040 §6).
14. Movie collections: at the end a countdown-style offer of the next film,
    never an automatic start (050 §5).

## Chapters

**Current handoff for a new agent: [140-handoff.md](140-handoff.md).**

| File | Topic |
|------|-------|
| [010-current-state.md](010-current-state.md) | What exists today and why it is not enough |
| [020-architecture.md](020-architecture.md) | Components, processes, contracts |
| [030-data-store.md](030-data-store.md) | SQLite store, TMDb metadata cache, clean start |
| [040-playback-tracking.md](040-playback-tracking.md) | Canonical play URL, tracker, thresholds, resume, Kodi mirror |
| [050-next-episode.md](050-next-episode.md) | Next episode engine, rollover, unaired, autoplay, collections |
| [060-browsing.md](060-browsing.md) | My movies / My series listings in native windows |
| [070-home.md](070-home.md) | Menu, widget slots, row catalogue, skin settings |
| [080-context-menu.md](080-context-menu.md) | One context menu for every item |
| [090-search-and-skin-touchpoints.md](090-search-and-skin-touchpoints.md) | Search rows, game picker, info button, library mentions |
| [120-verification.md](120-verification.md) | Unit tests, fixture provider, targeted live checks |
| [130-roadmap.md](130-roadmap.md) | Phases L0–L6 with exit criteria |
| [900-decisions.md](900-decisions.md) | Decision log |
