Manhwa.ReaderState (manhwa v0.1.1)

Copy Markdown View Source

Normalized access to the per-series state map returned by Manhwa.Store.reader_state/2, plus the settings resolution cascade (package default → saved setting → per-device slot → transient URL override — the URL layer is applied by the controllers).

Summary

Functions

Resolve "mobile" / "desktop" for the request. Priority: explicit ?device= param → User-Agent sniff → "desktop".

Reading mode for the resolved device — the per-device slot wins, falling back to the generic field. nil when nothing is saved.

Tap-zone preset for the resolved device, same fallback shape.

The device slot a settings write should target: explicit device=mobile|desktop|all form field wins; otherwise UA detection, so in-reader toggles update the slot the user is actually on.

Fetch a key off the (possibly nil) state map/struct.

Functions

device_kind(conn, params)

Resolve "mobile" / "desktop" for the request. Priority: explicit ?device= param → User-Agent sniff → "desktop".

effective_reading_mode(state, arg2)

Reading mode for the resolved device — the per-device slot wins, falling back to the generic field. nil when nothing is saved.

effective_tap_zone_preset(state, arg2)

Tap-zone preset for the resolved device, same fallback shape.

effective_update_device(conn, params)

The device slot a settings write should target: explicit device=mobile|desktop|all form field wins; otherwise UA detection, so in-reader toggles update the slot the user is actually on.

get(state, key)

Fetch a key off the (possibly nil) state map/struct.

normalize_device(arg1)