feat: configurable media bar content source (collections/playlists)#43
Conversation
…and an expanded configuration interface across frontend and backend. Signed-off-by: enyineer <nico.enking@gmail.com>
|
Hey! Just a heads-up — this PR includes some formatting/whitespace changes alongside the actual feature work. These came from the IDE auto-formatter running on files that were touched during development (e.g. consistent indentation, trailing spaces, quote style normalization in JS). They don't affect functionality at all, but I understand they add noise to the diff. If you'd prefer to keep those out and only have the feature-related changes, just let me know and I'll revert the formatting to match the original style. Happy either way! |
|
For a library option, I think people were also interested in picking which libraries to use. It'd probably be convenient to have a synced setting for selected library ids that all clients can use. --Just imo, but maybe someone else can chime in. |
|
Great idea, I'll look into that at Sunday (maybe earlier if I have time for it). Would be interested in Axl's opinion though. |
…abar # Conflicts: # frontend/src/components/settings.js # frontend/src/utils/storage.js
Allow users to optionally select specific Jellyfin libraries when using Library (Random) mode. When no libraries are selected, all libraries are used (preserving existing default behavior). - Add mediaBarLibraryIds to backend models and settings service - Extend getRandomItems() API to support parentId filtering per library - Add library picker UI in user settings and admin config page - Reuse collection picker styling for consistent UX
|
I agree with @broken-droid it should be per-library and we can build out an endpoint that the tv and mobile clients can use as well but I can handle that part |
I like it. I think it makes sense to keep content type too. You don't really know how everyone has their libraries set up. |
|
Sorry was out and about doing errands, looing at #48 now |
|
The main thing I get asked for lately is local trailers and per-library for the media bar |
- Remove mediaBarContentType from backend models, service, frontend storage/settings/mediabar/api, and README - Add GET /Moonfin/MediaBar?profile= endpoint that resolves user settings and queries ILibraryManager for media bar items server-side - Frontend calls unified endpoint first with client-side fallback - Update README with new library selection settings and MediaBar endpoint
Changes in this updateRemoved:
|
…diabar # Conflicts: # frontend/src/components/mediabar.js # frontend/src/utils/api.js
✅ Build SuccessfulThe plugin compiled successfully against .NET 8 / Jellyfin 10.10.0.
|
|
There's still a bug with Collections / Playlists in the new endpoint return 0 results. I'll investigate. |
|
Fix: Collections/Playlists in MediaBar endpoint The Subsequent fixes using Final approach avoids all unstable method signatures:
This keeps the plugin compatible with both Jellyfin 10.10 and 10.11+. |
59a9d4f to
e4bed26
Compare
please do, it makes it a bit harder to review the PR |
|
Thanks for your good review comments. Will look at it ASAP (either in a few hours or tomorrow). I'm not at home currently. |
|
Eagerly waiting so I can push this update out and start working on the other apps too |
|
Give me 20 minutes or so ;-) |
…ormatting revert - Replace new Random() with Random.Shared via shared ShuffleAndTake() helper - Implement partial Fisher-Yates: O(limit) instead of O(n) for shuffle - Add .editorconfig, .prettierrc, .prettierignore for consistent formatting - Reformat JS files with prettier to match upstream single-quote/4-space style - Re-indent configPage.html to match upstream 4-space style - Revert all formatting-only changes from previous commits
Changes addressing review comments✅ Implemented
Partial Fisher-Yates shuffle — When Formatting revert — Added ❌ Cannot implement (cross-version compatibility)User-aware
Since this plugin targets ABI 10.10.0, calling Multiple parent IDs — Remaining formatting noiseThere's still some formatting diff in the JS files (~35-50% of their line counts). This is because our previous commits used double quotes and mixed 2-space indentation, while the codebase uses single quotes with 4-space indentation. Prettier normalized these to match. The changes are purely cosmetic (verified by stripping whitespace+quotes and comparing — the logic is byte-identical). Is this remaining quote/indent normalization noise acceptable, or would you prefer we strip it out further? Happy to split the formatting into a separate commit if that helps with review. |
|
Give me another 10 minutes to test please before reviewing and merging. Edit: manual testing looks good. Requesting review. |
Additional note on the user-aware query (security fix)To clarify — the suggestion to use However, implementing this requires the
Since the plugin currently targets ABI 10.10.0, using To implement this fix directly, we would need to change the ABI target from 10.10 to 10.11, which would make the plugin incompatible with Jellyfin 10.10 installations. The same applies to DB-side Possible workaround:
|
|
I really would prefer the prettier files removed and the formatting noise removed. |
|
To the point where I wont approve this unless it's removed. |
|
Working on it. Can't cherry pick because it's one commit. |
…nd shuffle - Replace mediaBarContentType with mediaBarSourceType (library/collection) - Add server-side MediaBar endpoint with client-side fallbacks - Add collection/library picker UI in settings panel - Add shuffle toggle for collection items - Add admin default settings for source type, collections, libraries - Remove prettier config files - Restore upstream formatting in settings.css
|
Tried to remove all formatting noise, my local tests are still fine. I hope I didn't miss anything, but it looks good to me. Sorry for the hassle. |
|
no worries, this just looks cleaner and smaller commit to go over. Let me look now. Did you also see the comments @broken-droid left earlier? |
|
Yes, but as mentioned, we cannot fix the security issue without using Would like to have your opinion on this. Updating the ABI would allow other performance optimizations @broken-droid mentioned, removing the need to do some shuffling and other stuff in memory, but that would exclude any Jellyfin 10.10. Users from using this Plugin. |
|
would either of these work for multiple parentids, or is that another restriction |
…ges, filter backend item processing to movies and series, and ensure the mediabar is hidden when not on the home page. Signed-off-by: enyineer <nico.enking@gmail.com>
Shuffling is handled client-side. Removes ShuffleAndTake method, shuffle parameter from GetCollectionItems, and shuffle variable from GetMediaBarItems. Keeps MediaBarShuffleItems setting for client-side use.
…immediately if no sync is performed. Signed-off-by: enyineer <nico.enking@gmail.com>
…with robust random ordering via reflection. Signed-off-by: enyineer <nico.enking@gmail.com>
Changed the usages as suggested. Please review. |
|
Thanks for merging and I'm very sorry for the mess in this PR. Hope the next one will be cleaner again. I'll remember to not change any formatting. |
|
No worries, just don't just take whatever AI gives you at face value and commit or comment it. Read the code and understand it too otherwise it becomes a headache for everyone involved. |


Summary
Closes #39
Allows administrators and users to configure the media bar to display content from specific Jellyfin collections and/or playlists, instead of only random library items.
Features
Changes
Backend
MoonfinSettingsProfile.cs— addedMediaBarSourceType,MediaBarCollectionIds,MediaBarShuffleItemsMoonfinUserSettings.cs— added matching legacy v1 fields for migrationMoonfinSettingsService.cs— added reset entries inClearLegacyFieldsconfigPage.html— added admin default controls (source type dropdown, collection picker, shuffle toggle)Frontend
api.js— addedgetCollectionsAndPlaylists()andgetCollectionItems()methodsmediabar.js—loadContent()branches on source type;applySettings()tracks new settingssettings.js— source dropdown, collection picker UI, shuffle toggle,loadCollectionPicker()methodstorage.js— defaults + server↔local sync mappings for 3 new settingssettings.css— collection picker stylesScreenshots
User Settings — Default (Random)
User Settings — Collections / Playlists
Admin Settings — Default Collections / Playlists