jellyfin-lessons/plugin/Data/Models/LessonMedia.cs
Scott Scoble deecc1dd7c feat: add SQLite data store with Lesson and LessonMedia models
- Add Microsoft.Data.Sqlite NuGet package to csproj
- Create Lesson model (Id, Title, Grade, Subject, LessonDate, Description, SourcePath, CompiledHtml, CreatedAt, UpdatedAt)
- Create LessonMedia model (LessonId, JellyfinItemId, SortOrder)
- Create LessonStore with SQLite-backed CRUD operations:
  - Constructor expands ~ in dbPath to home directory
  - Creates lessons and lesson_media tables on init
  - GetAllLessons(), GetLessonById(), GetLessonsByGrade()
  - UpsertLesson() with media association handling
  - DeleteLesson() with FK cascade
- Enables foreign key enforcement via PRAGMA
- Build passes with 0 warnings, 0 errors

Closes #4
2026-05-15 21:37:56 -07:00

22 lines
No EOL
548 B
C#

namespace JellyfinLessons.Data.Models;
/// <summary>
/// Join model linking lessons to Jellyfin media items.
/// </summary>
public class LessonMedia
{
/// <summary>
/// Foreign key to the lesson.
/// </summary>
public string LessonId { get; set; } = string.Empty;
/// <summary>
/// Identifier of the Jellyfin media item.
/// </summary>
public string JellyfinItemId { get; set; } = string.Empty;
/// <summary>
/// Display order within the lesson.
/// </summary>
public int SortOrder { get; set; }
}