diff --git a/ClassTranscribeDatabase/Migrations/20231211224116_PlaylistMediaOptions.Designer.cs b/ClassTranscribeDatabase/Migrations/20231211224116_PlaylistMediaOptions.Designer.cs new file mode 100644 index 00000000..89be233b --- /dev/null +++ b/ClassTranscribeDatabase/Migrations/20231211224116_PlaylistMediaOptions.Designer.cs @@ -0,0 +1,1893 @@ +// +using System; +using ClassTranscribeDatabase; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; + +namespace ClassTranscribeDatabase.Migrations +{ + [DbContext(typeof(CTDbContext))] + [Migration("20231211224116_PlaylistMediaOptions")] + partial class PlaylistMediaOptions + { + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn) + .HasAnnotation("ProductVersion", "3.1.1") + .HasAnnotation("Relational:MaxIdentifierLength", 63); + + modelBuilder.Entity("ClassTranscribeDatabase.Models.ASLVideo", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("text"); + + b.Property("CreatedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("CreatedBy") + .HasColumnType("text"); + + b.Property("DeletedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("DeletedBy") + .HasColumnType("text"); + + b.Property("Domain") + .HasColumnType("text"); + + b.Property("DownloadURL") + .HasColumnType("text"); + + b.Property("IsDeletedStatus") + .HasColumnType("integer"); + + b.Property("Kind") + .HasColumnType("integer"); + + b.Property("LastUpdatedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("LastUpdatedBy") + .HasColumnType("text"); + + b.Property("LicenseTag") + .HasColumnType("text"); + + b.Property("Likes") + .HasColumnType("integer"); + + b.Property("Source") + .HasColumnType("text"); + + b.Property("Term") + .HasColumnType("text"); + + b.Property("Text") + .HasColumnType("text"); + + b.Property("UniqueASLIdentifier") + .HasColumnType("text"); + + b.Property("WebsiteURL") + .HasColumnType("text"); + + b.HasKey("Id"); + + b.ToTable("ASLVideos"); + }); + + modelBuilder.Entity("ClassTranscribeDatabase.Models.ASLVideoGlossaryMap", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("text"); + + b.Property("ASLVideoId") + .HasColumnType("text"); + + b.Property("CreatedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("CreatedBy") + .HasColumnType("text"); + + b.Property("DeletedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("DeletedBy") + .HasColumnType("text"); + + b.Property("GlossaryId") + .HasColumnType("text"); + + b.Property("IsDeletedStatus") + .HasColumnType("integer"); + + b.Property("LastUpdatedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("LastUpdatedBy") + .HasColumnType("text"); + + b.Property("Published") + .HasColumnType("boolean"); + + b.HasKey("Id"); + + b.ToTable("ASLVideoGlossaryMaps"); + }); + + modelBuilder.Entity("ClassTranscribeDatabase.Models.ApplicationUser", b => + { + b.Property("Id") + .HasColumnType("text"); + + b.Property("AccessFailedCount") + .HasColumnType("integer"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnType("text"); + + b.Property("Email") + .HasColumnType("character varying(256)") + .HasMaxLength(256); + + b.Property("EmailConfirmed") + .HasColumnType("boolean"); + + b.Property("FirstName") + .HasColumnType("text"); + + b.Property("LastName") + .HasColumnType("text"); + + b.Property("LockoutEnabled") + .HasColumnType("boolean"); + + b.Property("LockoutEnd") + .HasColumnType("timestamp with time zone"); + + b.Property("Metadata") + .IsRequired() + .HasColumnType("text"); + + b.Property("NormalizedEmail") + .HasColumnType("character varying(256)") + .HasMaxLength(256); + + b.Property("NormalizedUserName") + .HasColumnType("character varying(256)") + .HasMaxLength(256); + + b.Property("PasswordHash") + .HasColumnType("text"); + + b.Property("PhoneNumber") + .HasColumnType("text"); + + b.Property("PhoneNumberConfirmed") + .HasColumnType("boolean"); + + b.Property("SecurityStamp") + .HasColumnType("text"); + + b.Property("Status") + .HasColumnType("integer"); + + b.Property("TwoFactorEnabled") + .HasColumnType("boolean"); + + b.Property("UniversityId") + .HasColumnType("text"); + + b.Property("UserName") + .HasColumnType("character varying(256)") + .HasMaxLength(256); + + b.HasKey("Id"); + + b.HasIndex("NormalizedEmail") + .HasName("EmailIndex"); + + b.HasIndex("NormalizedUserName") + .IsUnique() + .HasName("UserNameIndex"); + + b.HasIndex("UniversityId"); + + b.ToTable("AspNetUsers"); + }); + + modelBuilder.Entity("ClassTranscribeDatabase.Models.Caption", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("text"); + + b.Property("Begin") + .HasColumnType("interval"); + + b.Property("CaptionType") + .HasColumnType("integer"); + + b.Property("CreatedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("CreatedBy") + .HasColumnType("text"); + + b.Property("DeletedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("DeletedBy") + .HasColumnType("text"); + + b.Property("DownVote") + .HasColumnType("integer"); + + b.Property("End") + .HasColumnType("interval"); + + b.Property("Index") + .HasColumnType("integer"); + + b.Property("IsDeletedStatus") + .HasColumnType("integer"); + + b.Property("LastUpdatedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("LastUpdatedBy") + .HasColumnType("text"); + + b.Property("Text") + .HasColumnType("text"); + + b.Property("TranscriptionId") + .HasColumnType("text"); + + b.Property("UpVote") + .HasColumnType("integer"); + + b.HasKey("Id"); + + b.HasIndex("TranscriptionId"); + + b.ToTable("Captions"); + }); + + modelBuilder.Entity("ClassTranscribeDatabase.Models.Course", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("text"); + + b.Property("CourseNumber") + .HasColumnType("text"); + + b.Property("CreatedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("CreatedBy") + .HasColumnType("text"); + + b.Property("DeletedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("DeletedBy") + .HasColumnType("text"); + + b.Property("DepartmentId") + .HasColumnType("text"); + + b.Property("FilePath") + .HasColumnType("text"); + + b.Property("IsDeletedStatus") + .HasColumnType("integer"); + + b.Property("LastUpdatedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("LastUpdatedBy") + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("DepartmentId"); + + b.ToTable("Courses"); + }); + + modelBuilder.Entity("ClassTranscribeDatabase.Models.CourseOffering", b => + { + b.Property("CourseId") + .HasColumnType("text"); + + b.Property("OfferingId") + .HasColumnType("text"); + + b.Property("CreatedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("CreatedBy") + .HasColumnType("text"); + + b.Property("DeletedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("DeletedBy") + .HasColumnType("text"); + + b.Property("FilePath") + .HasColumnType("text"); + + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("text"); + + b.Property("IsDeletedStatus") + .HasColumnType("integer"); + + b.Property("LastUpdatedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("LastUpdatedBy") + .HasColumnType("text"); + + b.HasKey("CourseId", "OfferingId"); + + b.HasIndex("OfferingId"); + + b.ToTable("CourseOfferings"); + }); + + modelBuilder.Entity("ClassTranscribeDatabase.Models.Department", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("text"); + + b.Property("Acronym") + .HasColumnType("text"); + + b.Property("CreatedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("CreatedBy") + .HasColumnType("text"); + + b.Property("DeletedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("DeletedBy") + .HasColumnType("text"); + + b.Property("IsDeletedStatus") + .HasColumnType("integer"); + + b.Property("LastUpdatedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("LastUpdatedBy") + .HasColumnType("text"); + + b.Property("Name") + .HasColumnType("text"); + + b.Property("UniversityId") + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("UniversityId"); + + b.ToTable("Departments"); + }); + + modelBuilder.Entity("ClassTranscribeDatabase.Models.Dictionary", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("text"); + + b.Property("CreatedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("CreatedBy") + .HasColumnType("text"); + + b.Property("DeletedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("DeletedBy") + .HasColumnType("text"); + + b.Property("IsDeletedStatus") + .HasColumnType("integer"); + + b.Property("Key") + .HasColumnType("text"); + + b.Property("LastUpdatedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("LastUpdatedBy") + .HasColumnType("text"); + + b.Property("Value") + .HasColumnType("text"); + + b.HasKey("Id"); + + b.ToTable("Dictionaries"); + }); + + modelBuilder.Entity("ClassTranscribeDatabase.Models.EPub", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("text"); + + b.Property("Author") + .HasColumnType("text"); + + b.Property("Chapters") + .HasColumnType("text"); + + b.Property("Cover") + .IsRequired() + .HasColumnType("text"); + + b.Property("CreatedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("CreatedBy") + .HasColumnType("text"); + + b.Property("DeletedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("DeletedBy") + .HasColumnType("text"); + + b.Property("Filename") + .HasColumnType("text"); + + b.Property("IsDeletedStatus") + .HasColumnType("integer"); + + b.Property("Language") + .HasColumnType("text"); + + b.Property("LastUpdatedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("LastUpdatedBy") + .HasColumnType("text"); + + b.Property("PublishStatus") + .HasColumnType("integer"); + + b.Property("Publisher") + .HasColumnType("text"); + + b.Property("SourceId") + .HasColumnType("text"); + + b.Property("SourceType") + .HasColumnType("integer"); + + b.Property("Title") + .HasColumnType("text"); + + b.Property("VideoId") + .HasColumnType("text"); + + b.Property("Visibility") + .HasColumnType("integer"); + + b.HasKey("Id"); + + b.HasIndex("VideoId"); + + b.ToTable("EPubs"); + }); + + modelBuilder.Entity("ClassTranscribeDatabase.Models.FileRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("text"); + + b.Property("CreatedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("CreatedBy") + .HasColumnType("text"); + + b.Property("DeletedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("DeletedBy") + .HasColumnType("text"); + + b.Property("FileName") + .HasColumnType("text"); + + b.Property("Hash") + .HasColumnType("text"); + + b.Property("IsDeletedStatus") + .HasColumnType("integer"); + + b.Property("LastUpdatedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("LastUpdatedBy") + .HasColumnType("text"); + + b.Property("PrivatePath") + .HasColumnType("text"); + + b.HasKey("Id"); + + b.ToTable("FileRecords"); + }); + + modelBuilder.Entity("ClassTranscribeDatabase.Models.Glossary", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("text"); + + b.Property("CourseId") + .HasColumnType("text"); + + b.Property("CreatedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("CreatedBy") + .HasColumnType("text"); + + b.Property("DeletedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("DeletedBy") + .HasColumnType("text"); + + b.Property("Description") + .HasColumnType("text"); + + b.Property("Domain") + .HasColumnType("text"); + + b.Property("Editable") + .HasColumnType("boolean"); + + b.Property("Explanation") + .HasColumnType("text"); + + b.Property("IsDeletedStatus") + .HasColumnType("integer"); + + b.Property("LastUpdatedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("LastUpdatedBy") + .HasColumnType("text"); + + b.Property("LicenseTag") + .HasColumnType("text"); + + b.Property("Likes") + .HasColumnType("integer"); + + b.Property("Link") + .HasColumnType("text"); + + b.Property("OfferingId") + .HasColumnType("text"); + + b.Property("Shared") + .HasColumnType("boolean"); + + b.Property("Source") + .HasColumnType("text"); + + b.Property("Term") + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("CourseId", "OfferingId"); + + b.ToTable("Glossaries"); + }); + + modelBuilder.Entity("ClassTranscribeDatabase.Models.Image", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("text"); + + b.Property("CreatedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("CreatedBy") + .HasColumnType("text"); + + b.Property("DeletedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("DeletedBy") + .HasColumnType("text"); + + b.Property("ImageFileId") + .HasColumnType("text"); + + b.Property("IsDeletedStatus") + .HasColumnType("integer"); + + b.Property("LastUpdatedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("LastUpdatedBy") + .HasColumnType("text"); + + b.Property("SourceId") + .HasColumnType("text"); + + b.Property("SourceType") + .HasColumnType("integer"); + + b.HasKey("Id"); + + b.HasIndex("ImageFileId"); + + b.ToTable("Images"); + }); + + modelBuilder.Entity("ClassTranscribeDatabase.Models.Log", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("text"); + + b.Property("CreatedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("CreatedBy") + .HasColumnType("text"); + + b.Property("DeletedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("DeletedBy") + .HasColumnType("text"); + + b.Property("EventType") + .HasColumnType("text"); + + b.Property("IsDeletedStatus") + .HasColumnType("integer"); + + b.Property("Json") + .IsRequired() + .HasColumnType("text"); + + b.Property("LastUpdatedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("LastUpdatedBy") + .HasColumnType("text"); + + b.Property("MediaId") + .HasColumnType("text"); + + b.Property("OfferingId") + .HasColumnType("text"); + + b.Property("UserId") + .HasColumnType("text"); + + b.HasKey("Id"); + + b.ToTable("Logs"); + }); + + modelBuilder.Entity("ClassTranscribeDatabase.Models.Media", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("text"); + + b.Property("CreatedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("CreatedBy") + .HasColumnType("text"); + + b.Property("DeletedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("DeletedBy") + .HasColumnType("text"); + + b.Property("Index") + .HasColumnType("integer"); + + b.Property("IsDeletedStatus") + .HasColumnType("integer"); + + b.Property("JsonMetadata") + .IsRequired() + .HasColumnType("text"); + + b.Property("LastUpdatedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("LastUpdatedBy") + .HasColumnType("text"); + + b.Property("Name") + .HasColumnType("text"); + + b.Property("Options") + .HasColumnType("text"); + + b.Property("PlaylistId") + .HasColumnType("text"); + + b.Property("PublishStatus") + .HasColumnType("integer"); + + b.Property("SourceType") + .HasColumnType("integer"); + + b.Property("UniqueMediaIdentifier") + .HasColumnType("text"); + + b.Property("VideoId") + .HasColumnType("text"); + + b.Property("Visibility") + .HasColumnType("integer"); + + b.HasKey("Id"); + + b.HasIndex("PlaylistId"); + + b.HasIndex("VideoId"); + + b.ToTable("Medias"); + }); + + modelBuilder.Entity("ClassTranscribeDatabase.Models.Message", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("text"); + + b.Property("Ack") + .HasColumnType("integer"); + + b.Property("ApplicationUserId") + .HasColumnType("text"); + + b.Property("CreatedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("CreatedBy") + .HasColumnType("text"); + + b.Property("DeletedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("DeletedBy") + .HasColumnType("text"); + + b.Property("IsDeletedStatus") + .HasColumnType("integer"); + + b.Property("LastUpdatedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("LastUpdatedBy") + .HasColumnType("text"); + + b.Property("LogLevel") + .HasColumnType("integer"); + + b.Property("Payload") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("ApplicationUserId"); + + b.ToTable("Messages"); + }); + + modelBuilder.Entity("ClassTranscribeDatabase.Models.Offering", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("text"); + + b.Property("AccessType") + .HasColumnType("integer"); + + b.Property("CourseName") + .HasColumnType("text"); + + b.Property("CreatedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("CreatedBy") + .HasColumnType("text"); + + b.Property("DeletedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("DeletedBy") + .HasColumnType("text"); + + b.Property("Description") + .HasColumnType("text"); + + b.Property("IsDeletedStatus") + .HasColumnType("integer"); + + b.Property("JsonMetadata") + .IsRequired() + .HasColumnType("text"); + + b.Property("LastUpdatedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("LastUpdatedBy") + .HasColumnType("text"); + + b.Property("LogEventsFlag") + .HasColumnType("boolean"); + + b.Property("PublishStatus") + .HasColumnType("integer"); + + b.Property("SectionName") + .HasColumnType("text"); + + b.Property("TermId") + .HasColumnType("text"); + + b.Property("Visibility") + .HasColumnType("integer"); + + b.HasKey("Id"); + + b.HasIndex("TermId"); + + b.ToTable("Offerings"); + }); + + modelBuilder.Entity("ClassTranscribeDatabase.Models.Playlist", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("text"); + + b.Property("CreatedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("CreatedBy") + .HasColumnType("text"); + + b.Property("DeletedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("DeletedBy") + .HasColumnType("text"); + + b.Property("Index") + .HasColumnType("integer"); + + b.Property("IsDeletedStatus") + .HasColumnType("integer"); + + b.Property("JsonMetadata") + .IsRequired() + .HasColumnType("text"); + + b.Property("LastUpdatedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("LastUpdatedBy") + .HasColumnType("text"); + + b.Property("ListCheckedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("ListUpdatedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("Name") + .HasColumnType("text"); + + b.Property("OfferingId") + .HasColumnType("text"); + + b.Property("Options") + .HasColumnType("text"); + + b.Property("PlaylistIdentifier") + .HasColumnType("text"); + + b.Property("PublishStatus") + .HasColumnType("integer"); + + b.Property("SourceType") + .HasColumnType("integer"); + + b.Property("Visibility") + .HasColumnType("integer"); + + b.HasKey("Id"); + + b.HasIndex("OfferingId"); + + b.ToTable("Playlists"); + }); + + modelBuilder.Entity("ClassTranscribeDatabase.Models.Subscription", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("text"); + + b.Property("ApplicationUserId") + .IsRequired() + .HasColumnType("text"); + + b.Property("CreatedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("CreatedBy") + .HasColumnType("text"); + + b.Property("DeletedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("DeletedBy") + .HasColumnType("text"); + + b.Property("IsDeletedStatus") + .HasColumnType("integer"); + + b.Property("LastUpdatedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("LastUpdatedBy") + .HasColumnType("text"); + + b.Property("ResourceId") + .IsRequired() + .HasColumnType("text"); + + b.Property("ResourceType") + .HasColumnType("integer"); + + b.HasKey("Id"); + + b.HasAlternateKey("ResourceType", "ResourceId", "ApplicationUserId"); + + b.HasIndex("ApplicationUserId"); + + b.ToTable("Subscriptions"); + }); + + modelBuilder.Entity("ClassTranscribeDatabase.Models.TaskItem", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("text"); + + b.Property("AncestorTaskItemId") + .HasColumnType("text"); + + b.Property("AttemptNumber") + .HasColumnType("integer"); + + b.Property("CreatedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("CreatedBy") + .HasColumnType("text"); + + b.Property("DebugMessage") + .HasColumnType("text"); + + b.Property("DeletedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("DeletedBy") + .HasColumnType("text"); + + b.Property("EndedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("EstimatedCompletionAt") + .HasColumnType("timestamp without time zone"); + + b.Property("IsDeletedStatus") + .HasColumnType("integer"); + + b.Property("LastUpdatedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("LastUpdatedBy") + .HasColumnType("text"); + + b.Property("MediaId") + .IsRequired() + .HasColumnType("text"); + + b.Property("OfferingId") + .IsRequired() + .HasColumnType("text"); + + b.Property("OpaqueMessageRef") + .IsRequired() + .HasColumnType("text"); + + b.Property("ParentTaskItemId") + .HasColumnType("text"); + + b.Property("PercentComplete") + .HasColumnType("integer"); + + b.Property("PlaylistId") + .IsRequired() + .HasColumnType("text"); + + b.Property("PreviousAttemptTaskItemId") + .HasColumnType("text"); + + b.Property("QueuedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("RemoteResultData") + .IsRequired() + .HasColumnType("text"); + + b.Property("ResultData") + .IsRequired() + .HasColumnType("text"); + + b.Property("Rule") + .IsRequired() + .HasColumnType("text"); + + b.Property("StartedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("TaskParameters") + .IsRequired() + .HasColumnType("text"); + + b.Property("TaskStatusCode") + .HasColumnType("integer"); + + b.Property("TaskType") + .HasColumnType("integer"); + + b.Property("UniqueId") + .IsRequired() + .HasColumnType("text"); + + b.Property("UserId") + .IsRequired() + .HasColumnType("text"); + + b.Property("VideoId") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasAlternateKey("MediaId"); + + b.HasAlternateKey("OfferingId"); + + b.HasAlternateKey("OpaqueMessageRef"); + + b.HasAlternateKey("PlaylistId"); + + b.HasAlternateKey("Rule"); + + b.HasAlternateKey("UserId"); + + b.HasAlternateKey("VideoId"); + + b.HasAlternateKey("UniqueId", "TaskType"); + + b.ToTable("TaskItems"); + }); + + modelBuilder.Entity("ClassTranscribeDatabase.Models.Term", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("text"); + + b.Property("CreatedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("CreatedBy") + .HasColumnType("text"); + + b.Property("DeletedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("DeletedBy") + .HasColumnType("text"); + + b.Property("EndDate") + .HasColumnType("timestamp without time zone"); + + b.Property("IsDeletedStatus") + .HasColumnType("integer"); + + b.Property("LastUpdatedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("LastUpdatedBy") + .HasColumnType("text"); + + b.Property("Name") + .HasColumnType("text"); + + b.Property("StartDate") + .HasColumnType("timestamp without time zone"); + + b.Property("UniversityId") + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("UniversityId"); + + b.ToTable("Terms"); + }); + + modelBuilder.Entity("ClassTranscribeDatabase.Models.TextData", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("text"); + + b.Property("CreatedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("CreatedBy") + .HasColumnType("text"); + + b.Property("DeletedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("DeletedBy") + .HasColumnType("text"); + + b.Property("IsDeletedStatus") + .HasColumnType("integer"); + + b.Property("LastUpdatedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("LastUpdatedBy") + .HasColumnType("text"); + + b.Property("Text") + .HasColumnType("text"); + + b.HasKey("Id"); + + b.ToTable("TextData"); + }); + + modelBuilder.Entity("ClassTranscribeDatabase.Models.Transcription", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("text"); + + b.Property("CreatedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("CreatedBy") + .HasColumnType("text"); + + b.Property("DeletedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("DeletedBy") + .HasColumnType("text"); + + b.Property("Description") + .HasColumnType("text"); + + b.Property("Editable") + .HasColumnType("integer"); + + b.Property("FileId") + .HasColumnType("text"); + + b.Property("IsDeletedStatus") + .HasColumnType("integer"); + + b.Property("Label") + .HasColumnType("text"); + + b.Property("Language") + .HasColumnType("text"); + + b.Property("LastUpdatedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("LastUpdatedBy") + .HasColumnType("text"); + + b.Property("PublishStatus") + .HasColumnType("integer"); + + b.Property("SourceInternalRef") + .HasColumnType("text"); + + b.Property("SourceLabel") + .HasColumnType("text"); + + b.Property("SrtFileId") + .HasColumnType("text"); + + b.Property("TranscriptionType") + .HasColumnType("integer"); + + b.Property("VideoId") + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("FileId"); + + b.HasIndex("SrtFileId"); + + b.HasIndex("VideoId"); + + b.ToTable("Transcriptions"); + }); + + modelBuilder.Entity("ClassTranscribeDatabase.Models.University", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("text"); + + b.Property("CreatedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("CreatedBy") + .HasColumnType("text"); + + b.Property("DeletedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("DeletedBy") + .HasColumnType("text"); + + b.Property("Domain") + .HasColumnType("text"); + + b.Property("IsDeletedStatus") + .HasColumnType("integer"); + + b.Property("LastUpdatedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("LastUpdatedBy") + .HasColumnType("text"); + + b.Property("Name") + .HasColumnType("text"); + + b.HasKey("Id"); + + b.ToTable("Universities"); + }); + + modelBuilder.Entity("ClassTranscribeDatabase.Models.UserOffering", b => + { + b.Property("ApplicationUserId") + .HasColumnType("text"); + + b.Property("OfferingId") + .HasColumnType("text"); + + b.Property("IdentityRoleId") + .HasColumnType("text"); + + b.Property("CreatedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("CreatedBy") + .HasColumnType("text"); + + b.Property("DeletedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("DeletedBy") + .HasColumnType("text"); + + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("text"); + + b.Property("IsDeletedStatus") + .HasColumnType("integer"); + + b.Property("LastUpdatedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("LastUpdatedBy") + .HasColumnType("text"); + + b.HasKey("ApplicationUserId", "OfferingId", "IdentityRoleId"); + + b.HasIndex("IdentityRoleId"); + + b.HasIndex("OfferingId"); + + b.ToTable("UserOfferings"); + }); + + modelBuilder.Entity("ClassTranscribeDatabase.Models.Video", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("text"); + + b.Property("ASLVideoId") + .HasColumnType("text"); + + b.Property("AudioId") + .HasColumnType("text"); + + b.Property("CreatedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("CreatedBy") + .HasColumnType("text"); + + b.Property("DeletedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("DeletedBy") + .HasColumnType("text"); + + b.Property("Description") + .HasColumnType("text"); + + b.Property("Duration") + .HasColumnType("interval"); + + b.Property("FileMediaInfo") + .IsRequired() + .HasColumnType("text"); + + b.Property("Glossary") + .IsRequired() + .HasColumnType("text"); + + b.Property("GlossaryDataId") + .HasColumnType("text"); + + b.Property("GlossaryTimestampId") + .HasColumnType("text"); + + b.Property("IsDeletedStatus") + .HasColumnType("integer"); + + b.Property("JsonMetadata") + .IsRequired() + .HasColumnType("text"); + + b.Property("LastUpdatedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("LastUpdatedBy") + .HasColumnType("text"); + + b.Property("PhraseHints") + .HasColumnType("text"); + + b.Property("PhraseHintsDataId") + .HasColumnType("text"); + + b.Property("ProcessedASLVideoId") + .HasColumnType("text"); + + b.Property("ProcessedVideo1Id") + .HasColumnType("text"); + + b.Property("ProcessedVideo2Id") + .HasColumnType("text"); + + b.Property("SceneData") + .IsRequired() + .HasColumnType("text"); + + b.Property("SceneObjectDataId") + .HasColumnType("text"); + + b.Property("TaskLog") + .HasColumnType("text"); + + b.Property("TranscribingAttempts") + .HasColumnType("integer"); + + b.Property("TranscriptionStatus") + .HasColumnType("text"); + + b.Property("Video1Id") + .HasColumnType("text"); + + b.Property("Video2Id") + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("ASLVideoId"); + + b.HasIndex("AudioId"); + + b.HasIndex("ProcessedASLVideoId"); + + b.HasIndex("ProcessedVideo1Id"); + + b.HasIndex("ProcessedVideo2Id"); + + b.HasIndex("Video1Id"); + + b.HasIndex("Video2Id"); + + b.ToTable("Videos"); + }); + + modelBuilder.Entity("ClassTranscribeDatabase.Models.WatchHistory", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("text"); + + b.Property("ApplicationUserId") + .HasColumnType("text"); + + b.Property("CreatedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("CreatedBy") + .HasColumnType("text"); + + b.Property("DeletedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("DeletedBy") + .HasColumnType("text"); + + b.Property("IsDeletedStatus") + .HasColumnType("integer"); + + b.Property("Json") + .IsRequired() + .HasColumnType("text"); + + b.Property("LastUpdatedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("LastUpdatedBy") + .HasColumnType("text"); + + b.Property("MediaId") + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("ApplicationUserId"); + + b.HasIndex("MediaId"); + + b.ToTable("WatchHistories"); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b => + { + b.Property("Id") + .HasColumnType("text"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnType("text"); + + b.Property("Name") + .HasColumnType("character varying(256)") + .HasMaxLength(256); + + b.Property("NormalizedName") + .HasColumnType("character varying(256)") + .HasMaxLength(256); + + b.HasKey("Id"); + + b.HasIndex("NormalizedName") + .IsUnique() + .HasName("RoleNameIndex"); + + b.ToTable("AspNetRoles"); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn); + + b.Property("ClaimType") + .HasColumnType("text"); + + b.Property("ClaimValue") + .HasColumnType("text"); + + b.Property("RoleId") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("RoleId"); + + b.ToTable("AspNetRoleClaims"); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn); + + b.Property("ClaimType") + .HasColumnType("text"); + + b.Property("ClaimValue") + .HasColumnType("text"); + + b.Property("UserId") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("AspNetUserClaims"); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => + { + b.Property("LoginProvider") + .HasColumnType("text"); + + b.Property("ProviderKey") + .HasColumnType("text"); + + b.Property("ProviderDisplayName") + .HasColumnType("text"); + + b.Property("UserId") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("LoginProvider", "ProviderKey"); + + b.HasIndex("UserId"); + + b.ToTable("AspNetUserLogins"); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => + { + b.Property("UserId") + .HasColumnType("text"); + + b.Property("RoleId") + .HasColumnType("text"); + + b.HasKey("UserId", "RoleId"); + + b.HasIndex("RoleId"); + + b.ToTable("AspNetUserRoles"); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => + { + b.Property("UserId") + .HasColumnType("text"); + + b.Property("LoginProvider") + .HasColumnType("text"); + + b.Property("Name") + .HasColumnType("text"); + + b.Property("Value") + .HasColumnType("text"); + + b.HasKey("UserId", "LoginProvider", "Name"); + + b.ToTable("AspNetUserTokens"); + }); + + modelBuilder.Entity("ClassTranscribeDatabase.Models.ApplicationUser", b => + { + b.HasOne("ClassTranscribeDatabase.Models.University", "University") + .WithMany() + .HasForeignKey("UniversityId"); + }); + + modelBuilder.Entity("ClassTranscribeDatabase.Models.Caption", b => + { + b.HasOne("ClassTranscribeDatabase.Models.Transcription", "Transcription") + .WithMany("Captions") + .HasForeignKey("TranscriptionId"); + }); + + modelBuilder.Entity("ClassTranscribeDatabase.Models.Course", b => + { + b.HasOne("ClassTranscribeDatabase.Models.Department", "Department") + .WithMany("Courses") + .HasForeignKey("DepartmentId"); + }); + + modelBuilder.Entity("ClassTranscribeDatabase.Models.CourseOffering", b => + { + b.HasOne("ClassTranscribeDatabase.Models.Course", "Course") + .WithMany("CourseOfferings") + .HasForeignKey("CourseId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("ClassTranscribeDatabase.Models.Offering", "Offering") + .WithMany("CourseOfferings") + .HasForeignKey("OfferingId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("ClassTranscribeDatabase.Models.Department", b => + { + b.HasOne("ClassTranscribeDatabase.Models.University", "University") + .WithMany("Departments") + .HasForeignKey("UniversityId"); + }); + + modelBuilder.Entity("ClassTranscribeDatabase.Models.EPub", b => + { + b.HasOne("ClassTranscribeDatabase.Models.Video", null) + .WithMany("EPubs") + .HasForeignKey("VideoId"); + }); + + modelBuilder.Entity("ClassTranscribeDatabase.Models.Glossary", b => + { + b.HasOne("ClassTranscribeDatabase.Models.CourseOffering", "CourseOffering") + .WithMany("Glossaries") + .HasForeignKey("CourseId", "OfferingId"); + }); + + modelBuilder.Entity("ClassTranscribeDatabase.Models.Image", b => + { + b.HasOne("ClassTranscribeDatabase.Models.FileRecord", "ImageFile") + .WithMany() + .HasForeignKey("ImageFileId"); + }); + + modelBuilder.Entity("ClassTranscribeDatabase.Models.Media", b => + { + b.HasOne("ClassTranscribeDatabase.Models.Playlist", "Playlist") + .WithMany("Medias") + .HasForeignKey("PlaylistId"); + + b.HasOne("ClassTranscribeDatabase.Models.Video", "Video") + .WithMany("Medias") + .HasForeignKey("VideoId"); + }); + + modelBuilder.Entity("ClassTranscribeDatabase.Models.Message", b => + { + b.HasOne("ClassTranscribeDatabase.Models.ApplicationUser", "ApplicationUser") + .WithMany() + .HasForeignKey("ApplicationUserId"); + }); + + modelBuilder.Entity("ClassTranscribeDatabase.Models.Offering", b => + { + b.HasOne("ClassTranscribeDatabase.Models.Term", "Term") + .WithMany("Offerings") + .HasForeignKey("TermId"); + }); + + modelBuilder.Entity("ClassTranscribeDatabase.Models.Playlist", b => + { + b.HasOne("ClassTranscribeDatabase.Models.Offering", "Offering") + .WithMany("Playlists") + .HasForeignKey("OfferingId"); + }); + + modelBuilder.Entity("ClassTranscribeDatabase.Models.Subscription", b => + { + b.HasOne("ClassTranscribeDatabase.Models.ApplicationUser", "ApplicationUser") + .WithMany() + .HasForeignKey("ApplicationUserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("ClassTranscribeDatabase.Models.Term", b => + { + b.HasOne("ClassTranscribeDatabase.Models.University", "University") + .WithMany("Terms") + .HasForeignKey("UniversityId"); + }); + + modelBuilder.Entity("ClassTranscribeDatabase.Models.Transcription", b => + { + b.HasOne("ClassTranscribeDatabase.Models.FileRecord", "File") + .WithMany() + .HasForeignKey("FileId"); + + b.HasOne("ClassTranscribeDatabase.Models.FileRecord", "SrtFile") + .WithMany() + .HasForeignKey("SrtFileId"); + + b.HasOne("ClassTranscribeDatabase.Models.Video", "Video") + .WithMany("Transcriptions") + .HasForeignKey("VideoId"); + }); + + modelBuilder.Entity("ClassTranscribeDatabase.Models.UserOffering", b => + { + b.HasOne("ClassTranscribeDatabase.Models.ApplicationUser", "ApplicationUser") + .WithMany("UserOfferings") + .HasForeignKey("ApplicationUserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", "IdentityRole") + .WithMany() + .HasForeignKey("IdentityRoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("ClassTranscribeDatabase.Models.Offering", "Offering") + .WithMany("OfferingUsers") + .HasForeignKey("OfferingId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("ClassTranscribeDatabase.Models.Video", b => + { + b.HasOne("ClassTranscribeDatabase.Models.FileRecord", "ASLVideo") + .WithMany() + .HasForeignKey("ASLVideoId"); + + b.HasOne("ClassTranscribeDatabase.Models.FileRecord", "Audio") + .WithMany() + .HasForeignKey("AudioId"); + + b.HasOne("ClassTranscribeDatabase.Models.FileRecord", "ProcessedASLVideo") + .WithMany() + .HasForeignKey("ProcessedASLVideoId"); + + b.HasOne("ClassTranscribeDatabase.Models.FileRecord", "ProcessedVideo1") + .WithMany() + .HasForeignKey("ProcessedVideo1Id"); + + b.HasOne("ClassTranscribeDatabase.Models.FileRecord", "ProcessedVideo2") + .WithMany() + .HasForeignKey("ProcessedVideo2Id"); + + b.HasOne("ClassTranscribeDatabase.Models.FileRecord", "Video1") + .WithMany() + .HasForeignKey("Video1Id"); + + b.HasOne("ClassTranscribeDatabase.Models.FileRecord", "Video2") + .WithMany() + .HasForeignKey("Video2Id"); + }); + + modelBuilder.Entity("ClassTranscribeDatabase.Models.WatchHistory", b => + { + b.HasOne("ClassTranscribeDatabase.Models.ApplicationUser", "ApplicationUser") + .WithMany() + .HasForeignKey("ApplicationUserId"); + + b.HasOne("ClassTranscribeDatabase.Models.Media", "Media") + .WithMany("WatchHistories") + .HasForeignKey("MediaId"); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => + { + b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null) + .WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => + { + b.HasOne("ClassTranscribeDatabase.Models.ApplicationUser", null) + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => + { + b.HasOne("ClassTranscribeDatabase.Models.ApplicationUser", null) + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => + { + b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null) + .WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("ClassTranscribeDatabase.Models.ApplicationUser", null) + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => + { + b.HasOne("ClassTranscribeDatabase.Models.ApplicationUser", null) + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/ClassTranscribeDatabase/Migrations/20231211224116_PlaylistMediaOptions.cs b/ClassTranscribeDatabase/Migrations/20231211224116_PlaylistMediaOptions.cs new file mode 100644 index 00000000..c8b33ab3 --- /dev/null +++ b/ClassTranscribeDatabase/Migrations/20231211224116_PlaylistMediaOptions.cs @@ -0,0 +1,31 @@ +using Microsoft.EntityFrameworkCore.Migrations; + +namespace ClassTranscribeDatabase.Migrations +{ + public partial class PlaylistMediaOptions : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.AddColumn( + name: "Options", + table: "Playlists", + nullable: true); + + migrationBuilder.AddColumn( + name: "Options", + table: "Medias", + nullable: true); + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropColumn( + name: "Options", + table: "Playlists"); + + migrationBuilder.DropColumn( + name: "Options", + table: "Medias"); + } + } +} diff --git a/ClassTranscribeDatabase/Migrations/CTDbContextModelSnapshot.cs b/ClassTranscribeDatabase/Migrations/CTDbContextModelSnapshot.cs index c54539bc..0b59db43 100644 --- a/ClassTranscribeDatabase/Migrations/CTDbContextModelSnapshot.cs +++ b/ClassTranscribeDatabase/Migrations/CTDbContextModelSnapshot.cs @@ -739,6 +739,9 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.Property("Name") .HasColumnType("text"); + b.Property("Options") + .HasColumnType("text"); + b.Property("PlaylistId") .HasColumnType("text"); @@ -921,6 +924,9 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.Property("OfferingId") .HasColumnType("text"); + b.Property("Options") + .HasColumnType("text"); + b.Property("PlaylistIdentifier") .HasColumnType("text"); diff --git a/ClassTranscribeDatabase/Models/Models.cs b/ClassTranscribeDatabase/Models/Models.cs index bd63504b..2412d50b 100644 --- a/ClassTranscribeDatabase/Models/Models.cs +++ b/ClassTranscribeDatabase/Models/Models.cs @@ -6,6 +6,7 @@ using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; using System.Runtime.Serialization; +using System.Text.Json; using System.Threading.Tasks; namespace ClassTranscribeDatabase.Models @@ -239,7 +240,16 @@ public class Playlist : Entity [IgnoreDataMember] public virtual Offering Offering { get; set; } [Required] - public JObject JsonMetadata { get; set; } = new JObject(); + public JObject JsonMetadata { get; set; } = new JObject(); // for serverside use + public string Options { get; set; } = ""; + + public virtual JObject getOptionsAsJson() { + return String.IsNullOrEmpty(this.Options) ? new JObject() : JObject.Parse(this.Options); + } + + public virtual void setOptionsAsJson(JObject json) { + this.Options = json.ToString(); + } public int Index { get; set; } public Visibility Visibility { get; set; } public PublishStatus PublishStatus { get; set; } @@ -268,8 +278,19 @@ public class Media : Entity public virtual List WatchHistories { get; set; } public Visibility Visibility { get; set; } public PublishStatus PublishStatus { get; set; } + + public string Options { get; set; } = ""; + + public virtual JObject getOptionsAsJson() { + return String.IsNullOrEmpty(this.Options) ? new JObject() : JObject.Parse(this.Options); + } + + public virtual void setOptionsAsJson(JObject json) { + this.Options = json.ToString(Newtonsoft.Json.Formatting.None); + } } + public class Transcription : Entity { [ForeignKey("File")] diff --git a/ClassTranscribeServer/Controllers/PlaylistsController.cs b/ClassTranscribeServer/Controllers/PlaylistsController.cs index 4c19629d..ae64c2d8 100644 --- a/ClassTranscribeServer/Controllers/PlaylistsController.cs +++ b/ClassTranscribeServer/Controllers/PlaylistsController.cs @@ -4,6 +4,7 @@ using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion.Internal; using Microsoft.Extensions.Logging; using Newtonsoft.Json.Linq; using System; @@ -69,7 +70,8 @@ public async Task> GetPlaylistsByVideoId(string videoI PlaylistIdentifier = p.PlaylistIdentifier, PublishStatus = p.PublishStatus, ListCheckedAt = p.ListCheckedAt, - ListUpdatedAt = p.ListUpdatedAt + ListUpdatedAt = p.ListUpdatedAt, + Options = p.getOptionsAsJson() }).ToList().FirstOrDefault(); return playlist; } @@ -106,7 +108,8 @@ public async Task>> GetPlaylists(string of PlaylistIdentifier = p.PlaylistIdentifier, PublishStatus = p.PublishStatus, ListCheckedAt = p.ListCheckedAt, - ListUpdatedAt = p.ListUpdatedAt + ListUpdatedAt = p.ListUpdatedAt, + Options = p.getOptionsAsJson() }).ToList(); return playlists; } @@ -144,6 +147,7 @@ public async Task>> GetPlaylists2(string o PublishStatus = p.PublishStatus, ListCheckedAt = p.ListCheckedAt, ListUpdatedAt = p.ListUpdatedAt, + Options = p.getOptionsAsJson(), Medias = p.Medias.Where(m => m.Video != null).Select(m => new MediaDTO { Id = m.Id, @@ -156,12 +160,13 @@ public async Task>> GetPlaylists2(string o SourceType = m.SourceType, Duration = m.Video?.Duration, PublishStatus = m.PublishStatus, + Options = m.getOptionsAsJson(), Video = new VideoDTO { Id = m.Video.Id, Video1Path = m.Video.ProcessedVideo1?.Path != null ? m.Video.ProcessedVideo1.Path : m.Video.Video1?.Path, Video2Path = m.Video.ProcessedVideo2?.Path != null ? m.Video.ProcessedVideo2.Path : m.Video.Video2?.Path, - ASLPath = m.Video.ASLVideo?.Path, + ASLPath = m.Video.ProcessedASLVideo?.Path != null ? m.Video.ProcessedASLVideo.Path : m.Video.ASLVideo?.Path, TaskLog = m.Video.TaskLog }, Transcriptions = m.Video.Transcriptions.Select(t => new TranscriptionDTO @@ -227,6 +232,14 @@ public async Task> GetPlaylist(string id) // user is null for unit tests var partialWatchHistories = user !=null ? await _context.WatchHistories.Where(w => w.ApplicationUserId == user.Id && mediaIds.Contains(w.MediaId)).ToListAsync() : null; // In memory transformation into DTO resut + + var ignore = new MediaDTO() + { + + }; + + + List mediasDTO = mediaList.Select(m => new MediaDTO { Id = m.Id, @@ -238,13 +251,16 @@ public async Task> GetPlaylist(string id) SourceType = m.SourceType, Duration = m.Video?.Duration, PublishStatus = m.PublishStatus, + Options = m.getOptionsAsJson(), SceneDetectReady = m.Video != null && m.Video.HasSceneObjectData(), Ready = m.Video == null ? false : "NoError" == m.Video.TranscriptionStatus , Video = m.Video == null ? null : new VideoDTO { Id = m.Video.Id, Video1Path = m.Video.Video1?.Path, - Video2Path = m.Video.Video2?.Path + Video2Path = m.Video.Video2?.Path, + ASLPath = m.Video.ProcessedASLVideo?.Path != null ? m.Video.ProcessedASLVideo.Path : m.Video.ASLVideo?.Path, + TaskLog = m.Video.TaskLog }, Transcriptions = m.Video == null ? null : m.Video.Transcriptions.Select(t => new TranscriptionDTO { @@ -268,10 +284,55 @@ public async Task> GetPlaylist(string id) PlaylistIdentifier = p.PlaylistIdentifier, PublishStatus = p.PublishStatus, ListUpdatedAt = p.ListUpdatedAt, - ListCheckedAt = p.ListCheckedAt + ListCheckedAt = p.ListCheckedAt, + Options = p.getOptionsAsJson() }; } + // PUT: api/Playlists/Option + [HttpPut("Option/{id}")] + [Authorize] + public async Task PutPlaylistOptions(string id, JObject options) + { + if ( id == null || options == null ) + { + return BadRequest(); + } + var p = await _context.Playlists.FindAsync(id); + var offering = await _context.Offerings.FindAsync(p.OfferingId); + + var authorizationResult = await _authorizationService.AuthorizeAsync(this.User, offering, Globals.POLICY_UPDATE_OFFERING); + if (!authorizationResult.Succeeded) + { + if (User.Identity.IsAuthenticated) + { + return new ForbidResult(); + } + + return new ChallengeResult(); + } + + p.setOptionsAsJson(options); + + try + { + await _context.SaveChangesAsync(); + _wakeDownloader.UpdatePlaylist(p.Id); + } + catch (DbUpdateConcurrencyException) + { + if (!PlaylistExists(id)) + { + return NotFound(); + } + else + { + throw; + } + } + + return NoContent(); + } // PUT: api/Playlists/5 [HttpPut("{id}")] @@ -298,7 +359,10 @@ public async Task PutPlaylist(string id, Playlist playlist) return new ChallengeResult(); } var p = await _context.Playlists.FindAsync(playlist.Id); + p.Name = playlist.Name; + p.Options = playlist.Options; + p.PublishStatus = playlist.PublishStatus; try { @@ -476,6 +540,7 @@ public class PlaylistDTO public string PlaylistIdentifier { get; set; } public List Medias { get; set; } public JObject JsonMetadata { get; set; } + public JObject Options { get; set; } public PublishStatus PublishStatus { get; set; } #nullable enable public DateTime? ListUpdatedAt {get; set; } @@ -502,6 +567,7 @@ public class MediaDTO public TimeSpan? Duration { get; set; } public WatchHistory WatchHistory { get; set; } + public JObject Options { get; set; } } public class MediaSearchDTO diff --git a/UnitTests/ClassTranscribeServer/ControllerTests/PlaylistsControllerTest.cs b/UnitTests/ClassTranscribeServer/ControllerTests/PlaylistsControllerTest.cs index 72b57456..d85b8b16 100644 --- a/UnitTests/ClassTranscribeServer/ControllerTests/PlaylistsControllerTest.cs +++ b/UnitTests/ClassTranscribeServer/ControllerTests/PlaylistsControllerTest.cs @@ -99,6 +99,7 @@ public async Task Get_Playlists2_Success() Name = "foo", Index = 0, PublishStatus = PublishStatus.Published, + Options = "{\"a\":\"b\"}", Medias = new List() { new Media() @@ -106,6 +107,7 @@ public async Task Get_Playlists2_Success() Id = "media_foo", SourceType = SourceType.Local, PublishStatus = PublishStatus.NotPublished, + Options = "{\"c\":\"d\"}", Video = new Video() { Transcriptions = new List(), @@ -120,6 +122,7 @@ public async Task Get_Playlists2_Success() SourceType = SourceType.Local, Name = "bar", PublishStatus = PublishStatus.NotPublished, + Options="{}" }, new Playlist { @@ -155,6 +158,7 @@ public async Task Get_Playlists2_Success() Assert.Equal(playlists[0].Id, result.Value.ElementAt(0).Id); Assert.Equal(playlists[0].SourceType, result.Value.ElementAt(0).SourceType); Assert.Equal(playlists[0].Name, result.Value.ElementAt(0).Name); + Assert.Equal(playlists[0].Options, result.Value.ElementAt(0).Options.ToString(Newtonsoft.Json.Formatting.None)); Assert.Equal(playlists[0].Index, result.Value.ElementAt(0).Index); Assert.Equal(playlists[0].PublishStatus, result.Value.ElementAt(0).PublishStatus); Assert.Equal(playlists[0].Medias[0].Id, result.Value.ElementAt(0).Medias[0].Id); @@ -212,14 +216,18 @@ public async Task Get_Playlist_Success() { new Media { Id = "media_foo", + Name="fooy", + UniqueMediaIdentifier="123", SourceType = SourceType.Local, PublishStatus = PublishStatus.NotPublished, + Options = "{}", Video = new Video { Duration = TimeSpan.FromSeconds(13), Transcriptions = new List(), }, } - } + }, + Options = "{}" }; var watch = new WatchHistory { @@ -262,7 +270,8 @@ public async Task Put_Playlist_Success() OfferingId = offeringId, SourceType = SourceType.Local, Name = "foo", - Index = 0 + Index = 0, + Options = "{}" }; _context.Offerings.Add(new Offering { Id = offeringId }); diff --git a/UnitTests/Utils/Common.cs b/UnitTests/Utils/Common.cs index b6fac36a..df515bf4 100644 --- a/UnitTests/Utils/Common.cs +++ b/UnitTests/Utils/Common.cs @@ -1,4 +1,4 @@ -using ClassTranscribeDatabase; +using ClassTranscribeDatabase; using ClassTranscribeDatabase.Models; using System.IO; using System.Linq;