Implement verified curriculum, video review, watch sessions, ledger safeguards, and remove demo data
This commit is contained in:
@@ -79,6 +79,7 @@ class SocraticOptionModel {
|
||||
/// Model for Lesson Playback Data (Streams, Versions, Chapters, Checkpoints)
|
||||
class LessonPlaybackData {
|
||||
final int lessonId;
|
||||
final String? videoVersionId;
|
||||
final String title;
|
||||
final int durationSeconds;
|
||||
final String videoUrl;
|
||||
@@ -89,6 +90,7 @@ class LessonPlaybackData {
|
||||
|
||||
const LessonPlaybackData({
|
||||
required this.lessonId,
|
||||
this.videoVersionId,
|
||||
required this.title,
|
||||
required this.durationSeconds,
|
||||
required this.videoUrl,
|
||||
@@ -129,9 +131,10 @@ class LessonPlaybackData {
|
||||
final lastPos = (json['last_position_seconds'] ?? playback['last_position_seconds'] ?? json['progress']?['position_seconds']) as num?;
|
||||
|
||||
return LessonPlaybackData(
|
||||
lessonId: (lesson['id'] as num?)?.toInt() ?? 0,
|
||||
title: lesson['title']?.toString() ?? 'الدرس التفاعلي',
|
||||
durationSeconds: (lesson['duration_seconds'] as num?)?.toInt() ?? 0,
|
||||
lessonId: (lesson['id'] as num?)?.toInt() ?? (json['lesson_id'] as num?)?.toInt() ?? 0,
|
||||
videoVersionId: json['video_version_id']?.toString(),
|
||||
title: lesson['title']?.toString() ?? json['title']?.toString() ?? 'الدرس التفاعلي',
|
||||
durationSeconds: (lesson['duration_seconds'] as num?)?.toInt() ?? (json['duration_seconds'] as num?)?.toInt() ?? 0,
|
||||
videoUrl: vidUrl,
|
||||
storageType: playback['storage_type']?.toString() ?? 'api_upload',
|
||||
availableVersions: versions,
|
||||
@@ -142,6 +145,7 @@ class LessonPlaybackData {
|
||||
|
||||
LessonPlaybackData copyWith({
|
||||
int? lessonId,
|
||||
String? videoVersionId,
|
||||
String? title,
|
||||
int? durationSeconds,
|
||||
String? videoUrl,
|
||||
@@ -152,6 +156,7 @@ class LessonPlaybackData {
|
||||
}) {
|
||||
return LessonPlaybackData(
|
||||
lessonId: lessonId ?? this.lessonId,
|
||||
videoVersionId: videoVersionId ?? this.videoVersionId,
|
||||
title: title ?? this.title,
|
||||
durationSeconds: durationSeconds ?? this.durationSeconds,
|
||||
videoUrl: videoUrl ?? this.videoUrl,
|
||||
|
||||
Reference in New Issue
Block a user