Skip to content

feat: support dynamic Peertube source icons via grayjay-plugin-peertube implementation#943

Open
geco wants to merge 1 commit into
futo-org:masterfrom
geco:feature/dynamic-source-icons
Open

feat: support dynamic Peertube source icons via grayjay-plugin-peertube implementation#943
geco wants to merge 1 commit into
futo-org:masterfrom
geco:feature/dynamic-source-icons

Conversation

@geco

@geco geco commented May 12, 2026

Copy link
Copy Markdown

feat: support dynamic Peertube source icons via grayjay-plugin-peertube implementation

Summary

Currently, source icons are static and derived solely from the iconUrl defined in the plugin's configuration JSON. While this works for general purposes, it doesn't allow plugins to provide dynamic icons based on the specific instance configuration.

This PR introduces a mechanism to fetch dynamic icons by calling a getIcon() method directly from the plugin implementation if available.

Changes

  • Backend: Added a new endpoint /sources/GetDynamicIcon in SourcesController that invokes the getIcon method of the target plugin.
  • Frontend:
    • Integrated getDynamicIcon into SourcesBackend and StateGlobal.
    • Updated the Sources page and related components to attempt fetching the dynamic icon first.
    • Implemented a fallback mechanism: if the dynamic icon is unavailable or the plugin does not implement the method, it reverts to the static absoluteIconUrl (derived from the JSON iconUrl).

Use Case: PeerTube

This is specifically designed to support the PeerTube plugin, allowing it to display the actual icon configured on the peer-to-peer instance.
The plugin-side implementation of this feature can be found in this PR:
👉 futo-org/grayjay-plugin-peertube#3

Testing

  • Verified that sources with a getIcon method now display their dynamic icon.
  • Verified that sources without the method still display their static config icon correctly.

@futo-cla-pr-labler

Copy link
Copy Markdown

Please sign our contributor license agreement at https://cla.futo.org

@futo-cla-pr-labler

Copy link
Copy Markdown

Please sign our contributor license agreement at https://cla.futo.org

@geco

geco commented May 12, 2026

Copy link
Copy Markdown
Author

Please sign our contributor license agreement at https://cla.futo.org

Done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants