# 010 — Cleanup before the account (A01)

Created: 2026-11-06
Updated: 2026-11-06

Standa, 2026-11-06: *„migraci kompletně zrušit a vyčistit code! Po instalaci se spustí jen onboarding a ne
migrace“* (S15); *„zrcadlo do kodi knihovny kompletně zrušit a odstranit… budeme používat jen svoje řešení“* (S16);
*„kráska a cinemastream mají být kompletně z našeho celýho doplnku 100% navždy kompletně odstraněny“* (S21).
Old data and old settings on users' devices are left alone and never read (S15, S17). Lists below are from
2026-11-06; re-check them with the `grep` given before changing anything.

## 1. Migration from old addon versions (A01.1)

`grep -rn --include='*.py' -iE "migrat|import_watchlists|watchlist_import|LEGACY_FILES|\.migrated|_OLD\b" wcs main.py service.py scripts tests`

| Where | What | Action |
|---|---|---|
| `wcs/library2/migration.py` | legacy list migration (offer, run, Home warm-up) | delete the module |
| `main.py` `library_migrate` action, `NotifyAll(...skin_migration_finished)` | entry | delete |
| `wcs/skin/service.py` `migration_offered`, `RunPlugin(...library_migrate&auto=1)`, `skin_migration_finished` event | automatic offer | delete |
| `wcs/library2/store.py` `LEGACY_FILES`, `import_watchlists`, `_import_id`, `inspect_watchlist_import`, `_import_bad_constant`, `watchlist_import_empty`, `_import_backup` | import of old lists | delete |
| `wcs/user_data.py` `_migrate_search_history_from_settings` | settings → JSON | delete (read only the JSON) |
| `wcs/user_data.py` `_RECENTLY_PLAYED_FILE_OLD` fallback | old file name | delete (read only `global_watch_history.json`) |
| `wcs/user_data.py` watchlist load/store (`watchlist_*.json`) | old lists | delete if no live caller remains after the above (check `grep`) |
| `wcs/ai/usage_store.py` `legacy_json_path`, import of `ai_usage_stats.json` → `.migrated` | old costs | delete |
| `service.py` `migrate_ai_models`, `wcs/ai/model_catalog.py` `migrate_model_settings` | stored model fix-up | delete (S15 explicitly) — keep the catalogue |
| `resources/settings.xml` `library_migrate_button` + strings | button | delete |
| flags `watchlists.migration.*` | state | no code reads them any more |
| tests: `scripts/library_harness/test_upgrade.py` and any test of the above | | delete or reduce to what remains |

§1.3 `wcs/skin/transition.py`: `run()` is used by the onboarding (`launch.prepare_skin`) on a clean install → keep.
Classify `offer_startup()` and `family.LEGACY` (`MODERN`, `FLAT`, `GLASS` skin ids of older versions): if they only
move users of older addon versions to the single skin, delete them; record the evidence here.

§1.4 Keep `wcs/defaults.py` `enforce_addon_defaults` (the release's defaults snapshot `--snapshot-defaults`) — it is
not a migration of old data. Keep `store._migrate` (the store's own schema versions).

## 2. Mirror into Kodi's video library (A01.2)

`grep -rn --include='*.py' -E "mirror|request_adoption|check_paths|adopt_from_kodi|SetFileDetails|GetFileDetails|MyVideos" wcs main.py service.py scripts tests`
(files on 2026-11-06: `wcs/library2/{mirror,reset,jobs,store,tracker,ctx,policy}.py`, `wcs/genres/widgets.py`,
`scripts/skin_harness/gen_cinema.py`, `scripts/library_harness/{test_upgrade,test_rules,test_mark_performance}.py`).

| Where | Action |
|---|---|
| `wcs/library2/mirror.py` | delete |
| `jobs.py` `process_mirrors`, `request_adoption`, `process_adoptions`, `_adoptions` queue | delete; `loop` keeps `process_marks` |
| callers of `request_adoption` / `check_paths` (listings, rows, genre widgets, the service's 5 s focused-container check, the tracker's post-stop check) | delete the calls |
| `store.py` `_queue_mirror` | becomes `_changed()`: keeps `state_version + 1` and `conn.widget_titles.add(...)`; no `mirror_pending` |
| `store.py` `set_mirrored`, `pending_mirrors`, `mirror_pending`, `retry_mirror`, `adopt_from_kodi` | delete |
| `reset.py` `_zero_kodi_records`, `_reset_kodi_library`, counts `kodi_mirror`, `kodi_library` | delete; reset touches only the addon's data |
| `policy.py`, `ctx.py`, `tracker.py` mirror branches | delete |
| schema | `mirror_pending` and `mirrored_*` columns stay in existing files, unused (T18); a fresh DB may still create them — do not add a migration to drop them |
| docs | `docs/plan/milionar-library/040` §6 and `900-decisions.md` #13: "removed 2026-11 (account plan S16)" |

Must verify (F4 of the master findings): after a stop Kodi stores its own bookmark for the played plugin URL; the
next play must resume only through the addon (no Kodi "Resume from …" dialog, no double seek). If Kodi shows its
dialog, find how the addon starts playback (`ListItem` properties `ResumeTime`/`StartOffset`, `setResumePoint(0)`)
and fix it there, then record it here.

## 3. Kráska and StreamCinema (A01.3)

`grep -rliE "kraska|streamcinema|stream cinema|sc_auth|kra\.sk" wcs main.py service.py context.py resources scripts tests`

Python (2026-11-06): `wcs/kraska/`, `wcs/streamcinema/`, `wcs/login/DialogKraskaLogin.py`,
`wcs/ui/dialogs/guide/DialogKraskaGuide.py`, `wcs/provider_keys.py` (`KRASKA_AVAILABLE`), `wcs/utils.py`,
`wcs/user_data.py`, `wcs/ui/dialogs/DialogWcsSearch.py`, `wcs/router.py`, `wcs/ui/UI.py`, `wcs/ui/assets.py`,
`wcs/skin/{actions,warm,refresh,slots,library_actions,widgets,context,perflog,refresher,hero_contract}.py`,
`wcs/library2/{clicks,rows,resolver,fixture_provider}.py`, `wcs/search/{ranking,SeriesSearch}.py`,
`wcs/webshare/WebshareClient.py`.
XML: `resources/skins/Default/1080i/guide/DialogKraskaGuide.xml`, `login/DialogKraskaLogin.xml`,
`search/DialogWcsSearch.xml`; skin `Home.xml`, `Includes_MilionarSlots.xml`, `Includes_MilionarCinema.xml` (generated:
change `scripts/skin_harness/gen_slots.py`, `gen_cinema.py`, `templates/appearance-settings.xml` and regenerate).
Settings: `kraska_enabled`, `kraska_token`, `kraska_user`, `kraska_pass`, `kraska_status`, `kraska_days_left`,
`sc_auth_token`. Strings in `resources/language/*/strings.po` (≈ 9 in cs) and the skin's strings. The skin section
`kraska` (`refresh.SECTIONS`, slot base 27000 in `gen_slots.py` and the old migration's `SLOT_BASES`), the row
`widget_kraska_root` (`refresh.NETWORK_ROWS`), the Home menu item, tests and measurement scripts referencing them.

Action: delete all of it; the sources code paths keep Webshare only; the measurement outputs under
`scripts/skin_harness/out/` are history and may stay. A skin string id that is removed must not be reused.

## Result

Done 2026-11-06 and released in 2.1.132 (skin 1.3.111). Details and evidence: WEB `phases/A01-addon-cleanup.md`.
