Manhwa.ReaderController (manhwa v0.1.0)

Copy Markdown View Source

The reader's own controller, mounted by Manhwa.Router.manhwa_reader/2.

Every action resolves the current user via Manhwa.Config.current_user/1 and persists through the configured Manhwa.Store (plus the optional Manhwa.Annotations / Manhwa.GifProvider adapters). show/2 renders the long-strip reader; the manga package overrides dispatch to add paged mode on the same surface.

Summary

Functions

The mode-independent payload behind the images API. The manga package augments it with the paged canvas layout.

Invoke an optional store callback, returning default when unimplemented.

The mount prefix of the reader routes, recovered from the request path by dropping this route's trailing segments — works no matter what host scopes wrap the macro.

Series segments for the request, per the router macro's series_segments.

Entry for the strip reader — validates the series, applies the ?from_max=1 resume snap, and renders. Public so a dispatching controller (the manga package) can route scroll-mode series here.

URL assigns shared by both reader templates. Only valid from the show route (base = path minus series + chapter segments).

Validate the series and resolve the user, running fun.(series, user); 404s on an unknown series. Wraps every series-scoped action.

Functions

attach_etcher_comment(conn, params)

chapter_images(conn, params)

chapter_images_data(user, series, chapter, opts)

The mode-independent payload behind the images API. The manga package augments it with the paged canvas layout.

create_mark_annotation(conn, params)

debug_log(conn, params)

delete_mark(conn, params)

etcher_assigns(conn, user, series, chapter, fresco_id)

gif_search(conn, params)

gif_trending(conn, params)

list_marks(conn, params)

list_shapes(user, series, chapter)

optional_store(fun, args, default \\ :ok)

Invoke an optional store callback, returning default when unimplemented.

proxy_image(conn, arg2)

reader_base(conn, trailing)

The mount prefix of the reader routes, recovered from the request path by dropping this route's trailing segments — works no matter what host scopes wrap the macro.

seg_count(conn)

series(conn, params)

Series segments for the request, per the router macro's series_segments.

show(conn, params)

strip(conn, params)

Entry for the strip reader — validates the series, applies the ?from_max=1 resume snap, and renders. Public so a dispatching controller (the manga package) can route scroll-mode series here.

toggle_page_override(conn, params)

update_comments_visible(conn, params)

update_progress(conn, params)

update_reading_direction(conn, params)

update_reading_mode(conn, params)

update_reading_rotation(conn, params)

update_smart_crop(conn, params)

update_tap_zone_preset(conn, params)

url_assigns(conn, series, chapter)

URL assigns shared by both reader templates. Only valid from the show route (base = path minus series + chapter segments).

with_series(conn, params, fun)

Validate the series and resolve the user, running fun.(series, user); 404s on an unknown series. Wraps every series-scoped action.