feat: Lessons page with API and sidebar nav entry (#5) #15

Merged
sscoble merged 1 commit from issue-5-lessons-page into main 2026-05-16 04:49:32 +00:00
Owner

Summary

Adds the Lessons plugin page accessible from the Jellyfin sidebar.

Changes

  • LessonsController: REST endpoint GET /Plugins/Lessons/List returning JSON array of lesson summaries ({id, title, grade, subject, lessonDate, description})
  • LessonStore DI: Registered as singleton in ServiceRegistrator pointing to ~/.local/share/jellyfin-lessons/lessons.db
  • Lessons page: Embedded HTML resource with grouped listing (by grade), styled for Jellyfin, fetches from /Plugins/Lessons/List
  • Sidebar nav: Implements IHasWebPages on Plugin class with EnableInMainMenu=true for nav entry
  • Build fixes: Added ImplicitUsings, Nullable, Microsoft.AspNetCore.App FrameworkReference, and fixed IPluginServiceRegistrator signature for 10.10.x

Acceptance

  • dotnet build passes
  • Plugin exposes "Lessons" in Jellyfin sidebar
  • Page lists lessons grouped by grade (empty state when no data)
  • API endpoint returns valid JSON

Closes #5

## Summary Adds the Lessons plugin page accessible from the Jellyfin sidebar. ### Changes - **LessonsController**: REST endpoint `GET /Plugins/Lessons/List` returning JSON array of lesson summaries (`{id, title, grade, subject, lessonDate, description}`) - **LessonStore DI**: Registered as singleton in `ServiceRegistrator` pointing to `~/.local/share/jellyfin-lessons/lessons.db` - **Lessons page**: Embedded HTML resource with grouped listing (by grade), styled for Jellyfin, fetches from `/Plugins/Lessons/List` - **Sidebar nav**: Implements `IHasWebPages` on Plugin class with `EnableInMainMenu=true` for nav entry - **Build fixes**: Added `ImplicitUsings`, `Nullable`, `Microsoft.AspNetCore.App` FrameworkReference, and fixed `IPluginServiceRegistrator` signature for 10.10.x ### Acceptance - [x] `dotnet build` passes - [x] Plugin exposes "Lessons" in Jellyfin sidebar - [x] Page lists lessons grouped by grade (empty state when no data) - [x] API endpoint returns valid JSON Closes #5
sscoble added 1 commit 2026-05-16 04:48:55 +00:00
- Add LessonsController with GET /Plugins/Lessons/List endpoint
- Add LessonStore DI registration in ServiceRegistrator
- Add lessonsPage.html embedded resource with grouped lesson listing
- Implement IHasWebPages in Plugin for sidebar nav entry
- Add ImplicitUsings/Nullable to csproj for net9.0 compatibility
- Add Microsoft.AspNetCore.App FrameworkReference for MVC
- Fix ServiceRegistrator to match 10.10.x IPluginServiceRegistrator signature
First-time contributor

Reviewed — looks good.

✅ Correctly uses IHasWebPages (10.10.x replacement for IPluginConfigurationPage)
✅ REST controller with clean DI injection
✅ ServiceRegistrator uses correct two-parameter signature from MediaBrowser.Controller
✅ Grouped by grade, Jellyfin dark theme, empty state handled
✅ Embedded HTML resource approach follows Jellyfin conventions

One heads-up for #6: the lesson cards have cursor:pointer but no click handler yet. In #6, wire onclick to navigate to a detail view — either via window.location to a detail page or by rendering inline. Approving.

Reviewed — looks good. ✅ Correctly uses IHasWebPages (10.10.x replacement for IPluginConfigurationPage) ✅ REST controller with clean DI injection ✅ ServiceRegistrator uses correct two-parameter signature from MediaBrowser.Controller ✅ Grouped by grade, Jellyfin dark theme, empty state handled ✅ Embedded HTML resource approach follows Jellyfin conventions One heads-up for #6: the lesson cards have cursor:pointer but no click handler yet. In #6, wire `onclick` to navigate to a detail view — either via `window.location` to a detail page or by rendering inline. Approving.
sscoble merged commit 5e9fdd1748 into main 2026-05-16 04:49:32 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: sscoble/jellyfin-lessons#15
No description provided.