Skip to content

Remove Labymod proxy and add YouTube trailer feature - #150

Merged
Flash303 merged 3 commits into
mainfrom
dev
Nov 4, 2026
Merged

Flash303 merged 3 commits into
mainfrom
dev

Conversation

@Flash303

@Flash303 Flash303 commented Nov 4, 2026

Copy link
Copy Markdown
Owner

This pull request introduces backend support for caching and serving LabyMod server manifest metadata (notably YouTube trailer IDs) and removes the redundant manifest-fetching logic from the frontend. The frontend now consumes this data directly from the backend, simplifying the client code and improving performance.

Backend: LabyMod Manifest Caching and Fetching

  • Added a laby_manifest_cache (with TTL) to AppState and initialized it in main.rs to store per-server manifest metadata, such as YouTube trailer IDs. [1] [2]
  • Implemented functions in laby.rs to:
    • Extract and validate manifest URLs from server attachments, ensuring only allowlisted origins are accepted.
    • Fetch and parse manifests asynchronously, extracting the yt_trailer field.
    • Periodically refresh and cache manifest data for all known servers via refresh_laby_manifests. [1] [2] [3]
  • Updated construct_laby_info to include the yt_trailer field from the cache in the API response. [1] [2]

Frontend: Manifest Data Consumption and Code Simplification

  • Removed all code and types related to fetching/parsing LabyMod manifests on the client; the frontend now receives yt_trailer and supported_languages directly via client_infos.laby. [1] [2] [3] [4] [5] [6] [7] [8]
  • Updated ServerSidebar to use the new backend-provided fields, removing the need for a separate labyManifest prop and related logic. [1] [2] [3] [4] [5] [6]

Routing Cleanup

  • Removed the now-unnecessary /api/laby/manifest route from the frontend routing configuration.

Testing

  • Added unit tests for manifest URL extraction, allowlist enforcement, and manifest parsing in the backend.

These changes centralize manifest data handling on the backend, reduce client complexity, and improve performance and security by validating manifest sources and caching results.

@Flash303
Flash303 merged commit 3418bc7 into main Nov 4, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant