From 1caed9209aa5a0bdb22c451698b2396d011a48ba Mon Sep 17 00:00:00 2001 From: Hamid Reza Mohammadi Date: Mon, 16 Nov 2020 17:13:55 +0330 Subject: [PATCH] Renaming Narration entity name to Recitation --- ...nController.cs => RecitationController.cs} | 34 +- RMuseum/DbContext/RMuseumDbContext.cs | 13 +- ...20201106070554_AudioNarrations.Designer.cs | 1560 ---------------- ...9_PoemNarrationUploadDateIndex.Designer.cs | 1562 ----------------- ...1106113129_PoemNarrationUploadDateIndex.cs | 22 - ...01113112838_NarrationPublishingTrackers.cs | 48 - ...=> 20201116132909_Recitations.Designer.cs} | 116 +- ...tions.cs => 20201116132909_Recitations.cs} | 116 +- .../RMuseumDbContextModelSnapshot.cs | 112 +- .../{PoemNarration.cs => Recitation.cs} | 2 +- ...cker.cs => RecitationPublishingTracker.cs} | 4 +- ...ionProfile.cs => UserRecitationProfile.cs} | 2 +- ...odel.cs => RecitationModerateViewModel.cs} | 2 +- ...ionVerseSync.cs => RecitationVerseSync.cs} | 2 +- ...ionViewModel.cs => RecitationViewModel.cs} | 6 +- ...l.cs => UserRecitationProfileViewModel.cs} | 6 +- RMuseum/RMuseum.xml | 1282 +++++++------- ...rationService.cs => IRecitationService.cs} | 20 +- ...rrationService.cs => RecitationService.cs} | 204 +-- RMuseum/Startup.cs | 2 +- 20 files changed, 975 insertions(+), 4140 deletions(-) rename RMuseum/Controllers/{AudioNarrationController.cs => RecitationController.cs} (95%) delete mode 100644 RMuseum/Migrations/20201106070554_AudioNarrations.Designer.cs delete mode 100644 RMuseum/Migrations/20201106113129_PoemNarrationUploadDateIndex.Designer.cs delete mode 100644 RMuseum/Migrations/20201106113129_PoemNarrationUploadDateIndex.cs delete mode 100644 RMuseum/Migrations/20201113112838_NarrationPublishingTrackers.cs rename RMuseum/Migrations/{20201113112838_NarrationPublishingTrackers.Designer.cs => 20201116132909_Recitations.Designer.cs} (98%) rename RMuseum/Migrations/{20201106070554_AudioNarrations.cs => 20201116132909_Recitations.cs} (82%) rename RMuseum/Models/GanjoorAudio/{PoemNarration.cs => Recitation.cs} (99%) rename RMuseum/Models/GanjoorAudio/{NarrationPublishingTracker.cs => RecitationPublishingTracker.cs} (93%) rename RMuseum/Models/GanjoorAudio/{UserNarrationProfile.cs => UserRecitationProfile.cs} (97%) rename RMuseum/Models/GanjoorAudio/ViewModels/{PoemNarrationModerateViewModel.cs => RecitationModerateViewModel.cs} (94%) rename RMuseum/Models/GanjoorAudio/ViewModels/{NarrationVerseSync.cs => RecitationVerseSync.cs} (93%) rename RMuseum/Models/GanjoorAudio/ViewModels/{PoemNarrationViewModel.cs => RecitationViewModel.cs} (97%) rename RMuseum/Models/GanjoorAudio/ViewModels/{UserNarrationProfileViewModel.cs => UserRecitationProfileViewModel.cs} (93%) rename RMuseum/Services/{IAudioNarrationService.cs => IRecitationService.cs} (81%) rename RMuseum/Services/Implementation/{AudioNarrationService.cs => RecitationService.cs} (84%) diff --git a/RMuseum/Controllers/AudioNarrationController.cs b/RMuseum/Controllers/RecitationController.cs similarity index 95% rename from RMuseum/Controllers/AudioNarrationController.cs rename to RMuseum/Controllers/RecitationController.cs index e9eaec2b..3b52956b 100644 --- a/RMuseum/Controllers/AudioNarrationController.cs +++ b/RMuseum/Controllers/RecitationController.cs @@ -21,7 +21,7 @@ namespace RMuseum.Controllers { [Produces("application/json")] [Route("api/audio")] - public class AudioNarrationController : Controller + public class RecitationController : Controller { /// @@ -33,7 +33,7 @@ namespace RMuseum.Controllers /// [HttpGet] [Authorize] - [ProducesResponseType((int)HttpStatusCode.OK, Type = typeof(IEnumerable))] + [ProducesResponseType((int)HttpStatusCode.OK, Type = typeof(IEnumerable))] [ProducesResponseType((int)HttpStatusCode.BadRequest, Type = typeof(string))] [ProducesResponseType((int)HttpStatusCode.Forbidden, Type = typeof(string))] @@ -87,7 +87,7 @@ namespace RMuseum.Controllers [ProducesResponseType((int)HttpStatusCode.BadRequest, Type = typeof(string))] public async Task GetMp3File(int id) { - RServiceResult narration = + RServiceResult narration = await _audioService.Get(id); if (!string.IsNullOrEmpty(narration.ExceptionString)) @@ -123,7 +123,7 @@ namespace RMuseum.Controllers [ProducesResponseType((int)HttpStatusCode.BadRequest, Type = typeof(string))] public async Task GetXMLFile(int id) { - RServiceResult narration = + RServiceResult narration = await _audioService.Get(id); if (!string.IsNullOrEmpty(narration.ExceptionString)) @@ -155,7 +155,7 @@ namespace RMuseum.Controllers [ProducesResponseType((int)HttpStatusCode.BadRequest, Type = typeof(string))] public async Task GetPoemNarrationVerseSyncArray(int id) { - RServiceResult verses = + RServiceResult verses = await _audioService.GetPoemNarrationVerseSyncArray(id); if (!string.IsNullOrEmpty(verses.ExceptionString)) return BadRequest(verses.ExceptionString); @@ -176,10 +176,10 @@ namespace RMuseum.Controllers [HttpPut("{id}")] [Authorize] - [ProducesResponseType((int)HttpStatusCode.OK, Type = typeof(PoemNarrationViewModel))] + [ProducesResponseType((int)HttpStatusCode.OK, Type = typeof(RecitationViewModel))] [ProducesResponseType((int)HttpStatusCode.BadRequest, Type = typeof(string))] [ProducesResponseType((int)HttpStatusCode.Forbidden, Type = typeof(string))] - public async Task UpdatePoemNarration(int id, [FromBody] PoemNarrationViewModel metadata) + public async Task UpdatePoemNarration(int id, [FromBody] RecitationViewModel metadata) { @@ -237,10 +237,10 @@ namespace RMuseum.Controllers /// [HttpPut("moderate/{id}")] [Authorize(Policy = RMuseumSecurableItem.AudioNarrationEntityShortName + ":" + RMuseumSecurableItem.ModerateOperationShortName)] - [ProducesResponseType((int)HttpStatusCode.OK, Type = typeof(PoemNarrationViewModel))] + [ProducesResponseType((int)HttpStatusCode.OK, Type = typeof(RecitationViewModel))] [ProducesResponseType((int)HttpStatusCode.BadRequest, Type = typeof(string))] [ProducesResponseType((int)HttpStatusCode.Forbidden, Type = typeof(string))] - public async Task ModeratePoemNarration(int id, [FromBody] PoemNarrationModerateViewModel model) + public async Task ModeratePoemNarration(int id, [FromBody] RecitationModerateViewModel model) { Guid loggedOnUserId = new Guid(User.Claims.FirstOrDefault(c => c.Type == "UserId").Value); @@ -392,7 +392,7 @@ namespace RMuseum.Controllers /// [HttpGet("profile")] [Authorize] - [ProducesResponseType((int)HttpStatusCode.OK, Type = typeof(IEnumerable))] + [ProducesResponseType((int)HttpStatusCode.OK, Type = typeof(IEnumerable))] [ProducesResponseType((int)HttpStatusCode.BadRequest, Type = typeof(string))] [ProducesResponseType((int)HttpStatusCode.Forbidden, Type = typeof(string))] @@ -414,11 +414,11 @@ namespace RMuseum.Controllers /// [HttpPost("profile")] [Authorize] - [ProducesResponseType((int)HttpStatusCode.OK, Type = typeof(UserNarrationProfileViewModel))] + [ProducesResponseType((int)HttpStatusCode.OK, Type = typeof(UserRecitationProfileViewModel))] [ProducesResponseType((int)HttpStatusCode.BadRequest, Type = typeof(string))] [ProducesResponseType((int)HttpStatusCode.Forbidden, Type = typeof(string))] - public async Task AddUserNarrationProfiles([FromBody]UserNarrationProfileViewModel profile) + public async Task AddUserNarrationProfiles([FromBody]UserRecitationProfileViewModel profile) { Guid loggedOnUserId = new Guid(User.Claims.FirstOrDefault(c => c.Type == "UserId").Value); @@ -440,11 +440,11 @@ namespace RMuseum.Controllers /// [HttpPut("profile")] [Authorize] - [ProducesResponseType((int)HttpStatusCode.OK, Type = typeof(UserNarrationProfileViewModel))] + [ProducesResponseType((int)HttpStatusCode.OK, Type = typeof(UserRecitationProfileViewModel))] [ProducesResponseType((int)HttpStatusCode.BadRequest, Type = typeof(string))] [ProducesResponseType((int)HttpStatusCode.Forbidden, Type = typeof(string))] - public async Task UpdateUserNarrationProfiles([FromBody] UserNarrationProfileViewModel profile) + public async Task UpdateUserNarrationProfiles([FromBody] UserRecitationProfileViewModel profile) { Guid loggedOnUserId = new Guid(User.Claims.FirstOrDefault(c => c.Type == "UserId").Value); @@ -490,7 +490,7 @@ namespace RMuseum.Controllers [HttpGet("publishqueue")] [Authorize(Policy = RMuseumSecurableItem.AudioNarrationEntityShortName + ":" + RMuseumSecurableItem.ImportOperationShortName)] - [ProducesResponseType((int)HttpStatusCode.OK, Type = typeof(IEnumerable))] + [ProducesResponseType((int)HttpStatusCode.OK, Type = typeof(IEnumerable))] [ProducesResponseType((int)HttpStatusCode.BadRequest, Type = typeof(string))] [ProducesResponseType((int)HttpStatusCode.Forbidden, Type = typeof(string))] public async Task GetPublishingQueueStatus([FromQuery] PagingParameterModel paging, bool inProgress = true, bool finished = true) @@ -509,7 +509,7 @@ namespace RMuseum.Controllers /// /// /// - public AudioNarrationController(IAudioNarrationService audioService, IUserPermissionChecker userPermissionChecker) + public RecitationController(IRecitationService audioService, IUserPermissionChecker userPermissionChecker) { _audioService = audioService; _userPermissionChecker = userPermissionChecker; @@ -518,7 +518,7 @@ namespace RMuseum.Controllers /// /// Artifact Service /// - protected readonly IAudioNarrationService _audioService; + protected readonly IRecitationService _audioService; /// /// IUserPermissionChecker instance diff --git a/RMuseum/DbContext/RMuseumDbContext.cs b/RMuseum/DbContext/RMuseumDbContext.cs index 2b840b8d..149c249e 100644 --- a/RMuseum/DbContext/RMuseumDbContext.cs +++ b/RMuseum/DbContext/RMuseumDbContext.cs @@ -71,12 +71,9 @@ namespace RMuseum.DbContext builder.Entity() .HasIndex(t => t.FriendlyUrl); - builder.Entity() + builder.Entity() .HasIndex(p => p.GanjoorPostId); - builder.Entity() - .HasIndex(p => p.UploadDate); - builder.Entity() .HasIndex(c => c.FullUrl); @@ -145,7 +142,7 @@ namespace RMuseum.DbContext /// /// Ganjoor Audio Files /// - public DbSet AudioFiles { get; set; } + public DbSet Recitations { get; set; } /// /// Upload Sessions @@ -158,9 +155,9 @@ namespace RMuseum.DbContext public DbSet UploadedFiles { get; set; } /// - /// User Narration Profiles + /// User Recitation Profiles /// - public DbSet UserNarrationProfiles { get; set; } + public DbSet UserRecitationProfiles { get; set; } /// /// Ganjoor Poets @@ -185,7 +182,7 @@ namespace RMuseum.DbContext /// /// Narration Publishing Tracker /// - public DbSet NarrationPublishingTrackers { get; set; } + public DbSet RecitationPublishingTrackers { get; set; } } } diff --git a/RMuseum/Migrations/20201106070554_AudioNarrations.Designer.cs b/RMuseum/Migrations/20201106070554_AudioNarrations.Designer.cs deleted file mode 100644 index 138bb3c9..00000000 --- a/RMuseum/Migrations/20201106070554_AudioNarrations.Designer.cs +++ /dev/null @@ -1,1560 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using RMuseum.DbContext; - -namespace RMuseum.Migrations -{ - [DbContext(typeof(RMuseumDbContext))] - [Migration("20201106070554_AudioNarrations")] - partial class AudioNarrations - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "3.1.3") - .HasAnnotation("Relational:MaxIdentifierLength", 128) - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("ClaimType") - .HasColumnType("nvarchar(max)"); - - b.Property("ClaimValue") - .HasColumnType("nvarchar(max)"); - - b.Property("RoleId") - .HasColumnType("uniqueidentifier"); - - b.HasKey("Id"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetRoleClaims"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("ClaimType") - .HasColumnType("nvarchar(max)"); - - b.Property("ClaimValue") - .HasColumnType("nvarchar(max)"); - - b.Property("UserId") - .HasColumnType("uniqueidentifier"); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserClaims"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => - { - b.Property("LoginProvider") - .HasColumnType("nvarchar(450)"); - - b.Property("ProviderKey") - .HasColumnType("nvarchar(450)"); - - b.Property("ProviderDisplayName") - .HasColumnType("nvarchar(max)"); - - b.Property("UserId") - .HasColumnType("uniqueidentifier"); - - b.HasKey("LoginProvider", "ProviderKey"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserLogins"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => - { - b.Property("UserId") - .HasColumnType("uniqueidentifier"); - - b.Property("RoleId") - .HasColumnType("uniqueidentifier"); - - b.HasKey("UserId", "RoleId"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetUserRoles"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.Property("UserId") - .HasColumnType("uniqueidentifier"); - - b.Property("LoginProvider") - .HasColumnType("nvarchar(450)"); - - b.Property("Name") - .HasColumnType("nvarchar(450)"); - - b.Property("Value") - .HasColumnType("nvarchar(max)"); - - b.HasKey("UserId", "LoginProvider", "Name"); - - b.ToTable("AspNetUserTokens"); - }); - - modelBuilder.Entity("RMuseum.Models.Artifact.RArtifactItemRecord", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("CoverImageIndex") - .HasColumnType("int"); - - b.Property("Description") - .HasColumnType("nvarchar(max)"); - - b.Property("DescriptionInEnglish") - .HasColumnType("nvarchar(max)"); - - b.Property("FriendlyUrl") - .HasColumnType("nvarchar(450)"); - - b.Property("LastModified") - .HasColumnType("datetime2"); - - b.Property("Name") - .HasColumnType("nvarchar(max)"); - - b.Property("NameInEnglish") - .HasColumnType("nvarchar(max)"); - - b.Property("Order") - .HasColumnType("int"); - - b.Property("RArtifactMasterRecordId") - .HasColumnType("uniqueidentifier"); - - b.HasKey("Id"); - - b.HasIndex("RArtifactMasterRecordId", "FriendlyUrl") - .IsUnique() - .HasFilter("[FriendlyUrl] IS NOT NULL"); - - b.HasIndex("RArtifactMasterRecordId", "Order") - .IsUnique(); - - b.ToTable("Items"); - }); - - modelBuilder.Entity("RMuseum.Models.Artifact.RArtifactMasterRecord", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("CoverImageId") - .HasColumnType("uniqueidentifier"); - - b.Property("CoverItemIndex") - .HasColumnType("int"); - - b.Property("DateTime") - .HasColumnType("datetime2"); - - b.Property("Description") - .HasColumnType("nvarchar(max)"); - - b.Property("DescriptionInEnglish") - .HasColumnType("nvarchar(max)"); - - b.Property("FriendlyUrl") - .HasColumnType("nvarchar(450)"); - - b.Property("ItemCount") - .HasColumnType("int"); - - b.Property("LastModified") - .HasColumnType("datetime2"); - - b.Property("Name") - .HasColumnType("nvarchar(max)"); - - b.Property("NameInEnglish") - .HasColumnType("nvarchar(max)"); - - b.Property("Status") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("CoverImageId"); - - b.HasIndex("FriendlyUrl") - .IsUnique() - .HasFilter("[FriendlyUrl] IS NOT NULL"); - - b.ToTable("Artifacts"); - }); - - modelBuilder.Entity("RMuseum.Models.Artifact.RTag", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("FriendlyUrl") - .HasColumnType("nvarchar(450)"); - - b.Property("GlobalValue") - .HasColumnType("bit"); - - b.Property("Name") - .HasColumnType("nvarchar(max)"); - - b.Property("NameInEnglish") - .HasColumnType("nvarchar(max)"); - - b.Property("Order") - .HasColumnType("int"); - - b.Property("PluralName") - .HasColumnType("nvarchar(max)"); - - b.Property("PluralNameInEnglish") - .HasColumnType("nvarchar(max)"); - - b.Property("Status") - .HasColumnType("int"); - - b.Property("TagType") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("FriendlyUrl"); - - b.ToTable("Tags"); - }); - - modelBuilder.Entity("RMuseum.Models.Artifact.RTagValue", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("FriendlyUrl") - .HasColumnType("nvarchar(450)"); - - b.Property("Order") - .HasColumnType("int"); - - b.Property("RArtifactItemRecordId") - .HasColumnType("uniqueidentifier"); - - b.Property("RArtifactMasterRecordId") - .HasColumnType("uniqueidentifier"); - - b.Property("RTagId") - .HasColumnType("uniqueidentifier"); - - b.Property("Status") - .HasColumnType("int"); - - b.Property("Value") - .HasColumnType("nvarchar(max)"); - - b.Property("ValueInEnglish") - .HasColumnType("nvarchar(max)"); - - b.Property("ValueSupplement") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.HasIndex("FriendlyUrl"); - - b.HasIndex("RArtifactItemRecordId"); - - b.HasIndex("RArtifactMasterRecordId"); - - b.HasIndex("RTagId"); - - b.ToTable("TagValues"); - }); - - modelBuilder.Entity("RMuseum.Models.Bookmark.RUserBookmark", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("DateTime") - .HasColumnType("datetime2"); - - b.Property("Note") - .HasColumnType("nvarchar(max)"); - - b.Property("RAppUserId") - .HasColumnType("uniqueidentifier"); - - b.Property("RArtifactItemRecordId") - .HasColumnType("uniqueidentifier"); - - b.Property("RArtifactMasterRecordId") - .HasColumnType("uniqueidentifier"); - - b.Property("RBookmarkType") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("RAppUserId"); - - b.HasIndex("RArtifactItemRecordId"); - - b.HasIndex("RArtifactMasterRecordId"); - - b.ToTable("UserBookmarks"); - }); - - modelBuilder.Entity("RMuseum.Models.Ganjoor.GanjoorCat", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("FullUrl") - .HasColumnType("nvarchar(450)"); - - b.Property("ParentId") - .HasColumnType("int"); - - b.Property("PoetId") - .HasColumnType("int"); - - b.Property("Title") - .HasColumnType("nvarchar(max)"); - - b.Property("UrlSlug") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.HasIndex("FullUrl"); - - b.HasIndex("ParentId"); - - b.HasIndex("PoetId"); - - b.ToTable("GanjoorCategories"); - }); - - modelBuilder.Entity("RMuseum.Models.Ganjoor.GanjoorPoem", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CatId") - .HasColumnType("int"); - - b.Property("FullTitle") - .HasColumnType("nvarchar(max)"); - - b.Property("FullUrl") - .HasColumnType("nvarchar(450)"); - - b.Property("Title") - .HasColumnType("nvarchar(max)"); - - b.Property("UrlSlug") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.HasIndex("CatId"); - - b.HasIndex("FullUrl"); - - b.ToTable("GanjoorPoems"); - }); - - modelBuilder.Entity("RMuseum.Models.Ganjoor.GanjoorPoet", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("Description") - .HasColumnType("nvarchar(max)"); - - b.Property("Name") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("GanjoorPoets"); - }); - - modelBuilder.Entity("RMuseum.Models.Ganjoor.GanjoorVerse", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("PoemId") - .HasColumnType("int"); - - b.Property("Text") - .HasColumnType("nvarchar(max)"); - - b.Property("VOrder") - .HasColumnType("int"); - - b.Property("VersePosition") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("PoemId"); - - b.ToTable("GanjoorVerses"); - }); - - modelBuilder.Entity("RMuseum.Models.GanjoorAudio.PoemNarration", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("AudioArtist") - .HasColumnType("nvarchar(max)"); - - b.Property("AudioArtistUrl") - .HasColumnType("nvarchar(max)"); - - b.Property("AudioOrder") - .HasColumnType("int"); - - b.Property("AudioSrc") - .HasColumnType("nvarchar(max)"); - - b.Property("AudioSrcUrl") - .HasColumnType("nvarchar(max)"); - - b.Property("AudioSyncStatus") - .HasColumnType("int"); - - b.Property("AudioTitle") - .HasColumnType("nvarchar(max)"); - - b.Property("FileLastUpdated") - .HasColumnType("datetime2"); - - b.Property("FileNameWithoutExtension") - .HasColumnType("nvarchar(max)"); - - b.Property("GanjoorAudioId") - .HasColumnType("int"); - - b.Property("GanjoorPostId") - .HasColumnType("int"); - - b.Property("LegacyAudioGuid") - .HasColumnType("uniqueidentifier"); - - b.Property("LocalMp3FilePath") - .HasColumnType("nvarchar(max)"); - - b.Property("LocalXmlFilePath") - .HasColumnType("nvarchar(max)"); - - b.Property("Mp3FileCheckSum") - .HasColumnType("nvarchar(max)"); - - b.Property("Mp3SizeInBytes") - .HasColumnType("int"); - - b.Property("OggSizeInBytes") - .HasColumnType("int"); - - b.Property("OwnerId") - .HasColumnType("uniqueidentifier"); - - b.Property("ReviewDate") - .HasColumnType("datetime2"); - - b.Property("ReviewMsg") - .HasColumnType("nvarchar(max)"); - - b.Property("ReviewStatus") - .HasColumnType("int"); - - b.Property("ReviewerId") - .HasColumnType("uniqueidentifier"); - - b.Property("SoundFilesFolder") - .HasColumnType("nvarchar(max)"); - - b.Property("UploadDate") - .HasColumnType("datetime2"); - - b.HasKey("Id"); - - b.HasIndex("GanjoorPostId"); - - b.HasIndex("OwnerId"); - - b.HasIndex("ReviewerId"); - - b.ToTable("AudioFiles"); - }); - - modelBuilder.Entity("RMuseum.Models.GanjoorAudio.UserNarrationProfile", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("ArtistName") - .HasColumnType("nvarchar(max)"); - - b.Property("ArtistUrl") - .HasColumnType("nvarchar(max)"); - - b.Property("AudioSrc") - .HasColumnType("nvarchar(max)"); - - b.Property("AudioSrcUrl") - .HasColumnType("nvarchar(max)"); - - b.Property("FileSuffixWithoutDash") - .HasColumnType("nvarchar(max)"); - - b.Property("IsDefault") - .HasColumnType("bit"); - - b.Property("Name") - .HasColumnType("nvarchar(max)"); - - b.Property("UserId") - .HasColumnType("uniqueidentifier"); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("UserNarrationProfiles"); - }); - - modelBuilder.Entity("RMuseum.Models.GanjoorIntegration.GanjoorLink", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("ArtifactId") - .HasColumnType("uniqueidentifier"); - - b.Property("GanjoorPostId") - .HasColumnType("int"); - - b.Property("GanjoorTitle") - .HasColumnType("nvarchar(max)"); - - b.Property("GanjoorUrl") - .HasColumnType("nvarchar(max)"); - - b.Property("ItemId") - .HasColumnType("uniqueidentifier"); - - b.Property("ReviewDate") - .HasColumnType("datetime2"); - - b.Property("ReviewResult") - .HasColumnType("int"); - - b.Property("ReviewerId") - .HasColumnType("uniqueidentifier"); - - b.Property("SuggestedById") - .HasColumnType("uniqueidentifier"); - - b.Property("SuggestionDate") - .HasColumnType("datetime2"); - - b.Property("Synchronized") - .HasColumnType("bit"); - - b.HasKey("Id"); - - b.HasIndex("ArtifactId"); - - b.HasIndex("ItemId"); - - b.HasIndex("ReviewerId"); - - b.HasIndex("SuggestedById"); - - b.ToTable("GanjoorLinks"); - }); - - modelBuilder.Entity("RMuseum.Models.GanjoorIntegration.PinterestLink", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("AltText") - .HasColumnType("nvarchar(max)"); - - b.Property("ArtifactId") - .HasColumnType("uniqueidentifier"); - - b.Property("GanjoorPostId") - .HasColumnType("int"); - - b.Property("GanjoorTitle") - .HasColumnType("nvarchar(max)"); - - b.Property("GanjoorUrl") - .HasColumnType("nvarchar(max)"); - - b.Property("ItemId") - .HasColumnType("uniqueidentifier"); - - b.Property("LinkType") - .HasColumnType("int"); - - b.Property("PinterestImageUrl") - .HasColumnType("nvarchar(max)"); - - b.Property("PinterestUrl") - .HasColumnType("nvarchar(max)"); - - b.Property("ReviewDate") - .HasColumnType("datetime2"); - - b.Property("ReviewDesc") - .HasColumnType("nvarchar(max)"); - - b.Property("ReviewResult") - .HasColumnType("int"); - - b.Property("ReviewerId") - .HasColumnType("uniqueidentifier"); - - b.Property("SuggestedById") - .HasColumnType("uniqueidentifier"); - - b.Property("SuggestionDate") - .HasColumnType("datetime2"); - - b.Property("Synchronized") - .HasColumnType("bit"); - - b.HasKey("Id"); - - b.HasIndex("ArtifactId"); - - b.HasIndex("ItemId"); - - b.HasIndex("ReviewerId"); - - b.HasIndex("SuggestedById"); - - b.ToTable("PinterestLinks"); - }); - - modelBuilder.Entity("RMuseum.Models.ImportJob.ImportJob", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("ArtifactId") - .HasColumnType("uniqueidentifier"); - - b.Property("EndTime") - .HasColumnType("datetime2"); - - b.Property("Exception") - .HasColumnType("nvarchar(max)"); - - b.Property("FriendlyUrl") - .HasColumnType("nvarchar(max)"); - - b.Property("JobType") - .HasColumnType("int"); - - b.Property("ProgressPercent") - .HasColumnType("decimal(18,2)"); - - b.Property("QueueTime") - .HasColumnType("datetime2"); - - b.Property("ResourceNumber") - .HasColumnType("nvarchar(max)"); - - b.Property("SrcContent") - .HasColumnType("nvarchar(max)"); - - b.Property("SrcUrl") - .HasColumnType("nvarchar(max)"); - - b.Property("StartTime") - .HasColumnType("datetime2"); - - b.Property("Status") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("ArtifactId"); - - b.ToTable("ImportJobs"); - }); - - modelBuilder.Entity("RMuseum.Models.Note.RUserNote", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("DateTime") - .HasColumnType("datetime2"); - - b.Property("HtmlContent") - .HasColumnType("nvarchar(max)"); - - b.Property("LastModified") - .HasColumnType("datetime2"); - - b.Property("Modified") - .HasColumnType("bit"); - - b.Property("NoteType") - .HasColumnType("int"); - - b.Property("RAppUserId") - .HasColumnType("uniqueidentifier"); - - b.Property("RArtifactItemRecordId") - .HasColumnType("uniqueidentifier"); - - b.Property("RArtifactMasterRecordId") - .HasColumnType("uniqueidentifier"); - - b.Property("ReferenceNoteId") - .HasColumnType("uniqueidentifier"); - - b.Property("Status") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("RAppUserId"); - - b.HasIndex("RArtifactItemRecordId"); - - b.HasIndex("RArtifactMasterRecordId"); - - b.HasIndex("ReferenceNoteId"); - - b.ToTable("UserNotes"); - }); - - modelBuilder.Entity("RMuseum.Models.Notification.RUserNotification", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("DateTime") - .HasColumnType("datetime2"); - - b.Property("HtmlText") - .HasColumnType("nvarchar(max)"); - - b.Property("Status") - .HasColumnType("int"); - - b.Property("Subject") - .HasColumnType("nvarchar(max)"); - - b.Property("UserId") - .HasColumnType("uniqueidentifier"); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("Notifications"); - }); - - modelBuilder.Entity("RMuseum.Models.UploadSession.UploadSession", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("ProcessEndTime") - .HasColumnType("datetime2"); - - b.Property("ProcessProgress") - .HasColumnType("int"); - - b.Property("ProcessStartTime") - .HasColumnType("datetime2"); - - b.Property("SessionType") - .HasColumnType("int"); - - b.Property("Status") - .HasColumnType("int"); - - b.Property("UploadEndTime") - .HasColumnType("datetime2"); - - b.Property("UploadStartTime") - .HasColumnType("datetime2"); - - b.Property("UseId") - .HasColumnType("uniqueidentifier"); - - b.Property("UserId") - .HasColumnType("uniqueidentifier"); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("UploadSessions"); - }); - - modelBuilder.Entity("RMuseum.Models.UploadSession.UploadSessionFile", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("ContentDisposition") - .HasColumnType("nvarchar(max)"); - - b.Property("ContentType") - .HasColumnType("nvarchar(max)"); - - b.Property("FileName") - .HasColumnType("nvarchar(max)"); - - b.Property("FilePath") - .HasColumnType("nvarchar(max)"); - - b.Property("Length") - .HasColumnType("bigint"); - - b.Property("MP3FileCheckSum") - .HasColumnType("nvarchar(max)"); - - b.Property("Name") - .HasColumnType("nvarchar(max)"); - - b.Property("ProcessResult") - .HasColumnType("bit"); - - b.Property("ProcessResultMsg") - .HasColumnType("nvarchar(max)"); - - b.Property("UploadSessionId") - .HasColumnType("uniqueidentifier"); - - b.HasKey("Id"); - - b.HasIndex("UploadSessionId"); - - b.ToTable("UploadedFiles"); - }); - - modelBuilder.Entity("RSecurityBackend.Models.Audit.Db.REvent", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("Duration") - .HasColumnType("int"); - - b.Property("EndDate") - .HasColumnType("datetime2"); - - b.Property("EventType") - .HasColumnType("nvarchar(max)"); - - b.Property("IpAddress") - .HasColumnType("nvarchar(max)"); - - b.Property("JsonData") - .HasColumnType("nvarchar(max)"); - - b.Property("RequestUrl") - .HasColumnType("nvarchar(max)"); - - b.Property("ResponseStatusCode") - .HasColumnType("int"); - - b.Property("StartDate") - .HasColumnType("datetime2"); - - b.Property("UserName") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("AuditLogs"); - }); - - modelBuilder.Entity("RSecurityBackend.Models.Auth.Db.RAppRole", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .HasColumnType("nvarchar(max)"); - - b.Property("Description") - .HasColumnType("nvarchar(max)"); - - b.Property("Name") - .HasColumnType("nvarchar(256)") - .HasMaxLength(256); - - b.Property("NormalizedName") - .HasColumnType("nvarchar(256)") - .HasMaxLength(256); - - b.HasKey("Id"); - - b.HasIndex("NormalizedName") - .IsUnique() - .HasName("RoleNameIndex") - .HasFilter("[NormalizedName] IS NOT NULL"); - - b.ToTable("AspNetRoles"); - }); - - modelBuilder.Entity("RSecurityBackend.Models.Auth.Db.RAppUser", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("AccessFailedCount") - .HasColumnType("int"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .HasColumnType("nvarchar(max)"); - - b.Property("CreateDate") - .HasColumnType("datetime2"); - - b.Property("Email") - .HasColumnType("nvarchar(256)") - .HasMaxLength(256); - - b.Property("EmailConfirmed") - .HasColumnType("bit"); - - b.Property("FirstName") - .HasColumnType("nvarchar(max)"); - - b.Property("LockoutEnabled") - .HasColumnType("bit"); - - b.Property("LockoutEnd") - .HasColumnType("datetimeoffset"); - - b.Property("NormalizedEmail") - .HasColumnType("nvarchar(256)") - .HasMaxLength(256); - - b.Property("NormalizedUserName") - .HasColumnType("nvarchar(256)") - .HasMaxLength(256); - - b.Property("PasswordHash") - .HasColumnType("nvarchar(max)"); - - b.Property("PhoneNumber") - .HasColumnType("nvarchar(max)"); - - b.Property("PhoneNumberConfirmed") - .HasColumnType("bit"); - - b.Property("RImageId") - .HasColumnType("uniqueidentifier"); - - b.Property("SecurityStamp") - .HasColumnType("nvarchar(max)"); - - b.Property("Status") - .HasColumnType("int"); - - b.Property("SureName") - .HasColumnType("nvarchar(max)"); - - b.Property("TwoFactorEnabled") - .HasColumnType("bit"); - - b.Property("UserName") - .HasColumnType("nvarchar(256)") - .HasMaxLength(256); - - b.HasKey("Id"); - - b.HasIndex("NormalizedEmail") - .HasName("EmailIndex"); - - b.HasIndex("NormalizedUserName") - .IsUnique() - .HasName("UserNameIndex") - .HasFilter("[NormalizedUserName] IS NOT NULL"); - - b.HasIndex("RImageId"); - - b.ToTable("AspNetUsers"); - }); - - modelBuilder.Entity("RSecurityBackend.Models.Auth.Db.RCaptchaImage", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("DateTime") - .HasColumnType("datetime2"); - - b.Property("RImageId") - .HasColumnType("uniqueidentifier"); - - b.Property("Value") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.HasIndex("RImageId"); - - b.ToTable("CaptchaImages"); - }); - - modelBuilder.Entity("RSecurityBackend.Models.Auth.Db.RPermission", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("OperationShortName") - .HasColumnType("nvarchar(max)"); - - b.Property("RAppRoleId") - .HasColumnType("uniqueidentifier"); - - b.Property("SecurableItemShortName") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.HasIndex("RAppRoleId"); - - b.ToTable("Permissions"); - }); - - modelBuilder.Entity("RSecurityBackend.Models.Auth.Db.RTemporaryUserSession", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("ClientAppName") - .HasColumnType("nvarchar(max)"); - - b.Property("ClientIPAddress") - .HasColumnType("nvarchar(max)"); - - b.Property("Language") - .HasColumnType("nvarchar(max)"); - - b.Property("LastRenewal") - .HasColumnType("datetime2"); - - b.Property("LoginTime") - .HasColumnType("datetime2"); - - b.Property("RAppUserId") - .HasColumnType("uniqueidentifier"); - - b.Property("Token") - .HasColumnType("nvarchar(max)"); - - b.Property("ValidUntil") - .HasColumnType("datetime2"); - - b.HasKey("Id"); - - b.HasIndex("RAppUserId"); - - b.ToTable("Sessions"); - }); - - modelBuilder.Entity("RSecurityBackend.Models.Auth.Db.RVerifyQueueItem", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("ClientAppName") - .HasColumnType("nvarchar(max)"); - - b.Property("ClientIPAddress") - .HasColumnType("nvarchar(max)"); - - b.Property("DateTime") - .HasColumnType("datetime2"); - - b.Property("Email") - .HasColumnType("nvarchar(max)"); - - b.Property("Language") - .HasColumnType("nvarchar(max)"); - - b.Property("PhoneNumber") - .HasColumnType("nvarchar(max)"); - - b.Property("QueueType") - .HasColumnType("int"); - - b.Property("Secret") - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("Secret") - .IsUnique() - .HasFilter("[Secret] IS NOT NULL"); - - b.ToTable("VerifyQueueItems"); - }); - - modelBuilder.Entity("RSecurityBackend.Models.Image.RImage", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("ContentType") - .HasColumnType("nvarchar(max)"); - - b.Property("DataTime") - .HasColumnType("datetime2"); - - b.Property("Discriminator") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("FileSizeInBytes") - .HasColumnType("bigint"); - - b.Property("FolderName") - .HasColumnType("nvarchar(max)"); - - b.Property("ImageHeight") - .HasColumnType("int"); - - b.Property("ImageWidth") - .HasColumnType("int"); - - b.Property("LastModified") - .HasColumnType("datetime2"); - - b.Property("OriginalFileName") - .HasColumnType("nvarchar(max)"); - - b.Property("StoredFileName") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("GeneralImages"); - - b.HasDiscriminator("Discriminator").HasValue("RImage"); - }); - - modelBuilder.Entity("RMuseum.Models.Artifact.RPictureFile", b => - { - b.HasBaseType("RSecurityBackend.Models.Image.RImage"); - - b.Property("Description") - .HasColumnType("nvarchar(max)"); - - b.Property("DescriptionInEnglish") - .HasColumnType("nvarchar(max)"); - - b.Property("LastModifiedMeta") - .HasColumnType("datetime2"); - - b.Property("NormalSizeImageHeight") - .HasColumnType("int"); - - b.Property("NormalSizeImageStoredFileName") - .HasColumnType("nvarchar(max)"); - - b.Property("NormalSizeImageWidth") - .HasColumnType("int"); - - b.Property("Order") - .HasColumnType("int"); - - b.Property("RArtifactItemRecordId") - .HasColumnType("uniqueidentifier"); - - b.Property("SrcUrl") - .HasColumnType("nvarchar(max)"); - - b.Property("Status") - .HasColumnType("int"); - - b.Property("ThumbnailImageHeight") - .HasColumnType("int"); - - b.Property("ThumbnailImageStoredFileName") - .HasColumnType("nvarchar(max)"); - - b.Property("ThumbnailImageWidth") - .HasColumnType("int"); - - b.Property("Title") - .HasColumnType("nvarchar(max)"); - - b.Property("TitleInEnglish") - .HasColumnType("nvarchar(max)"); - - b.HasIndex("RArtifactItemRecordId"); - - b.HasDiscriminator().HasValue("RPictureFile"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => - { - b.HasOne("RSecurityBackend.Models.Auth.Db.RAppRole", null) - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => - { - b.HasOne("RSecurityBackend.Models.Auth.Db.RAppUser", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => - { - b.HasOne("RSecurityBackend.Models.Auth.Db.RAppUser", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => - { - b.HasOne("RSecurityBackend.Models.Auth.Db.RAppRole", null) - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("RSecurityBackend.Models.Auth.Db.RAppUser", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.HasOne("RSecurityBackend.Models.Auth.Db.RAppUser", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("RMuseum.Models.Artifact.RArtifactItemRecord", b => - { - b.HasOne("RMuseum.Models.Artifact.RArtifactMasterRecord", null) - .WithMany("Items") - .HasForeignKey("RArtifactMasterRecordId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("RMuseum.Models.Artifact.RArtifactMasterRecord", b => - { - b.HasOne("RMuseum.Models.Artifact.RPictureFile", "CoverImage") - .WithMany() - .HasForeignKey("CoverImageId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("RMuseum.Models.Artifact.RTagValue", b => - { - b.HasOne("RMuseum.Models.Artifact.RArtifactItemRecord", null) - .WithMany("Tags") - .HasForeignKey("RArtifactItemRecordId"); - - b.HasOne("RMuseum.Models.Artifact.RArtifactMasterRecord", null) - .WithMany("Tags") - .HasForeignKey("RArtifactMasterRecordId"); - - b.HasOne("RMuseum.Models.Artifact.RTag", "RTag") - .WithMany() - .HasForeignKey("RTagId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("RMuseum.Models.Bookmark.RUserBookmark", b => - { - b.HasOne("RSecurityBackend.Models.Auth.Db.RAppUser", "RAppUser") - .WithMany() - .HasForeignKey("RAppUserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("RMuseum.Models.Artifact.RArtifactItemRecord", "RArtifactItemRecord") - .WithMany() - .HasForeignKey("RArtifactItemRecordId"); - - b.HasOne("RMuseum.Models.Artifact.RArtifactMasterRecord", "RArtifactMasterRecord") - .WithMany() - .HasForeignKey("RArtifactMasterRecordId"); - }); - - modelBuilder.Entity("RMuseum.Models.Ganjoor.GanjoorCat", b => - { - b.HasOne("RMuseum.Models.Ganjoor.GanjoorCat", "Parent") - .WithMany() - .HasForeignKey("ParentId"); - - b.HasOne("RMuseum.Models.Ganjoor.GanjoorPoet", "Poet") - .WithMany() - .HasForeignKey("PoetId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("RMuseum.Models.Ganjoor.GanjoorPoem", b => - { - b.HasOne("RMuseum.Models.Ganjoor.GanjoorCat", "Cat") - .WithMany() - .HasForeignKey("CatId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("RMuseum.Models.Ganjoor.GanjoorVerse", b => - { - b.HasOne("RMuseum.Models.Ganjoor.GanjoorPoem", "Poem") - .WithMany() - .HasForeignKey("PoemId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("RMuseum.Models.GanjoorAudio.PoemNarration", b => - { - b.HasOne("RSecurityBackend.Models.Auth.Db.RAppUser", "Owner") - .WithMany() - .HasForeignKey("OwnerId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("RSecurityBackend.Models.Auth.Db.RAppUser", "Reviewer") - .WithMany() - .HasForeignKey("ReviewerId"); - }); - - modelBuilder.Entity("RMuseum.Models.GanjoorAudio.UserNarrationProfile", b => - { - b.HasOne("RSecurityBackend.Models.Auth.Db.RAppUser", "User") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("RMuseum.Models.GanjoorIntegration.GanjoorLink", b => - { - b.HasOne("RMuseum.Models.Artifact.RArtifactMasterRecord", "Artifact") - .WithMany() - .HasForeignKey("ArtifactId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("RMuseum.Models.Artifact.RArtifactItemRecord", "Item") - .WithMany() - .HasForeignKey("ItemId"); - - b.HasOne("RSecurityBackend.Models.Auth.Db.RAppUser", "Reviewer") - .WithMany() - .HasForeignKey("ReviewerId"); - - b.HasOne("RSecurityBackend.Models.Auth.Db.RAppUser", "SuggestedBy") - .WithMany() - .HasForeignKey("SuggestedById") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("RMuseum.Models.GanjoorIntegration.PinterestLink", b => - { - b.HasOne("RMuseum.Models.Artifact.RArtifactMasterRecord", "Artifact") - .WithMany() - .HasForeignKey("ArtifactId"); - - b.HasOne("RMuseum.Models.Artifact.RArtifactItemRecord", "Item") - .WithMany() - .HasForeignKey("ItemId"); - - b.HasOne("RSecurityBackend.Models.Auth.Db.RAppUser", "Reviewer") - .WithMany() - .HasForeignKey("ReviewerId"); - - b.HasOne("RSecurityBackend.Models.Auth.Db.RAppUser", "SuggestedBy") - .WithMany() - .HasForeignKey("SuggestedById"); - }); - - modelBuilder.Entity("RMuseum.Models.ImportJob.ImportJob", b => - { - b.HasOne("RMuseum.Models.Artifact.RArtifactMasterRecord", "Artifact") - .WithMany() - .HasForeignKey("ArtifactId"); - }); - - modelBuilder.Entity("RMuseum.Models.Note.RUserNote", b => - { - b.HasOne("RSecurityBackend.Models.Auth.Db.RAppUser", "RAppUser") - .WithMany() - .HasForeignKey("RAppUserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("RMuseum.Models.Artifact.RArtifactItemRecord", "RArtifactItemRecord") - .WithMany() - .HasForeignKey("RArtifactItemRecordId"); - - b.HasOne("RMuseum.Models.Artifact.RArtifactMasterRecord", "RArtifactMasterRecord") - .WithMany() - .HasForeignKey("RArtifactMasterRecordId"); - - b.HasOne("RMuseum.Models.Note.RUserNote", "ReferenceNote") - .WithMany() - .HasForeignKey("ReferenceNoteId"); - }); - - modelBuilder.Entity("RMuseum.Models.Notification.RUserNotification", b => - { - b.HasOne("RSecurityBackend.Models.Auth.Db.RAppUser", "User") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("RMuseum.Models.UploadSession.UploadSession", b => - { - b.HasOne("RSecurityBackend.Models.Auth.Db.RAppUser", "User") - .WithMany() - .HasForeignKey("UserId"); - }); - - modelBuilder.Entity("RMuseum.Models.UploadSession.UploadSessionFile", b => - { - b.HasOne("RMuseum.Models.UploadSession.UploadSession", null) - .WithMany("UploadedFiles") - .HasForeignKey("UploadSessionId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("RSecurityBackend.Models.Auth.Db.RAppUser", b => - { - b.HasOne("RSecurityBackend.Models.Image.RImage", "RImage") - .WithMany() - .HasForeignKey("RImageId"); - }); - - modelBuilder.Entity("RSecurityBackend.Models.Auth.Db.RCaptchaImage", b => - { - b.HasOne("RSecurityBackend.Models.Image.RImage", "RImage") - .WithMany() - .HasForeignKey("RImageId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("RSecurityBackend.Models.Auth.Db.RPermission", b => - { - b.HasOne("RSecurityBackend.Models.Auth.Db.RAppRole", null) - .WithMany("Permissions") - .HasForeignKey("RAppRoleId"); - }); - - modelBuilder.Entity("RSecurityBackend.Models.Auth.Db.RTemporaryUserSession", b => - { - b.HasOne("RSecurityBackend.Models.Auth.Db.RAppUser", "RAppUser") - .WithMany() - .HasForeignKey("RAppUserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("RMuseum.Models.Artifact.RPictureFile", b => - { - b.HasOne("RMuseum.Models.Artifact.RArtifactItemRecord", null) - .WithMany("Images") - .HasForeignKey("RArtifactItemRecordId"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/RMuseum/Migrations/20201106113129_PoemNarrationUploadDateIndex.Designer.cs b/RMuseum/Migrations/20201106113129_PoemNarrationUploadDateIndex.Designer.cs deleted file mode 100644 index 173a3cbd..00000000 --- a/RMuseum/Migrations/20201106113129_PoemNarrationUploadDateIndex.Designer.cs +++ /dev/null @@ -1,1562 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using RMuseum.DbContext; - -namespace RMuseum.Migrations -{ - [DbContext(typeof(RMuseumDbContext))] - [Migration("20201106113129_PoemNarrationUploadDateIndex")] - partial class PoemNarrationUploadDateIndex - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "3.1.3") - .HasAnnotation("Relational:MaxIdentifierLength", 128) - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("ClaimType") - .HasColumnType("nvarchar(max)"); - - b.Property("ClaimValue") - .HasColumnType("nvarchar(max)"); - - b.Property("RoleId") - .HasColumnType("uniqueidentifier"); - - b.HasKey("Id"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetRoleClaims"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("ClaimType") - .HasColumnType("nvarchar(max)"); - - b.Property("ClaimValue") - .HasColumnType("nvarchar(max)"); - - b.Property("UserId") - .HasColumnType("uniqueidentifier"); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserClaims"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => - { - b.Property("LoginProvider") - .HasColumnType("nvarchar(450)"); - - b.Property("ProviderKey") - .HasColumnType("nvarchar(450)"); - - b.Property("ProviderDisplayName") - .HasColumnType("nvarchar(max)"); - - b.Property("UserId") - .HasColumnType("uniqueidentifier"); - - b.HasKey("LoginProvider", "ProviderKey"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserLogins"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => - { - b.Property("UserId") - .HasColumnType("uniqueidentifier"); - - b.Property("RoleId") - .HasColumnType("uniqueidentifier"); - - b.HasKey("UserId", "RoleId"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetUserRoles"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.Property("UserId") - .HasColumnType("uniqueidentifier"); - - b.Property("LoginProvider") - .HasColumnType("nvarchar(450)"); - - b.Property("Name") - .HasColumnType("nvarchar(450)"); - - b.Property("Value") - .HasColumnType("nvarchar(max)"); - - b.HasKey("UserId", "LoginProvider", "Name"); - - b.ToTable("AspNetUserTokens"); - }); - - modelBuilder.Entity("RMuseum.Models.Artifact.RArtifactItemRecord", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("CoverImageIndex") - .HasColumnType("int"); - - b.Property("Description") - .HasColumnType("nvarchar(max)"); - - b.Property("DescriptionInEnglish") - .HasColumnType("nvarchar(max)"); - - b.Property("FriendlyUrl") - .HasColumnType("nvarchar(450)"); - - b.Property("LastModified") - .HasColumnType("datetime2"); - - b.Property("Name") - .HasColumnType("nvarchar(max)"); - - b.Property("NameInEnglish") - .HasColumnType("nvarchar(max)"); - - b.Property("Order") - .HasColumnType("int"); - - b.Property("RArtifactMasterRecordId") - .HasColumnType("uniqueidentifier"); - - b.HasKey("Id"); - - b.HasIndex("RArtifactMasterRecordId", "FriendlyUrl") - .IsUnique() - .HasFilter("[FriendlyUrl] IS NOT NULL"); - - b.HasIndex("RArtifactMasterRecordId", "Order") - .IsUnique(); - - b.ToTable("Items"); - }); - - modelBuilder.Entity("RMuseum.Models.Artifact.RArtifactMasterRecord", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("CoverImageId") - .HasColumnType("uniqueidentifier"); - - b.Property("CoverItemIndex") - .HasColumnType("int"); - - b.Property("DateTime") - .HasColumnType("datetime2"); - - b.Property("Description") - .HasColumnType("nvarchar(max)"); - - b.Property("DescriptionInEnglish") - .HasColumnType("nvarchar(max)"); - - b.Property("FriendlyUrl") - .HasColumnType("nvarchar(450)"); - - b.Property("ItemCount") - .HasColumnType("int"); - - b.Property("LastModified") - .HasColumnType("datetime2"); - - b.Property("Name") - .HasColumnType("nvarchar(max)"); - - b.Property("NameInEnglish") - .HasColumnType("nvarchar(max)"); - - b.Property("Status") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("CoverImageId"); - - b.HasIndex("FriendlyUrl") - .IsUnique() - .HasFilter("[FriendlyUrl] IS NOT NULL"); - - b.ToTable("Artifacts"); - }); - - modelBuilder.Entity("RMuseum.Models.Artifact.RTag", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("FriendlyUrl") - .HasColumnType("nvarchar(450)"); - - b.Property("GlobalValue") - .HasColumnType("bit"); - - b.Property("Name") - .HasColumnType("nvarchar(max)"); - - b.Property("NameInEnglish") - .HasColumnType("nvarchar(max)"); - - b.Property("Order") - .HasColumnType("int"); - - b.Property("PluralName") - .HasColumnType("nvarchar(max)"); - - b.Property("PluralNameInEnglish") - .HasColumnType("nvarchar(max)"); - - b.Property("Status") - .HasColumnType("int"); - - b.Property("TagType") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("FriendlyUrl"); - - b.ToTable("Tags"); - }); - - modelBuilder.Entity("RMuseum.Models.Artifact.RTagValue", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("FriendlyUrl") - .HasColumnType("nvarchar(450)"); - - b.Property("Order") - .HasColumnType("int"); - - b.Property("RArtifactItemRecordId") - .HasColumnType("uniqueidentifier"); - - b.Property("RArtifactMasterRecordId") - .HasColumnType("uniqueidentifier"); - - b.Property("RTagId") - .HasColumnType("uniqueidentifier"); - - b.Property("Status") - .HasColumnType("int"); - - b.Property("Value") - .HasColumnType("nvarchar(max)"); - - b.Property("ValueInEnglish") - .HasColumnType("nvarchar(max)"); - - b.Property("ValueSupplement") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.HasIndex("FriendlyUrl"); - - b.HasIndex("RArtifactItemRecordId"); - - b.HasIndex("RArtifactMasterRecordId"); - - b.HasIndex("RTagId"); - - b.ToTable("TagValues"); - }); - - modelBuilder.Entity("RMuseum.Models.Bookmark.RUserBookmark", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("DateTime") - .HasColumnType("datetime2"); - - b.Property("Note") - .HasColumnType("nvarchar(max)"); - - b.Property("RAppUserId") - .HasColumnType("uniqueidentifier"); - - b.Property("RArtifactItemRecordId") - .HasColumnType("uniqueidentifier"); - - b.Property("RArtifactMasterRecordId") - .HasColumnType("uniqueidentifier"); - - b.Property("RBookmarkType") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("RAppUserId"); - - b.HasIndex("RArtifactItemRecordId"); - - b.HasIndex("RArtifactMasterRecordId"); - - b.ToTable("UserBookmarks"); - }); - - modelBuilder.Entity("RMuseum.Models.Ganjoor.GanjoorCat", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("FullUrl") - .HasColumnType("nvarchar(450)"); - - b.Property("ParentId") - .HasColumnType("int"); - - b.Property("PoetId") - .HasColumnType("int"); - - b.Property("Title") - .HasColumnType("nvarchar(max)"); - - b.Property("UrlSlug") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.HasIndex("FullUrl"); - - b.HasIndex("ParentId"); - - b.HasIndex("PoetId"); - - b.ToTable("GanjoorCategories"); - }); - - modelBuilder.Entity("RMuseum.Models.Ganjoor.GanjoorPoem", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("CatId") - .HasColumnType("int"); - - b.Property("FullTitle") - .HasColumnType("nvarchar(max)"); - - b.Property("FullUrl") - .HasColumnType("nvarchar(450)"); - - b.Property("Title") - .HasColumnType("nvarchar(max)"); - - b.Property("UrlSlug") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.HasIndex("CatId"); - - b.HasIndex("FullUrl"); - - b.ToTable("GanjoorPoems"); - }); - - modelBuilder.Entity("RMuseum.Models.Ganjoor.GanjoorPoet", b => - { - b.Property("Id") - .HasColumnType("int"); - - b.Property("Description") - .HasColumnType("nvarchar(max)"); - - b.Property("Name") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("GanjoorPoets"); - }); - - modelBuilder.Entity("RMuseum.Models.Ganjoor.GanjoorVerse", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("PoemId") - .HasColumnType("int"); - - b.Property("Text") - .HasColumnType("nvarchar(max)"); - - b.Property("VOrder") - .HasColumnType("int"); - - b.Property("VersePosition") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("PoemId"); - - b.ToTable("GanjoorVerses"); - }); - - modelBuilder.Entity("RMuseum.Models.GanjoorAudio.PoemNarration", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("AudioArtist") - .HasColumnType("nvarchar(max)"); - - b.Property("AudioArtistUrl") - .HasColumnType("nvarchar(max)"); - - b.Property("AudioOrder") - .HasColumnType("int"); - - b.Property("AudioSrc") - .HasColumnType("nvarchar(max)"); - - b.Property("AudioSrcUrl") - .HasColumnType("nvarchar(max)"); - - b.Property("AudioSyncStatus") - .HasColumnType("int"); - - b.Property("AudioTitle") - .HasColumnType("nvarchar(max)"); - - b.Property("FileLastUpdated") - .HasColumnType("datetime2"); - - b.Property("FileNameWithoutExtension") - .HasColumnType("nvarchar(max)"); - - b.Property("GanjoorAudioId") - .HasColumnType("int"); - - b.Property("GanjoorPostId") - .HasColumnType("int"); - - b.Property("LegacyAudioGuid") - .HasColumnType("uniqueidentifier"); - - b.Property("LocalMp3FilePath") - .HasColumnType("nvarchar(max)"); - - b.Property("LocalXmlFilePath") - .HasColumnType("nvarchar(max)"); - - b.Property("Mp3FileCheckSum") - .HasColumnType("nvarchar(max)"); - - b.Property("Mp3SizeInBytes") - .HasColumnType("int"); - - b.Property("OggSizeInBytes") - .HasColumnType("int"); - - b.Property("OwnerId") - .HasColumnType("uniqueidentifier"); - - b.Property("ReviewDate") - .HasColumnType("datetime2"); - - b.Property("ReviewMsg") - .HasColumnType("nvarchar(max)"); - - b.Property("ReviewStatus") - .HasColumnType("int"); - - b.Property("ReviewerId") - .HasColumnType("uniqueidentifier"); - - b.Property("SoundFilesFolder") - .HasColumnType("nvarchar(max)"); - - b.Property("UploadDate") - .HasColumnType("datetime2"); - - b.HasKey("Id"); - - b.HasIndex("GanjoorPostId"); - - b.HasIndex("OwnerId"); - - b.HasIndex("ReviewerId"); - - b.HasIndex("UploadDate"); - - b.ToTable("AudioFiles"); - }); - - modelBuilder.Entity("RMuseum.Models.GanjoorAudio.UserNarrationProfile", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("ArtistName") - .HasColumnType("nvarchar(max)"); - - b.Property("ArtistUrl") - .HasColumnType("nvarchar(max)"); - - b.Property("AudioSrc") - .HasColumnType("nvarchar(max)"); - - b.Property("AudioSrcUrl") - .HasColumnType("nvarchar(max)"); - - b.Property("FileSuffixWithoutDash") - .HasColumnType("nvarchar(max)"); - - b.Property("IsDefault") - .HasColumnType("bit"); - - b.Property("Name") - .HasColumnType("nvarchar(max)"); - - b.Property("UserId") - .HasColumnType("uniqueidentifier"); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("UserNarrationProfiles"); - }); - - modelBuilder.Entity("RMuseum.Models.GanjoorIntegration.GanjoorLink", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("ArtifactId") - .HasColumnType("uniqueidentifier"); - - b.Property("GanjoorPostId") - .HasColumnType("int"); - - b.Property("GanjoorTitle") - .HasColumnType("nvarchar(max)"); - - b.Property("GanjoorUrl") - .HasColumnType("nvarchar(max)"); - - b.Property("ItemId") - .HasColumnType("uniqueidentifier"); - - b.Property("ReviewDate") - .HasColumnType("datetime2"); - - b.Property("ReviewResult") - .HasColumnType("int"); - - b.Property("ReviewerId") - .HasColumnType("uniqueidentifier"); - - b.Property("SuggestedById") - .HasColumnType("uniqueidentifier"); - - b.Property("SuggestionDate") - .HasColumnType("datetime2"); - - b.Property("Synchronized") - .HasColumnType("bit"); - - b.HasKey("Id"); - - b.HasIndex("ArtifactId"); - - b.HasIndex("ItemId"); - - b.HasIndex("ReviewerId"); - - b.HasIndex("SuggestedById"); - - b.ToTable("GanjoorLinks"); - }); - - modelBuilder.Entity("RMuseum.Models.GanjoorIntegration.PinterestLink", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("AltText") - .HasColumnType("nvarchar(max)"); - - b.Property("ArtifactId") - .HasColumnType("uniqueidentifier"); - - b.Property("GanjoorPostId") - .HasColumnType("int"); - - b.Property("GanjoorTitle") - .HasColumnType("nvarchar(max)"); - - b.Property("GanjoorUrl") - .HasColumnType("nvarchar(max)"); - - b.Property("ItemId") - .HasColumnType("uniqueidentifier"); - - b.Property("LinkType") - .HasColumnType("int"); - - b.Property("PinterestImageUrl") - .HasColumnType("nvarchar(max)"); - - b.Property("PinterestUrl") - .HasColumnType("nvarchar(max)"); - - b.Property("ReviewDate") - .HasColumnType("datetime2"); - - b.Property("ReviewDesc") - .HasColumnType("nvarchar(max)"); - - b.Property("ReviewResult") - .HasColumnType("int"); - - b.Property("ReviewerId") - .HasColumnType("uniqueidentifier"); - - b.Property("SuggestedById") - .HasColumnType("uniqueidentifier"); - - b.Property("SuggestionDate") - .HasColumnType("datetime2"); - - b.Property("Synchronized") - .HasColumnType("bit"); - - b.HasKey("Id"); - - b.HasIndex("ArtifactId"); - - b.HasIndex("ItemId"); - - b.HasIndex("ReviewerId"); - - b.HasIndex("SuggestedById"); - - b.ToTable("PinterestLinks"); - }); - - modelBuilder.Entity("RMuseum.Models.ImportJob.ImportJob", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("ArtifactId") - .HasColumnType("uniqueidentifier"); - - b.Property("EndTime") - .HasColumnType("datetime2"); - - b.Property("Exception") - .HasColumnType("nvarchar(max)"); - - b.Property("FriendlyUrl") - .HasColumnType("nvarchar(max)"); - - b.Property("JobType") - .HasColumnType("int"); - - b.Property("ProgressPercent") - .HasColumnType("decimal(18,2)"); - - b.Property("QueueTime") - .HasColumnType("datetime2"); - - b.Property("ResourceNumber") - .HasColumnType("nvarchar(max)"); - - b.Property("SrcContent") - .HasColumnType("nvarchar(max)"); - - b.Property("SrcUrl") - .HasColumnType("nvarchar(max)"); - - b.Property("StartTime") - .HasColumnType("datetime2"); - - b.Property("Status") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("ArtifactId"); - - b.ToTable("ImportJobs"); - }); - - modelBuilder.Entity("RMuseum.Models.Note.RUserNote", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("DateTime") - .HasColumnType("datetime2"); - - b.Property("HtmlContent") - .HasColumnType("nvarchar(max)"); - - b.Property("LastModified") - .HasColumnType("datetime2"); - - b.Property("Modified") - .HasColumnType("bit"); - - b.Property("NoteType") - .HasColumnType("int"); - - b.Property("RAppUserId") - .HasColumnType("uniqueidentifier"); - - b.Property("RArtifactItemRecordId") - .HasColumnType("uniqueidentifier"); - - b.Property("RArtifactMasterRecordId") - .HasColumnType("uniqueidentifier"); - - b.Property("ReferenceNoteId") - .HasColumnType("uniqueidentifier"); - - b.Property("Status") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("RAppUserId"); - - b.HasIndex("RArtifactItemRecordId"); - - b.HasIndex("RArtifactMasterRecordId"); - - b.HasIndex("ReferenceNoteId"); - - b.ToTable("UserNotes"); - }); - - modelBuilder.Entity("RMuseum.Models.Notification.RUserNotification", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("DateTime") - .HasColumnType("datetime2"); - - b.Property("HtmlText") - .HasColumnType("nvarchar(max)"); - - b.Property("Status") - .HasColumnType("int"); - - b.Property("Subject") - .HasColumnType("nvarchar(max)"); - - b.Property("UserId") - .HasColumnType("uniqueidentifier"); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("Notifications"); - }); - - modelBuilder.Entity("RMuseum.Models.UploadSession.UploadSession", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("ProcessEndTime") - .HasColumnType("datetime2"); - - b.Property("ProcessProgress") - .HasColumnType("int"); - - b.Property("ProcessStartTime") - .HasColumnType("datetime2"); - - b.Property("SessionType") - .HasColumnType("int"); - - b.Property("Status") - .HasColumnType("int"); - - b.Property("UploadEndTime") - .HasColumnType("datetime2"); - - b.Property("UploadStartTime") - .HasColumnType("datetime2"); - - b.Property("UseId") - .HasColumnType("uniqueidentifier"); - - b.Property("UserId") - .HasColumnType("uniqueidentifier"); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("UploadSessions"); - }); - - modelBuilder.Entity("RMuseum.Models.UploadSession.UploadSessionFile", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("ContentDisposition") - .HasColumnType("nvarchar(max)"); - - b.Property("ContentType") - .HasColumnType("nvarchar(max)"); - - b.Property("FileName") - .HasColumnType("nvarchar(max)"); - - b.Property("FilePath") - .HasColumnType("nvarchar(max)"); - - b.Property("Length") - .HasColumnType("bigint"); - - b.Property("MP3FileCheckSum") - .HasColumnType("nvarchar(max)"); - - b.Property("Name") - .HasColumnType("nvarchar(max)"); - - b.Property("ProcessResult") - .HasColumnType("bit"); - - b.Property("ProcessResultMsg") - .HasColumnType("nvarchar(max)"); - - b.Property("UploadSessionId") - .HasColumnType("uniqueidentifier"); - - b.HasKey("Id"); - - b.HasIndex("UploadSessionId"); - - b.ToTable("UploadedFiles"); - }); - - modelBuilder.Entity("RSecurityBackend.Models.Audit.Db.REvent", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("Duration") - .HasColumnType("int"); - - b.Property("EndDate") - .HasColumnType("datetime2"); - - b.Property("EventType") - .HasColumnType("nvarchar(max)"); - - b.Property("IpAddress") - .HasColumnType("nvarchar(max)"); - - b.Property("JsonData") - .HasColumnType("nvarchar(max)"); - - b.Property("RequestUrl") - .HasColumnType("nvarchar(max)"); - - b.Property("ResponseStatusCode") - .HasColumnType("int"); - - b.Property("StartDate") - .HasColumnType("datetime2"); - - b.Property("UserName") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("AuditLogs"); - }); - - modelBuilder.Entity("RSecurityBackend.Models.Auth.Db.RAppRole", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .HasColumnType("nvarchar(max)"); - - b.Property("Description") - .HasColumnType("nvarchar(max)"); - - b.Property("Name") - .HasColumnType("nvarchar(256)") - .HasMaxLength(256); - - b.Property("NormalizedName") - .HasColumnType("nvarchar(256)") - .HasMaxLength(256); - - b.HasKey("Id"); - - b.HasIndex("NormalizedName") - .IsUnique() - .HasName("RoleNameIndex") - .HasFilter("[NormalizedName] IS NOT NULL"); - - b.ToTable("AspNetRoles"); - }); - - modelBuilder.Entity("RSecurityBackend.Models.Auth.Db.RAppUser", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("AccessFailedCount") - .HasColumnType("int"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .HasColumnType("nvarchar(max)"); - - b.Property("CreateDate") - .HasColumnType("datetime2"); - - b.Property("Email") - .HasColumnType("nvarchar(256)") - .HasMaxLength(256); - - b.Property("EmailConfirmed") - .HasColumnType("bit"); - - b.Property("FirstName") - .HasColumnType("nvarchar(max)"); - - b.Property("LockoutEnabled") - .HasColumnType("bit"); - - b.Property("LockoutEnd") - .HasColumnType("datetimeoffset"); - - b.Property("NormalizedEmail") - .HasColumnType("nvarchar(256)") - .HasMaxLength(256); - - b.Property("NormalizedUserName") - .HasColumnType("nvarchar(256)") - .HasMaxLength(256); - - b.Property("PasswordHash") - .HasColumnType("nvarchar(max)"); - - b.Property("PhoneNumber") - .HasColumnType("nvarchar(max)"); - - b.Property("PhoneNumberConfirmed") - .HasColumnType("bit"); - - b.Property("RImageId") - .HasColumnType("uniqueidentifier"); - - b.Property("SecurityStamp") - .HasColumnType("nvarchar(max)"); - - b.Property("Status") - .HasColumnType("int"); - - b.Property("SureName") - .HasColumnType("nvarchar(max)"); - - b.Property("TwoFactorEnabled") - .HasColumnType("bit"); - - b.Property("UserName") - .HasColumnType("nvarchar(256)") - .HasMaxLength(256); - - b.HasKey("Id"); - - b.HasIndex("NormalizedEmail") - .HasName("EmailIndex"); - - b.HasIndex("NormalizedUserName") - .IsUnique() - .HasName("UserNameIndex") - .HasFilter("[NormalizedUserName] IS NOT NULL"); - - b.HasIndex("RImageId"); - - b.ToTable("AspNetUsers"); - }); - - modelBuilder.Entity("RSecurityBackend.Models.Auth.Db.RCaptchaImage", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("DateTime") - .HasColumnType("datetime2"); - - b.Property("RImageId") - .HasColumnType("uniqueidentifier"); - - b.Property("Value") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.HasIndex("RImageId"); - - b.ToTable("CaptchaImages"); - }); - - modelBuilder.Entity("RSecurityBackend.Models.Auth.Db.RPermission", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("OperationShortName") - .HasColumnType("nvarchar(max)"); - - b.Property("RAppRoleId") - .HasColumnType("uniqueidentifier"); - - b.Property("SecurableItemShortName") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.HasIndex("RAppRoleId"); - - b.ToTable("Permissions"); - }); - - modelBuilder.Entity("RSecurityBackend.Models.Auth.Db.RTemporaryUserSession", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("ClientAppName") - .HasColumnType("nvarchar(max)"); - - b.Property("ClientIPAddress") - .HasColumnType("nvarchar(max)"); - - b.Property("Language") - .HasColumnType("nvarchar(max)"); - - b.Property("LastRenewal") - .HasColumnType("datetime2"); - - b.Property("LoginTime") - .HasColumnType("datetime2"); - - b.Property("RAppUserId") - .HasColumnType("uniqueidentifier"); - - b.Property("Token") - .HasColumnType("nvarchar(max)"); - - b.Property("ValidUntil") - .HasColumnType("datetime2"); - - b.HasKey("Id"); - - b.HasIndex("RAppUserId"); - - b.ToTable("Sessions"); - }); - - modelBuilder.Entity("RSecurityBackend.Models.Auth.Db.RVerifyQueueItem", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("ClientAppName") - .HasColumnType("nvarchar(max)"); - - b.Property("ClientIPAddress") - .HasColumnType("nvarchar(max)"); - - b.Property("DateTime") - .HasColumnType("datetime2"); - - b.Property("Email") - .HasColumnType("nvarchar(max)"); - - b.Property("Language") - .HasColumnType("nvarchar(max)"); - - b.Property("PhoneNumber") - .HasColumnType("nvarchar(max)"); - - b.Property("QueueType") - .HasColumnType("int"); - - b.Property("Secret") - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("Secret") - .IsUnique() - .HasFilter("[Secret] IS NOT NULL"); - - b.ToTable("VerifyQueueItems"); - }); - - modelBuilder.Entity("RSecurityBackend.Models.Image.RImage", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("ContentType") - .HasColumnType("nvarchar(max)"); - - b.Property("DataTime") - .HasColumnType("datetime2"); - - b.Property("Discriminator") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("FileSizeInBytes") - .HasColumnType("bigint"); - - b.Property("FolderName") - .HasColumnType("nvarchar(max)"); - - b.Property("ImageHeight") - .HasColumnType("int"); - - b.Property("ImageWidth") - .HasColumnType("int"); - - b.Property("LastModified") - .HasColumnType("datetime2"); - - b.Property("OriginalFileName") - .HasColumnType("nvarchar(max)"); - - b.Property("StoredFileName") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("GeneralImages"); - - b.HasDiscriminator("Discriminator").HasValue("RImage"); - }); - - modelBuilder.Entity("RMuseum.Models.Artifact.RPictureFile", b => - { - b.HasBaseType("RSecurityBackend.Models.Image.RImage"); - - b.Property("Description") - .HasColumnType("nvarchar(max)"); - - b.Property("DescriptionInEnglish") - .HasColumnType("nvarchar(max)"); - - b.Property("LastModifiedMeta") - .HasColumnType("datetime2"); - - b.Property("NormalSizeImageHeight") - .HasColumnType("int"); - - b.Property("NormalSizeImageStoredFileName") - .HasColumnType("nvarchar(max)"); - - b.Property("NormalSizeImageWidth") - .HasColumnType("int"); - - b.Property("Order") - .HasColumnType("int"); - - b.Property("RArtifactItemRecordId") - .HasColumnType("uniqueidentifier"); - - b.Property("SrcUrl") - .HasColumnType("nvarchar(max)"); - - b.Property("Status") - .HasColumnType("int"); - - b.Property("ThumbnailImageHeight") - .HasColumnType("int"); - - b.Property("ThumbnailImageStoredFileName") - .HasColumnType("nvarchar(max)"); - - b.Property("ThumbnailImageWidth") - .HasColumnType("int"); - - b.Property("Title") - .HasColumnType("nvarchar(max)"); - - b.Property("TitleInEnglish") - .HasColumnType("nvarchar(max)"); - - b.HasIndex("RArtifactItemRecordId"); - - b.HasDiscriminator().HasValue("RPictureFile"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => - { - b.HasOne("RSecurityBackend.Models.Auth.Db.RAppRole", null) - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => - { - b.HasOne("RSecurityBackend.Models.Auth.Db.RAppUser", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => - { - b.HasOne("RSecurityBackend.Models.Auth.Db.RAppUser", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => - { - b.HasOne("RSecurityBackend.Models.Auth.Db.RAppRole", null) - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("RSecurityBackend.Models.Auth.Db.RAppUser", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.HasOne("RSecurityBackend.Models.Auth.Db.RAppUser", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("RMuseum.Models.Artifact.RArtifactItemRecord", b => - { - b.HasOne("RMuseum.Models.Artifact.RArtifactMasterRecord", null) - .WithMany("Items") - .HasForeignKey("RArtifactMasterRecordId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("RMuseum.Models.Artifact.RArtifactMasterRecord", b => - { - b.HasOne("RMuseum.Models.Artifact.RPictureFile", "CoverImage") - .WithMany() - .HasForeignKey("CoverImageId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("RMuseum.Models.Artifact.RTagValue", b => - { - b.HasOne("RMuseum.Models.Artifact.RArtifactItemRecord", null) - .WithMany("Tags") - .HasForeignKey("RArtifactItemRecordId"); - - b.HasOne("RMuseum.Models.Artifact.RArtifactMasterRecord", null) - .WithMany("Tags") - .HasForeignKey("RArtifactMasterRecordId"); - - b.HasOne("RMuseum.Models.Artifact.RTag", "RTag") - .WithMany() - .HasForeignKey("RTagId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("RMuseum.Models.Bookmark.RUserBookmark", b => - { - b.HasOne("RSecurityBackend.Models.Auth.Db.RAppUser", "RAppUser") - .WithMany() - .HasForeignKey("RAppUserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("RMuseum.Models.Artifact.RArtifactItemRecord", "RArtifactItemRecord") - .WithMany() - .HasForeignKey("RArtifactItemRecordId"); - - b.HasOne("RMuseum.Models.Artifact.RArtifactMasterRecord", "RArtifactMasterRecord") - .WithMany() - .HasForeignKey("RArtifactMasterRecordId"); - }); - - modelBuilder.Entity("RMuseum.Models.Ganjoor.GanjoorCat", b => - { - b.HasOne("RMuseum.Models.Ganjoor.GanjoorCat", "Parent") - .WithMany() - .HasForeignKey("ParentId"); - - b.HasOne("RMuseum.Models.Ganjoor.GanjoorPoet", "Poet") - .WithMany() - .HasForeignKey("PoetId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("RMuseum.Models.Ganjoor.GanjoorPoem", b => - { - b.HasOne("RMuseum.Models.Ganjoor.GanjoorCat", "Cat") - .WithMany() - .HasForeignKey("CatId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("RMuseum.Models.Ganjoor.GanjoorVerse", b => - { - b.HasOne("RMuseum.Models.Ganjoor.GanjoorPoem", "Poem") - .WithMany() - .HasForeignKey("PoemId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("RMuseum.Models.GanjoorAudio.PoemNarration", b => - { - b.HasOne("RSecurityBackend.Models.Auth.Db.RAppUser", "Owner") - .WithMany() - .HasForeignKey("OwnerId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("RSecurityBackend.Models.Auth.Db.RAppUser", "Reviewer") - .WithMany() - .HasForeignKey("ReviewerId"); - }); - - modelBuilder.Entity("RMuseum.Models.GanjoorAudio.UserNarrationProfile", b => - { - b.HasOne("RSecurityBackend.Models.Auth.Db.RAppUser", "User") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("RMuseum.Models.GanjoorIntegration.GanjoorLink", b => - { - b.HasOne("RMuseum.Models.Artifact.RArtifactMasterRecord", "Artifact") - .WithMany() - .HasForeignKey("ArtifactId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("RMuseum.Models.Artifact.RArtifactItemRecord", "Item") - .WithMany() - .HasForeignKey("ItemId"); - - b.HasOne("RSecurityBackend.Models.Auth.Db.RAppUser", "Reviewer") - .WithMany() - .HasForeignKey("ReviewerId"); - - b.HasOne("RSecurityBackend.Models.Auth.Db.RAppUser", "SuggestedBy") - .WithMany() - .HasForeignKey("SuggestedById") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("RMuseum.Models.GanjoorIntegration.PinterestLink", b => - { - b.HasOne("RMuseum.Models.Artifact.RArtifactMasterRecord", "Artifact") - .WithMany() - .HasForeignKey("ArtifactId"); - - b.HasOne("RMuseum.Models.Artifact.RArtifactItemRecord", "Item") - .WithMany() - .HasForeignKey("ItemId"); - - b.HasOne("RSecurityBackend.Models.Auth.Db.RAppUser", "Reviewer") - .WithMany() - .HasForeignKey("ReviewerId"); - - b.HasOne("RSecurityBackend.Models.Auth.Db.RAppUser", "SuggestedBy") - .WithMany() - .HasForeignKey("SuggestedById"); - }); - - modelBuilder.Entity("RMuseum.Models.ImportJob.ImportJob", b => - { - b.HasOne("RMuseum.Models.Artifact.RArtifactMasterRecord", "Artifact") - .WithMany() - .HasForeignKey("ArtifactId"); - }); - - modelBuilder.Entity("RMuseum.Models.Note.RUserNote", b => - { - b.HasOne("RSecurityBackend.Models.Auth.Db.RAppUser", "RAppUser") - .WithMany() - .HasForeignKey("RAppUserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("RMuseum.Models.Artifact.RArtifactItemRecord", "RArtifactItemRecord") - .WithMany() - .HasForeignKey("RArtifactItemRecordId"); - - b.HasOne("RMuseum.Models.Artifact.RArtifactMasterRecord", "RArtifactMasterRecord") - .WithMany() - .HasForeignKey("RArtifactMasterRecordId"); - - b.HasOne("RMuseum.Models.Note.RUserNote", "ReferenceNote") - .WithMany() - .HasForeignKey("ReferenceNoteId"); - }); - - modelBuilder.Entity("RMuseum.Models.Notification.RUserNotification", b => - { - b.HasOne("RSecurityBackend.Models.Auth.Db.RAppUser", "User") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("RMuseum.Models.UploadSession.UploadSession", b => - { - b.HasOne("RSecurityBackend.Models.Auth.Db.RAppUser", "User") - .WithMany() - .HasForeignKey("UserId"); - }); - - modelBuilder.Entity("RMuseum.Models.UploadSession.UploadSessionFile", b => - { - b.HasOne("RMuseum.Models.UploadSession.UploadSession", null) - .WithMany("UploadedFiles") - .HasForeignKey("UploadSessionId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("RSecurityBackend.Models.Auth.Db.RAppUser", b => - { - b.HasOne("RSecurityBackend.Models.Image.RImage", "RImage") - .WithMany() - .HasForeignKey("RImageId"); - }); - - modelBuilder.Entity("RSecurityBackend.Models.Auth.Db.RCaptchaImage", b => - { - b.HasOne("RSecurityBackend.Models.Image.RImage", "RImage") - .WithMany() - .HasForeignKey("RImageId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("RSecurityBackend.Models.Auth.Db.RPermission", b => - { - b.HasOne("RSecurityBackend.Models.Auth.Db.RAppRole", null) - .WithMany("Permissions") - .HasForeignKey("RAppRoleId"); - }); - - modelBuilder.Entity("RSecurityBackend.Models.Auth.Db.RTemporaryUserSession", b => - { - b.HasOne("RSecurityBackend.Models.Auth.Db.RAppUser", "RAppUser") - .WithMany() - .HasForeignKey("RAppUserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("RMuseum.Models.Artifact.RPictureFile", b => - { - b.HasOne("RMuseum.Models.Artifact.RArtifactItemRecord", null) - .WithMany("Images") - .HasForeignKey("RArtifactItemRecordId"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/RMuseum/Migrations/20201106113129_PoemNarrationUploadDateIndex.cs b/RMuseum/Migrations/20201106113129_PoemNarrationUploadDateIndex.cs deleted file mode 100644 index e018adbf..00000000 --- a/RMuseum/Migrations/20201106113129_PoemNarrationUploadDateIndex.cs +++ /dev/null @@ -1,22 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -namespace RMuseum.Migrations -{ - public partial class PoemNarrationUploadDateIndex : Migration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.CreateIndex( - name: "IX_AudioFiles_UploadDate", - table: "AudioFiles", - column: "UploadDate"); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropIndex( - name: "IX_AudioFiles_UploadDate", - table: "AudioFiles"); - } - } -} diff --git a/RMuseum/Migrations/20201113112838_NarrationPublishingTrackers.cs b/RMuseum/Migrations/20201113112838_NarrationPublishingTrackers.cs deleted file mode 100644 index 270552c9..00000000 --- a/RMuseum/Migrations/20201113112838_NarrationPublishingTrackers.cs +++ /dev/null @@ -1,48 +0,0 @@ -using System; -using Microsoft.EntityFrameworkCore.Migrations; - -namespace RMuseum.Migrations -{ - public partial class NarrationPublishingTrackers : Migration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.CreateTable( - name: "NarrationPublishingTrackers", - columns: table => new - { - Id = table.Column(nullable: false), - PoemNarrationId = table.Column(nullable: false), - StartDate = table.Column(nullable: false), - XmlFileCopied = table.Column(nullable: false), - Mp3FileCopied = table.Column(nullable: false), - FirstDbUpdated = table.Column(nullable: false), - SecondDbUpdated = table.Column(nullable: false), - Finished = table.Column(nullable: false), - FinishDate = table.Column(nullable: false), - LastException = table.Column(nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_NarrationPublishingTrackers", x => x.Id); - table.ForeignKey( - name: "FK_NarrationPublishingTrackers_AudioFiles_PoemNarrationId", - column: x => x.PoemNarrationId, - principalTable: "AudioFiles", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateIndex( - name: "IX_NarrationPublishingTrackers_PoemNarrationId", - table: "NarrationPublishingTrackers", - column: "PoemNarrationId"); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "NarrationPublishingTrackers"); - } - } -} diff --git a/RMuseum/Migrations/20201113112838_NarrationPublishingTrackers.Designer.cs b/RMuseum/Migrations/20201116132909_Recitations.Designer.cs similarity index 98% rename from RMuseum/Migrations/20201113112838_NarrationPublishingTrackers.Designer.cs rename to RMuseum/Migrations/20201116132909_Recitations.Designer.cs index 7503f1a7..b579e5bf 100644 --- a/RMuseum/Migrations/20201113112838_NarrationPublishingTrackers.Designer.cs +++ b/RMuseum/Migrations/20201116132909_Recitations.Designer.cs @@ -10,8 +10,8 @@ using RMuseum.DbContext; namespace RMuseum.Migrations { [DbContext(typeof(RMuseumDbContext))] - [Migration("20201113112838_NarrationPublishingTrackers")] - partial class NarrationPublishingTrackers + [Migration("20201116132909_Recitations")] + partial class Recitations { protected override void BuildTargetModel(ModelBuilder modelBuilder) { @@ -440,47 +440,7 @@ namespace RMuseum.Migrations b.ToTable("GanjoorVerses"); }); - modelBuilder.Entity("RMuseum.Models.GanjoorAudio.NarrationPublishingTracker", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("FinishDate") - .HasColumnType("datetime2"); - - b.Property("Finished") - .HasColumnType("bit"); - - b.Property("FirstDbUpdated") - .HasColumnType("bit"); - - b.Property("LastException") - .HasColumnType("nvarchar(max)"); - - b.Property("Mp3FileCopied") - .HasColumnType("bit"); - - b.Property("PoemNarrationId") - .HasColumnType("int"); - - b.Property("SecondDbUpdated") - .HasColumnType("bit"); - - b.Property("StartDate") - .HasColumnType("datetime2"); - - b.Property("XmlFileCopied") - .HasColumnType("bit"); - - b.HasKey("Id"); - - b.HasIndex("PoemNarrationId"); - - b.ToTable("NarrationPublishingTrackers"); - }); - - modelBuilder.Entity("RMuseum.Models.GanjoorAudio.PoemNarration", b => + modelBuilder.Entity("RMuseum.Models.GanjoorAudio.Recitation", b => { b.Property("Id") .ValueGeneratedOnAdd() @@ -567,12 +527,50 @@ namespace RMuseum.Migrations b.HasIndex("ReviewerId"); - b.HasIndex("UploadDate"); - - b.ToTable("AudioFiles"); + b.ToTable("Recitations"); }); - modelBuilder.Entity("RMuseum.Models.GanjoorAudio.UserNarrationProfile", b => + modelBuilder.Entity("RMuseum.Models.GanjoorAudio.RecitationPublishingTracker", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("FinishDate") + .HasColumnType("datetime2"); + + b.Property("Finished") + .HasColumnType("bit"); + + b.Property("FirstDbUpdated") + .HasColumnType("bit"); + + b.Property("LastException") + .HasColumnType("nvarchar(max)"); + + b.Property("Mp3FileCopied") + .HasColumnType("bit"); + + b.Property("PoemNarrationId") + .HasColumnType("int"); + + b.Property("SecondDbUpdated") + .HasColumnType("bit"); + + b.Property("StartDate") + .HasColumnType("datetime2"); + + b.Property("XmlFileCopied") + .HasColumnType("bit"); + + b.HasKey("Id"); + + b.HasIndex("PoemNarrationId"); + + b.ToTable("RecitationPublishingTrackers"); + }); + + modelBuilder.Entity("RMuseum.Models.GanjoorAudio.UserRecitationProfile", b => { b.Property("Id") .ValueGeneratedOnAdd() @@ -606,7 +604,7 @@ namespace RMuseum.Migrations b.HasIndex("UserId"); - b.ToTable("UserNarrationProfiles"); + b.ToTable("UserRecitationProfiles"); }); modelBuilder.Entity("RMuseum.Models.GanjoorIntegration.GanjoorLink", b => @@ -1441,16 +1439,7 @@ namespace RMuseum.Migrations .IsRequired(); }); - modelBuilder.Entity("RMuseum.Models.GanjoorAudio.NarrationPublishingTracker", b => - { - b.HasOne("RMuseum.Models.GanjoorAudio.PoemNarration", "PoemNarration") - .WithMany() - .HasForeignKey("PoemNarrationId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("RMuseum.Models.GanjoorAudio.PoemNarration", b => + modelBuilder.Entity("RMuseum.Models.GanjoorAudio.Recitation", b => { b.HasOne("RSecurityBackend.Models.Auth.Db.RAppUser", "Owner") .WithMany() @@ -1463,7 +1452,16 @@ namespace RMuseum.Migrations .HasForeignKey("ReviewerId"); }); - modelBuilder.Entity("RMuseum.Models.GanjoorAudio.UserNarrationProfile", b => + modelBuilder.Entity("RMuseum.Models.GanjoorAudio.RecitationPublishingTracker", b => + { + b.HasOne("RMuseum.Models.GanjoorAudio.Recitation", "PoemNarration") + .WithMany() + .HasForeignKey("PoemNarrationId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("RMuseum.Models.GanjoorAudio.UserRecitationProfile", b => { b.HasOne("RSecurityBackend.Models.Auth.Db.RAppUser", "User") .WithMany() diff --git a/RMuseum/Migrations/20201106070554_AudioNarrations.cs b/RMuseum/Migrations/20201116132909_Recitations.cs similarity index 82% rename from RMuseum/Migrations/20201106070554_AudioNarrations.cs rename to RMuseum/Migrations/20201116132909_Recitations.cs index aeb8ab1c..9455a0f5 100644 --- a/RMuseum/Migrations/20201106070554_AudioNarrations.cs +++ b/RMuseum/Migrations/20201116132909_Recitations.cs @@ -3,12 +3,25 @@ using Microsoft.EntityFrameworkCore.Migrations; namespace RMuseum.Migrations { - public partial class AudioNarrations : Migration + public partial class Recitations : Migration { protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.CreateTable( - name: "AudioFiles", + name: "GanjoorPoets", + columns: table => new + { + Id = table.Column(nullable: false), + Name = table.Column(nullable: true), + Description = table.Column(nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_GanjoorPoets", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Recitations", columns: table => new { Id = table.Column(nullable: false) @@ -40,34 +53,21 @@ namespace RMuseum.Migrations }, constraints: table => { - table.PrimaryKey("PK_AudioFiles", x => x.Id); + table.PrimaryKey("PK_Recitations", x => x.Id); table.ForeignKey( - name: "FK_AudioFiles_AspNetUsers_OwnerId", + name: "FK_Recitations_AspNetUsers_OwnerId", column: x => x.OwnerId, principalTable: "AspNetUsers", principalColumn: "Id", onDelete: ReferentialAction.Cascade); table.ForeignKey( - name: "FK_AudioFiles_AspNetUsers_ReviewerId", + name: "FK_Recitations_AspNetUsers_ReviewerId", column: x => x.ReviewerId, principalTable: "AspNetUsers", principalColumn: "Id", onDelete: ReferentialAction.Restrict); }); - migrationBuilder.CreateTable( - name: "GanjoorPoets", - columns: table => new - { - Id = table.Column(nullable: false), - Name = table.Column(nullable: true), - Description = table.Column(nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_GanjoorPoets", x => x.Id); - }); - migrationBuilder.CreateTable( name: "UploadSessions", columns: table => new @@ -95,7 +95,7 @@ namespace RMuseum.Migrations }); migrationBuilder.CreateTable( - name: "UserNarrationProfiles", + name: "UserRecitationProfiles", columns: table => new { Id = table.Column(nullable: false), @@ -110,9 +110,9 @@ namespace RMuseum.Migrations }, constraints: table => { - table.PrimaryKey("PK_UserNarrationProfiles", x => x.Id); + table.PrimaryKey("PK_UserRecitationProfiles", x => x.Id); table.ForeignKey( - name: "FK_UserNarrationProfiles_AspNetUsers_UserId", + name: "FK_UserRecitationProfiles_AspNetUsers_UserId", column: x => x.UserId, principalTable: "AspNetUsers", principalColumn: "Id", @@ -147,6 +147,32 @@ namespace RMuseum.Migrations onDelete: ReferentialAction.Cascade); }); + migrationBuilder.CreateTable( + name: "RecitationPublishingTrackers", + columns: table => new + { + Id = table.Column(nullable: false), + PoemNarrationId = table.Column(nullable: false), + StartDate = table.Column(nullable: false), + XmlFileCopied = table.Column(nullable: false), + Mp3FileCopied = table.Column(nullable: false), + FirstDbUpdated = table.Column(nullable: false), + SecondDbUpdated = table.Column(nullable: false), + Finished = table.Column(nullable: false), + FinishDate = table.Column(nullable: false), + LastException = table.Column(nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_RecitationPublishingTrackers", x => x.Id); + table.ForeignKey( + name: "FK_RecitationPublishingTrackers_Recitations_PoemNarrationId", + column: x => x.PoemNarrationId, + principalTable: "Recitations", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + migrationBuilder.CreateTable( name: "UploadedFiles", columns: table => new @@ -218,21 +244,6 @@ namespace RMuseum.Migrations onDelete: ReferentialAction.Cascade); }); - migrationBuilder.CreateIndex( - name: "IX_AudioFiles_GanjoorPostId", - table: "AudioFiles", - column: "GanjoorPostId"); - - migrationBuilder.CreateIndex( - name: "IX_AudioFiles_OwnerId", - table: "AudioFiles", - column: "OwnerId"); - - migrationBuilder.CreateIndex( - name: "IX_AudioFiles_ReviewerId", - table: "AudioFiles", - column: "ReviewerId"); - migrationBuilder.CreateIndex( name: "IX_GanjoorCategories_FullUrl", table: "GanjoorCategories", @@ -263,6 +274,26 @@ namespace RMuseum.Migrations table: "GanjoorVerses", column: "PoemId"); + migrationBuilder.CreateIndex( + name: "IX_RecitationPublishingTrackers_PoemNarrationId", + table: "RecitationPublishingTrackers", + column: "PoemNarrationId"); + + migrationBuilder.CreateIndex( + name: "IX_Recitations_GanjoorPostId", + table: "Recitations", + column: "GanjoorPostId"); + + migrationBuilder.CreateIndex( + name: "IX_Recitations_OwnerId", + table: "Recitations", + column: "OwnerId"); + + migrationBuilder.CreateIndex( + name: "IX_Recitations_ReviewerId", + table: "Recitations", + column: "ReviewerId"); + migrationBuilder.CreateIndex( name: "IX_UploadedFiles_UploadSessionId", table: "UploadedFiles", @@ -274,28 +305,31 @@ namespace RMuseum.Migrations column: "UserId"); migrationBuilder.CreateIndex( - name: "IX_UserNarrationProfiles_UserId", - table: "UserNarrationProfiles", + name: "IX_UserRecitationProfiles_UserId", + table: "UserRecitationProfiles", column: "UserId"); } protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( - name: "AudioFiles"); + name: "GanjoorVerses"); migrationBuilder.DropTable( - name: "GanjoorVerses"); + name: "RecitationPublishingTrackers"); migrationBuilder.DropTable( name: "UploadedFiles"); migrationBuilder.DropTable( - name: "UserNarrationProfiles"); + name: "UserRecitationProfiles"); migrationBuilder.DropTable( name: "GanjoorPoems"); + migrationBuilder.DropTable( + name: "Recitations"); + migrationBuilder.DropTable( name: "UploadSessions"); diff --git a/RMuseum/Migrations/RMuseumDbContextModelSnapshot.cs b/RMuseum/Migrations/RMuseumDbContextModelSnapshot.cs index ed2f1446..fd0039ec 100644 --- a/RMuseum/Migrations/RMuseumDbContextModelSnapshot.cs +++ b/RMuseum/Migrations/RMuseumDbContextModelSnapshot.cs @@ -438,47 +438,7 @@ namespace RMuseum.Migrations b.ToTable("GanjoorVerses"); }); - modelBuilder.Entity("RMuseum.Models.GanjoorAudio.NarrationPublishingTracker", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("FinishDate") - .HasColumnType("datetime2"); - - b.Property("Finished") - .HasColumnType("bit"); - - b.Property("FirstDbUpdated") - .HasColumnType("bit"); - - b.Property("LastException") - .HasColumnType("nvarchar(max)"); - - b.Property("Mp3FileCopied") - .HasColumnType("bit"); - - b.Property("PoemNarrationId") - .HasColumnType("int"); - - b.Property("SecondDbUpdated") - .HasColumnType("bit"); - - b.Property("StartDate") - .HasColumnType("datetime2"); - - b.Property("XmlFileCopied") - .HasColumnType("bit"); - - b.HasKey("Id"); - - b.HasIndex("PoemNarrationId"); - - b.ToTable("NarrationPublishingTrackers"); - }); - - modelBuilder.Entity("RMuseum.Models.GanjoorAudio.PoemNarration", b => + modelBuilder.Entity("RMuseum.Models.GanjoorAudio.Recitation", b => { b.Property("Id") .ValueGeneratedOnAdd() @@ -565,12 +525,50 @@ namespace RMuseum.Migrations b.HasIndex("ReviewerId"); - b.HasIndex("UploadDate"); - - b.ToTable("AudioFiles"); + b.ToTable("Recitations"); }); - modelBuilder.Entity("RMuseum.Models.GanjoorAudio.UserNarrationProfile", b => + modelBuilder.Entity("RMuseum.Models.GanjoorAudio.RecitationPublishingTracker", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("FinishDate") + .HasColumnType("datetime2"); + + b.Property("Finished") + .HasColumnType("bit"); + + b.Property("FirstDbUpdated") + .HasColumnType("bit"); + + b.Property("LastException") + .HasColumnType("nvarchar(max)"); + + b.Property("Mp3FileCopied") + .HasColumnType("bit"); + + b.Property("PoemNarrationId") + .HasColumnType("int"); + + b.Property("SecondDbUpdated") + .HasColumnType("bit"); + + b.Property("StartDate") + .HasColumnType("datetime2"); + + b.Property("XmlFileCopied") + .HasColumnType("bit"); + + b.HasKey("Id"); + + b.HasIndex("PoemNarrationId"); + + b.ToTable("RecitationPublishingTrackers"); + }); + + modelBuilder.Entity("RMuseum.Models.GanjoorAudio.UserRecitationProfile", b => { b.Property("Id") .ValueGeneratedOnAdd() @@ -604,7 +602,7 @@ namespace RMuseum.Migrations b.HasIndex("UserId"); - b.ToTable("UserNarrationProfiles"); + b.ToTable("UserRecitationProfiles"); }); modelBuilder.Entity("RMuseum.Models.GanjoorIntegration.GanjoorLink", b => @@ -1439,16 +1437,7 @@ namespace RMuseum.Migrations .IsRequired(); }); - modelBuilder.Entity("RMuseum.Models.GanjoorAudio.NarrationPublishingTracker", b => - { - b.HasOne("RMuseum.Models.GanjoorAudio.PoemNarration", "PoemNarration") - .WithMany() - .HasForeignKey("PoemNarrationId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("RMuseum.Models.GanjoorAudio.PoemNarration", b => + modelBuilder.Entity("RMuseum.Models.GanjoorAudio.Recitation", b => { b.HasOne("RSecurityBackend.Models.Auth.Db.RAppUser", "Owner") .WithMany() @@ -1461,7 +1450,16 @@ namespace RMuseum.Migrations .HasForeignKey("ReviewerId"); }); - modelBuilder.Entity("RMuseum.Models.GanjoorAudio.UserNarrationProfile", b => + modelBuilder.Entity("RMuseum.Models.GanjoorAudio.RecitationPublishingTracker", b => + { + b.HasOne("RMuseum.Models.GanjoorAudio.Recitation", "PoemNarration") + .WithMany() + .HasForeignKey("PoemNarrationId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("RMuseum.Models.GanjoorAudio.UserRecitationProfile", b => { b.HasOne("RSecurityBackend.Models.Auth.Db.RAppUser", "User") .WithMany() diff --git a/RMuseum/Models/GanjoorAudio/PoemNarration.cs b/RMuseum/Models/GanjoorAudio/Recitation.cs similarity index 99% rename from RMuseum/Models/GanjoorAudio/PoemNarration.cs rename to RMuseum/Models/GanjoorAudio/Recitation.cs index d73b08d6..58f13336 100644 --- a/RMuseum/Models/GanjoorAudio/PoemNarration.cs +++ b/RMuseum/Models/GanjoorAudio/Recitation.cs @@ -7,7 +7,7 @@ namespace RMuseum.Models.GanjoorAudio /// /// Poem Narration /// - public class PoemNarration + public class Recitation { /// /// Id diff --git a/RMuseum/Models/GanjoorAudio/NarrationPublishingTracker.cs b/RMuseum/Models/GanjoorAudio/RecitationPublishingTracker.cs similarity index 93% rename from RMuseum/Models/GanjoorAudio/NarrationPublishingTracker.cs rename to RMuseum/Models/GanjoorAudio/RecitationPublishingTracker.cs index b230e930..a2819410 100644 --- a/RMuseum/Models/GanjoorAudio/NarrationPublishingTracker.cs +++ b/RMuseum/Models/GanjoorAudio/RecitationPublishingTracker.cs @@ -5,7 +5,7 @@ namespace RMuseum.Models.GanjoorAudio /// /// Narration Publishing Tracker /// - public class NarrationPublishingTracker + public class RecitationPublishingTracker { /// /// Id @@ -20,7 +20,7 @@ namespace RMuseum.Models.GanjoorAudio /// /// Poem Narration /// - public PoemNarration PoemNarration { get; set; } + public Recitation PoemNarration { get; set; } /// /// Start Date diff --git a/RMuseum/Models/GanjoorAudio/UserNarrationProfile.cs b/RMuseum/Models/GanjoorAudio/UserRecitationProfile.cs similarity index 97% rename from RMuseum/Models/GanjoorAudio/UserNarrationProfile.cs rename to RMuseum/Models/GanjoorAudio/UserRecitationProfile.cs index 33dcb880..81930dd1 100644 --- a/RMuseum/Models/GanjoorAudio/UserNarrationProfile.cs +++ b/RMuseum/Models/GanjoorAudio/UserRecitationProfile.cs @@ -6,7 +6,7 @@ namespace RMuseum.Models.GanjoorAudio /// /// Narration Profiles for users /// - public class UserNarrationProfile + public class UserRecitationProfile { /// /// Id diff --git a/RMuseum/Models/GanjoorAudio/ViewModels/PoemNarrationModerateViewModel.cs b/RMuseum/Models/GanjoorAudio/ViewModels/RecitationModerateViewModel.cs similarity index 94% rename from RMuseum/Models/GanjoorAudio/ViewModels/PoemNarrationModerateViewModel.cs rename to RMuseum/Models/GanjoorAudio/ViewModels/RecitationModerateViewModel.cs index fc175969..d081d4a2 100644 --- a/RMuseum/Models/GanjoorAudio/ViewModels/PoemNarrationModerateViewModel.cs +++ b/RMuseum/Models/GanjoorAudio/ViewModels/RecitationModerateViewModel.cs @@ -22,7 +22,7 @@ /// /// Poem Narration Moderation View Model /// - public class PoemNarrationModerateViewModel + public class RecitationModerateViewModel { /// /// Moderation Result diff --git a/RMuseum/Models/GanjoorAudio/ViewModels/NarrationVerseSync.cs b/RMuseum/Models/GanjoorAudio/ViewModels/RecitationVerseSync.cs similarity index 93% rename from RMuseum/Models/GanjoorAudio/ViewModels/NarrationVerseSync.cs rename to RMuseum/Models/GanjoorAudio/ViewModels/RecitationVerseSync.cs index f89413f7..6d2b555f 100644 --- a/RMuseum/Models/GanjoorAudio/ViewModels/NarrationVerseSync.cs +++ b/RMuseum/Models/GanjoorAudio/ViewModels/RecitationVerseSync.cs @@ -3,7 +3,7 @@ /// /// Verse Sync Range /// - public class NarrationVerseSync + public class RecitationVerseSync { /// /// Verse Order diff --git a/RMuseum/Models/GanjoorAudio/ViewModels/PoemNarrationViewModel.cs b/RMuseum/Models/GanjoorAudio/ViewModels/RecitationViewModel.cs similarity index 97% rename from RMuseum/Models/GanjoorAudio/ViewModels/PoemNarrationViewModel.cs rename to RMuseum/Models/GanjoorAudio/ViewModels/RecitationViewModel.cs index c28b737a..0423fb7f 100644 --- a/RMuseum/Models/GanjoorAudio/ViewModels/PoemNarrationViewModel.cs +++ b/RMuseum/Models/GanjoorAudio/ViewModels/RecitationViewModel.cs @@ -9,12 +9,12 @@ namespace RMuseum.Models.GanjoorAudio.ViewModels /// /// Poem Narration view model /// - public class PoemNarrationViewModel + public class RecitationViewModel { /// /// parameterless constructor for deserialization support /// - public PoemNarrationViewModel() + public RecitationViewModel() { } @@ -24,7 +24,7 @@ namespace RMuseum.Models.GanjoorAudio.ViewModels /// /// /// - public PoemNarrationViewModel(PoemNarration src, RAppUser owner, GanjoorPoem poem) + public RecitationViewModel(Recitation src, RAppUser owner, GanjoorPoem poem) { Id = src.Id; Owner = new PublicRAppUser(owner); diff --git a/RMuseum/Models/GanjoorAudio/ViewModels/UserNarrationProfileViewModel.cs b/RMuseum/Models/GanjoorAudio/ViewModels/UserRecitationProfileViewModel.cs similarity index 93% rename from RMuseum/Models/GanjoorAudio/ViewModels/UserNarrationProfileViewModel.cs rename to RMuseum/Models/GanjoorAudio/ViewModels/UserRecitationProfileViewModel.cs index 97d99d98..ebeaafb2 100644 --- a/RMuseum/Models/GanjoorAudio/ViewModels/UserNarrationProfileViewModel.cs +++ b/RMuseum/Models/GanjoorAudio/ViewModels/UserRecitationProfileViewModel.cs @@ -6,12 +6,12 @@ namespace RMuseum.Models.GanjoorAudio.ViewModels /// /// UserNarrationProfile View Model /// - public class UserNarrationProfileViewModel + public class UserRecitationProfileViewModel { /// /// parameterless constructor /// - public UserNarrationProfileViewModel() + public UserRecitationProfileViewModel() { } @@ -19,7 +19,7 @@ namespace RMuseum.Models.GanjoorAudio.ViewModels /// constructor /// /// - public UserNarrationProfileViewModel(UserNarrationProfile src) + public UserRecitationProfileViewModel(UserRecitationProfile src) { Id = src.Id; User = src.User == null ? null : new PublicRAppUser(src.User); diff --git a/RMuseum/RMuseum.xml b/RMuseum/RMuseum.xml index 7951b73c..d94f0edc 100644 --- a/RMuseum/RMuseum.xml +++ b/RMuseum/RMuseum.xml @@ -626,145 +626,6 @@ Notification Service - - - Gets audio narrations, user must have narration::moderate permission to be able to see all users narrations - - - default: false, user must have narration::moderate permission to be able to see all users narrations - default: -1, unfiltered - - - - - get the corresponding mp3 file for the narration - - - it could be protected (Authorized), but I guess I would have problems with available client components support, - so I preferred it to be anonymous, as it does not harm anybody I guess - - - - - - - get the corresponding xml file contemnts (xml) for the narration - - - it could be protected (Authorized), but I guess I would have problems with available client components support, - so I preferred it to be anonymous, as it does not harm anybody I guess - - - - - - - Gets Verse Sync Information - - narration id - - - - - updates narration metadata - - - - - reviewstatus cannot be set to Approved or Rejected using this method, use moderate method instead - only these set of fields are updatable: AudioTitle, AudioArtist, AudioArtistUrl, AudioSrc, AudioSrcUrl, ReviewStatus (Draft to Pending and vice versa and Approved/Rejected to Pending) - only narrator or a moderator can update the narration - - - - - - Moderate pending narration - - - - - - - - Get User Uploads - - - default: false, user must have narration::moderate permission to be able to see all users uploads - - - - - Narration Upload - - - - - - imports data from ganjoor MySql database - - - - - - retry publish unpublished narrations - - - - - - Get User Profiles - - - - - - Add a narration profile - - - - - - - Update a narration profile - - - - - - - Delete a narration profile - - - - - - - publishing tracker data - - TODO: Poem Narration Data is not purified yet (includes sensitive information), so it needs a very special permission - - - - - - - - constructor - - - - - - - Artifact Service - - - - - IUserPermissionChecker instance - - Audit Log Controller Base @@ -833,6 +694,145 @@ Artifact Service + + + Gets audio narrations, user must have narration::moderate permission to be able to see all users narrations + + + default: false, user must have narration::moderate permission to be able to see all users narrations + default: -1, unfiltered + + + + + get the corresponding mp3 file for the narration + + + it could be protected (Authorized), but I guess I would have problems with available client components support, + so I preferred it to be anonymous, as it does not harm anybody I guess + + + + + + + get the corresponding xml file contemnts (xml) for the narration + + + it could be protected (Authorized), but I guess I would have problems with available client components support, + so I preferred it to be anonymous, as it does not harm anybody I guess + + + + + + + Gets Verse Sync Information + + narration id + + + + + updates narration metadata + + + + + reviewstatus cannot be set to Approved or Rejected using this method, use moderate method instead + only these set of fields are updatable: AudioTitle, AudioArtist, AudioArtistUrl, AudioSrc, AudioSrcUrl, ReviewStatus (Draft to Pending and vice versa and Approved/Rejected to Pending) + only narrator or a moderator can update the narration + + + + + + Moderate pending narration + + + + + + + + Get User Uploads + + + default: false, user must have narration::moderate permission to be able to see all users uploads + + + + + Narration Upload + + + + + + imports data from ganjoor MySql database + + + + + + retry publish unpublished narrations + + + + + + Get User Profiles + + + + + + Add a narration profile + + + + + + + Update a narration profile + + + + + + + Delete a narration profile + + + + + + + publishing tracker data + + TODO: Poem Narration Data is not purified yet (includes sensitive information), so it needs a very special permission + + + + + + + + constructor + + + + + + + Artifact Service + + + + + IUserPermissionChecker instance + + Generic Image Provider @@ -938,7 +938,7 @@ Pinterest Links - + Ganjoor Audio Files @@ -953,9 +953,9 @@ Uploaded files - + - User Narration Profiles + User Recitation Profiles @@ -978,7 +978,7 @@ Ganjoor Verses - + Narration Publishing Tracker @@ -1777,87 +1777,27 @@ Item should be deleted - - - Narration Publishing Tracker - - - - - Id - - - - - Poem Narration Id - - - + Poem Narration - - - Start Date - - - - - XML File Copied - - - - - MP3 File Copied - - - - - First MySql DB Updated - - - - - Second DB Updated - - - - - Finished - - - - - Finish Date - - - - - Last Excecption - - - - - Poem Narration - - - + Id - + Owner User - + Owner User Id - + Final data is actually exported to a MySQL database which this auto increment field is its key @@ -1866,24 +1806,24 @@ but if we do this we lose the ability to drop and create without losing narration data - + Ganjoor Post Id - + This determines where an audio is displayed between a list of sounds related to a specfic poem - + Using this field content you would determine xml, mp3 and ogg file names - + - combining this with + .ext would preduce relative path of sound files on our file server the full path would become [HOMEPath] + '/i/' + this value + combining this with + .ext would preduce relative path of sound files on our file server the full path would become [HOMEPath] + '/i/' + this value "a2" @@ -1892,27 +1832,27 @@ We had previously used different pathes because when a directory became overcrowded our connection time would increase unbearably due to IRAN internet problems, so it is sensible to store it per record and not as a global option value - + MP3 File Path - + MP3 url - + OGG File Path - + OGG url - + This is also a legacy field @@ -1925,183 +1865,223 @@ https://github.com/ganjoor/ganjoor/blob/master/ganjoor/Audio%20Support/PoemAudioListProcessor.cs - + XML url - + Audio Title - + Audio Artist - + Audio Artist Url - + Audio Source - + Audio Src Url - + Legacy Audio Guid - + Audio File CheckSum - + mp3 size in bytes - + ogg size in bytes - + Upload Date - + File Last Updated - + Review Date (Approve or Reject) - + MP3 File local path on Windows Server (if item is not rejected probably it is not valid and it is deleted) - + XML File local path on Windows Server (if item is not rejected probably it is not valid and it is deleted) - + Value is one or a combination of - + Review Status - + Reviewer user - + Reviewer user - + Review Message - + - Narration Profiles for users + Narration Publishing Tracker - + Id - + + + Poem Narration Id + + + + + Poem Narration + + + + + Start Date + + + + + XML File Copied + + + + + MP3 File Copied + + + + + First MySql DB Updated + + + + + Second DB Updated + + + + + Finished + + + + + Finish Date + + + + + Last Excecption + + + + + Narration Profiles for users + + + + + Id + + + User - + UserId - + Profile Name - + this would be appended to audio files names prefixed by a dash to make them unique and specfic to user filenames usually would look like {GanjoorPostId}-{FileSuffixWithoutDash}.{ext} for example 2200-hrm.xml - + artist name - + artist url - + audio src - + audio src url - + is default - - - Verse Sync Range - - - - - Verse Order - - - - - Verse Text - - - - - Audio Start in Milliseconds - - Moderation Result @@ -2122,32 +2102,52 @@ reject - + Poem Narration Moderation View Model - + Moderation Result - + Rejection Message - + + + Verse Sync Range + + + + + Verse Order + + + + + Verse Text + + + + + Audio Start in Milliseconds + + + Poem Narration view model - + parameterless constructor for deserialization support - + constructor @@ -2155,49 +2155,49 @@ - + Id - + Owner User - + Final data is actually exported to a MySQL database which this auto increment field is its key - + Ganjoor Post Id - + Poem Full Title - + Poem Full Url (without domain name) - + This determines where an audio is displayed between a list of sounds related to a specfic poem - + Using this field content you would determine xml, mp3 and ogg file names - + - combining this with + .ext would preduce relative path of sound files on our file server the full path would become [HOMEPath] + '/i/' + this value + combining this with + .ext would preduce relative path of sound files on our file server the full path would become [HOMEPath] + '/i/' + this value "a2" @@ -2206,27 +2206,27 @@ We had previously used different pathes because when a directory became overcrowded our connection time would increase unbearably due to IRAN internet problems, so it is sensible to store it per record and not as a global option value - + MP3 File Path - + MP3 url - + OGG File Path - + OGG url - + This is also a legacy field @@ -2239,108 +2239,108 @@ https://github.com/ganjoor/ganjoor/blob/master/ganjoor/Audio%20Support/PoemAudioListProcessor.cs - + XML url - + Audio Title - + Audio Artist - + Audio Artist Url - + Audio Source - + Audio Src Url - + Legacy Audio Guid - + Audio File CheckSum - + mp3 size in bytes - + ogg size in bytes - + Upload Date - + File Last Updated - + Review Date (Approve or Reject) - + MP3 File local path on Windows Server (if item is not rejected probably it is not valid and it is deleted) - + XML File local path on Windows Server (if item is not rejected probably it is not valid and it is deleted) - + Value is one or a combination of - + Review Status - + UserNarrationProfile View Model - + parameterless constructor - + constructor - + Id @@ -2348,7 +2348,7 @@ Do not fill it in POST api - + User @@ -2356,7 +2356,7 @@ Do not fill it in POST api - + UserId @@ -2364,39 +2364,39 @@ Do not fill it in POST api - + Profile Name - + this would be appended to audio files names prefixed by a dash to make them unique and specfic to user filenames usually would look like {GanjoorPostId}-{FileSuffixWithoutDash}.{ext} for example 2200-hrm.xml - + artist name - + artist url - + audio src - + audio src url - + is default @@ -4028,145 +4028,6 @@ - - - Audio Narration Service - - - - - returns list of narrations - - - send Guid.Empty if you want all narrations - - - - - - return selected narration information - - - - - - - Gets Verse Sync Range Information - - narration id - - - - - updates metadata for narration - - - - - - - - imports narration data from ganjoor MySql database - - User Id which becomes owner of imported data - - - - - build profiles from exisng narrations data - - User Id which becomes owner of imported data - error string if occurs - - - - Initiate New Upload Session for audio - - - - - - - Save uploaded file - - - - - - - finalize upload session (add files) - - - - - - - - Moderate pending narration - - - - - - - - - Get Upload Session (including files) - - - - - - - Get User Profiles - - - - - - - Add a narration profile - - - - - - - Update a narration profile - - - - - - - Delete a narration profile - - - - - - - - Get uploads descending by upload time - - - if userId is empty all user uploads would be returned - - - - - retry publish unpublished narrations - - - - - publishing tracker data - - - - - - Ganjoor Poems Content Privider Service @@ -4855,187 +4716,6 @@ - - - Audio Narration Service Implementation - - - - - returns list of narrations - - - send Guid.Empty if you want all narrations - - - - - - return selected narration information - - - - - - - Gets Verse Sync Range Information - - narration id - - - - - validate PoemNarrationViewModel - - - - - - - updates metadata for narration - - - - - - - - imports data from ganjoor MySql database - - User Id which becomes owner of imported data - - - - build profiles from exisng narrations data - - User Id which becomes owner of imported data - error string if occurs - - - - Initiate New Upload Session for audio - - - - - - - Save uploaded file - - - - - - - finalize upload session (add files) - - - - - - - - Moderate pending narration - - - - - - - - - retry publish unpublished narrations - - - - - Get Upload Session (including files) - - - - - - - Get User Profiles - - - - - - - validating narration profile - - - - - - - Add a narration profile - - - - - - - Update a narration profile - - - - - - - Delete a narration profile - - - - - - - - Get uploads descending by upload time - - - if userId is empty all user uploads would be returned - - - - - publishing tracker data - - - - - - - - - Configuration - - - - - Database Contetxt - - - - - Background Task Queue Instance - - - - - Messaging service - - - - - constructor - - - - - - British Library Tile Downloader And Mixer @@ -5263,6 +4943,187 @@ + + + Audio Narration Service Implementation + + + + + returns list of narrations + + + send Guid.Empty if you want all narrations + + + + + + return selected narration information + + + + + + + Gets Verse Sync Range Information + + narration id + + + + + validate PoemNarrationViewModel + + + + + + + updates metadata for narration + + + + + + + + imports data from ganjoor MySql database + + User Id which becomes owner of imported data + + + + build profiles from exisng narrations data + + User Id which becomes owner of imported data + error string if occurs + + + + Initiate New Upload Session for audio + + + + + + + Save uploaded file + + + + + + + finalize upload session (add files) + + + + + + + + Moderate pending narration + + + + + + + + + retry publish unpublished narrations + + + + + Get Upload Session (including files) + + + + + + + Get User Profiles + + + + + + + validating narration profile + + + + + + + Add a narration profile + + + + + + + Update a narration profile + + + + + + + Delete a narration profile + + + + + + + + Get uploads descending by upload time + + + if userId is empty all user uploads would be returned + + + + + publishing tracker data + + + + + + + + + Configuration + + + + + Database Contetxt + + + + + Background Task Queue Instance + + + + + Messaging service + + + + + constructor + + + + + + Internal messaging system implementation @@ -5407,6 +5268,145 @@ Image Storage Path + + + Audio Narration Service + + + + + returns list of narrations + + + send Guid.Empty if you want all narrations + + + + + + return selected narration information + + + + + + + Gets Verse Sync Range Information + + narration id + + + + + updates metadata for narration + + + + + + + + imports narration data from ganjoor MySql database + + User Id which becomes owner of imported data + + + + + build profiles from exisng narrations data + + User Id which becomes owner of imported data + error string if occurs + + + + Initiate New Upload Session for audio + + + + + + + Save uploaded file + + + + + + + finalize upload session (add files) + + + + + + + + Moderate pending narration + + + + + + + + + Get Upload Session (including files) + + + + + + + Get User Profiles + + + + + + + Add a narration profile + + + + + + + Update a narration profile + + + + + + + Delete a narration profile + + + + + + + + Get uploads descending by upload time + + + if userId is empty all user uploads would be returned + + + + + retry publish unpublished narrations + + + + + publishing tracker data + + + + + + Internal messaging system interface diff --git a/RMuseum/Services/IAudioNarrationService.cs b/RMuseum/Services/IRecitationService.cs similarity index 81% rename from RMuseum/Services/IAudioNarrationService.cs rename to RMuseum/Services/IRecitationService.cs index b56088df..d407209e 100644 --- a/RMuseum/Services/IAudioNarrationService.cs +++ b/RMuseum/Services/IRecitationService.cs @@ -12,7 +12,7 @@ namespace RMuseum.Services /// /// Audio Narration Service /// - public interface IAudioNarrationService + public interface IRecitationService { /// /// returns list of narrations @@ -21,21 +21,21 @@ namespace RMuseum.Services /// send Guid.Empty if you want all narrations /// /// - public Task> GetAll(PagingParameterModel paging, Guid filteredUserId, AudioReviewStatus status); + public Task> GetAll(PagingParameterModel paging, Guid filteredUserId, AudioReviewStatus status); /// /// return selected narration information /// /// /// - Task> Get(int id); + Task> Get(int id); /// /// Gets Verse Sync Range Information /// /// narration id /// - Task> GetPoemNarrationVerseSyncArray(int id); + Task> GetPoemNarrationVerseSyncArray(int id); /// /// updates metadata for narration @@ -43,7 +43,7 @@ namespace RMuseum.Services /// /// /// - Task> UpdatePoemNarration(int id, PoemNarrationViewModel metadata); + Task> UpdatePoemNarration(int id, RecitationViewModel metadata); /// /// imports narration data from ganjoor MySql database @@ -88,7 +88,7 @@ namespace RMuseum.Services /// /// /// - Task> ModeratePoemNarration(int id, Guid moderatorId, PoemNarrationModerateViewModel model); + Task> ModeratePoemNarration(int id, Guid moderatorId, RecitationModerateViewModel model); /// /// Get Upload Session (including files) @@ -102,21 +102,21 @@ namespace RMuseum.Services /// /// /// - Task> GetUserNarrationProfiles(Guid userId); + Task> GetUserNarrationProfiles(Guid userId); /// /// Add a narration profile /// /// /// - Task> AddUserNarrationProfiles(UserNarrationProfileViewModel profile); + Task> AddUserNarrationProfiles(UserRecitationProfileViewModel profile); /// /// Update a narration profile /// /// /// - Task> UpdateUserNarrationProfiles(UserNarrationProfileViewModel profile); + Task> UpdateUserNarrationProfiles(UserRecitationProfileViewModel profile); /// /// Delete a narration profile @@ -146,6 +146,6 @@ namespace RMuseum.Services /// /// /// - Task> GetPublishingQueueStatus(PagingParameterModel paging, bool inProgress, bool finished); + Task> GetPublishingQueueStatus(PagingParameterModel paging, bool inProgress, bool finished); } } diff --git a/RMuseum/Services/Implementation/AudioNarrationService.cs b/RMuseum/Services/Implementation/RecitationService.cs similarity index 84% rename from RMuseum/Services/Implementation/AudioNarrationService.cs rename to RMuseum/Services/Implementation/RecitationService.cs index 59563449..10a87c4b 100644 --- a/RMuseum/Services/Implementation/AudioNarrationService.cs +++ b/RMuseum/Services/Implementation/RecitationService.cs @@ -28,7 +28,7 @@ namespace RMuseum.Services.Implementation /// /// Audio Narration Service Implementation /// - public class AudioNarrationService : IAudioNarrationService + public class RecitationService : IRecitationService { @@ -41,13 +41,13 @@ namespace RMuseum.Services.Implementation /// send Guid.Empty if you want all narrations /// /// - public async Task> GetAll(PagingParameterModel paging, Guid filteredUserId, AudioReviewStatus status) + public async Task> GetAll(PagingParameterModel paging, Guid filteredUserId, AudioReviewStatus status) { try { //whenever I had not a reference to audio.Owner in the final selection it became null, so this strange arrangement is not all because of my stupidity! var source = - from audio in _context.AudioFiles + from audio in _context.Recitations .Include(a => a.Owner) .Where(a => (filteredUserId == Guid.Empty || a.OwnerId == filteredUserId) @@ -57,16 +57,16 @@ namespace RMuseum.Services.Implementation .OrderByDescending(a => a.UploadDate) join poem in _context.GanjoorPoems on audio.GanjoorPostId equals poem.Id - select new PoemNarrationViewModel(audio, audio.Owner, poem); + select new RecitationViewModel(audio, audio.Owner, poem); - (PaginationMetadata PagingMeta, PoemNarrationViewModel[] Items) paginatedResult = - await QueryablePaginator.Paginate(source, paging); + (PaginationMetadata PagingMeta, RecitationViewModel[] Items) paginatedResult = + await QueryablePaginator.Paginate(source, paging); - return new RServiceResult<(PaginationMetadata PagingMeta, PoemNarrationViewModel[] Items)>(paginatedResult); + return new RServiceResult<(PaginationMetadata PagingMeta, RecitationViewModel[] Items)>(paginatedResult); } catch (Exception exp) { - return new RServiceResult<(PaginationMetadata PagingMeta, PoemNarrationViewModel[] Items)>((PagingMeta: null, Items: null), exp.ToString()); + return new RServiceResult<(PaginationMetadata PagingMeta, RecitationViewModel[] Items)>((PagingMeta: null, Items: null), exp.ToString()); } } @@ -75,25 +75,25 @@ namespace RMuseum.Services.Implementation /// /// /// - public async Task> Get(int id) + public async Task> Get(int id) { try { //whenever I had not a reference to audio.Owner in the final selection it became null, so this strange arrangement is not all because of my stupidity! var source = - from audio in _context.AudioFiles + from audio in _context.Recitations .Include(a => a.Owner) .Where(a => a.Id == id) join poem in _context.GanjoorPoems on audio.GanjoorPostId equals poem.Id - select new PoemNarrationViewModel(audio, audio.Owner, poem); + select new RecitationViewModel(audio, audio.Owner, poem); var narration = await source.SingleOrDefaultAsync(); - return new RServiceResult(narration); + return new RServiceResult(narration); } catch (Exception exp) { - return new RServiceResult(null, exp.ToString()); + return new RServiceResult(null, exp.ToString()); } } @@ -102,16 +102,16 @@ namespace RMuseum.Services.Implementation /// /// narration id /// - public async Task> GetPoemNarrationVerseSyncArray(int id) + public async Task> GetPoemNarrationVerseSyncArray(int id) { try { - var narration = await _context.AudioFiles.Where(a => a.Id == id).SingleOrDefaultAsync(); + var narration = await _context.Recitations.Where(a => a.Id == id).SingleOrDefaultAsync(); var verses = await _context.GanjoorVerses.Where(v => v.PoemId == narration.GanjoorPostId).OrderBy(v => v.VOrder).ToListAsync(); string xml = File.ReadAllText(narration.LocalXmlFilePath); - List verseSyncs = new List(); + List verseSyncs = new List(); XElement elObject = XDocument.Parse(xml).Root; foreach (var syncInfo in elObject.Element("PoemAudio").Element("SyncArray").Elements("SyncInfo")) @@ -123,7 +123,7 @@ namespace RMuseum.Services.Implementation var verse = verses.Where(v => v.VOrder == verseOrder).SingleOrDefault(); if(verse != null) { - verseSyncs.Add(new NarrationVerseSync() + verseSyncs.Add(new RecitationVerseSync() { VerseOrder = verseOrder, VerseText = verse.Text, @@ -132,11 +132,11 @@ namespace RMuseum.Services.Implementation } } - return new RServiceResult(verseSyncs.ToArray()); + return new RServiceResult(verseSyncs.ToArray()); } catch (Exception exp) { - return new RServiceResult(null, exp.ToString()); + return new RServiceResult(null, exp.ToString()); } } @@ -145,7 +145,7 @@ namespace RMuseum.Services.Implementation /// /// /// - private static string GetPoemNarrationValidationError(PoemNarrationViewModel p) + private static string GetPoemNarrationValidationError(RecitationViewModel p) { if (p.AudioArtist.Length < 3) { @@ -190,7 +190,7 @@ namespace RMuseum.Services.Implementation /// /// /// - public async Task> UpdatePoemNarration(int id, PoemNarrationViewModel metadata) + public async Task> UpdatePoemNarration(int id, RecitationViewModel metadata) { try { @@ -204,25 +204,25 @@ namespace RMuseum.Services.Implementation string err = GetPoemNarrationValidationError(metadata); if(!string.IsNullOrEmpty(err)) { - return new RServiceResult(null, err); + return new RServiceResult(null, err); } - PoemNarration narration = await _context.AudioFiles.Include(a => a.Owner).Where(a => a.Id == id).SingleOrDefaultAsync(); + Recitation narration = await _context.Recitations.Include(a => a.Owner).Where(a => a.Id == id).SingleOrDefaultAsync(); if(narration == null) - return new RServiceResult(null, "404"); + return new RServiceResult(null, "404"); narration.AudioTitle = metadata.AudioTitle; narration.AudioArtist = metadata.AudioArtist; narration.AudioArtistUrl = metadata.AudioArtistUrl; narration.AudioSrc = metadata.AudioSrc; narration.AudioSrcUrl = metadata.AudioSrcUrl; narration.ReviewStatus = metadata.ReviewStatus; - _context.AudioFiles.Update(narration); + _context.Recitations.Update(narration); await _context.SaveChangesAsync(); - return new RServiceResult(new PoemNarrationViewModel(narration, narration.Owner, await _context.GanjoorPoems.Where(p => p.Id == narration.GanjoorPostId).SingleOrDefaultAsync())); + return new RServiceResult(new RecitationViewModel(narration, narration.Owner, await _context.GanjoorPoems.Where(p => p.Id == narration.GanjoorPostId).SingleOrDefaultAsync())); } catch (Exception exp) { - return new RServiceResult(null, exp.ToString()); + return new RServiceResult(null, exp.ToString()); } } @@ -235,7 +235,7 @@ namespace RMuseum.Services.Implementation { try { - PoemNarration sampleCheck = await _context.AudioFiles.FirstOrDefaultAsync(); + Recitation sampleCheck = await _context.Recitations.FirstOrDefaultAsync(); if(sampleCheck != null) { return new RServiceResult(false, "OneTimeImport is a one time operation and cannot be called multiple times."); @@ -267,7 +267,7 @@ namespace RMuseum.Services.Implementation foreach (DataRow row in srcData.Rows) { - PoemNarration newRecord = new PoemNarration() + Recitation newRecord = new Recitation() { OwnerId = ownerRAppUserId, GanjoorAudioId = int.Parse(row["audio_ID"].ToString()), @@ -299,7 +299,7 @@ namespace RMuseum.Services.Implementation newRecord.LocalMp3FilePath = Path.Combine(targetForAudioFile, $"{newRecord.FileNameWithoutExtension}.mp3"); newRecord.LocalXmlFilePath = Path.Combine(targetForXmlAudioFile, $"{newRecord.FileNameWithoutExtension}.xml"); - _context.AudioFiles.Add(newRecord); + _context.Recitations.Add(newRecord); await _context.SaveChangesAsync(); //this logically should be outside this loop, //but it messes with the order of records so I decided //to wait a little longer and have an ordered set of records @@ -328,11 +328,11 @@ namespace RMuseum.Services.Implementation { try { - List profiles = - await _context.AudioFiles + List profiles = + await _context.Recitations .GroupBy(audio => new { audio.AudioArtist, audio.AudioArtistUrl, audio.AudioSrc, audio.AudioSrcUrl }) .OrderByDescending(g => g.Count()) - .Select(g => new UserNarrationProfile() + .Select(g => new UserRecitationProfile() { UserId = ownerRAppUserId, ArtistName = g.Key.AudioArtist, @@ -342,10 +342,10 @@ namespace RMuseum.Services.Implementation IsDefault = false } ).ToListAsync(); - foreach(UserNarrationProfile profile in profiles) + foreach(UserRecitationProfile profile in profiles) { - PoemNarration narration = - await _context.AudioFiles.Where(audio => + Recitation narration = + await _context.Recitations.Where(audio => audio.AudioArtist == profile.ArtistName && audio.AudioArtistUrl == profile.ArtistUrl @@ -384,12 +384,12 @@ namespace RMuseum.Services.Implementation profile.FileSuffixWithoutDash = ext; profile.Name = profile.ArtistName; int pIndex = 1; - while((await _context.UserNarrationProfiles.Where(p => p.UserId == ownerRAppUserId && p.Name == profile.Name).SingleOrDefaultAsync())!=null) + while((await _context.UserRecitationProfiles.Where(p => p.UserId == ownerRAppUserId && p.Name == profile.Name).SingleOrDefaultAsync())!=null) { pIndex++; profile.Name = $"{profile.ArtistName} {GPersianTextSync.Sync(pIndex.ToString())}"; } - _context.UserNarrationProfiles.Add(profile); + _context.UserRecitationProfiles.Add(profile); await _context.SaveChangesAsync(); //this logically should be outside this loop, //but it messes with the order of records so I decided //to wait a little longer and have an ordered set of records @@ -411,7 +411,7 @@ namespace RMuseum.Services.Implementation { try { - UserNarrationProfile defProfile = await _context.UserNarrationProfiles.Where(p => p.UserId == userId && p.IsDefault == true).FirstOrDefaultAsync(); + UserRecitationProfile defProfile = await _context.UserRecitationProfiles.Where(p => p.UserId == userId && p.IsDefault == true).FirstOrDefaultAsync(); if (defProfile == null) { return new RServiceResult(null, "نمایهٔ پیش‌فرض شما مشخص نیست. لطفا پیش از ارسال خوانش نمایهٔ پیش‌فرض خود را تعریف کنید."); @@ -541,7 +541,7 @@ namespace RMuseum.Services.Implementation } } - UserNarrationProfile defProfile = await context.UserNarrationProfiles.Where(p => p.UserId == session.UseId && p.IsDefault == true).FirstOrDefaultAsync(); //this should not be null + UserRecitationProfile defProfile = await context.UserRecitationProfiles.Where(p => p.UserId == session.UseId && p.IsDefault == true).FirstOrDefaultAsync(); //this should not be null foreach (UploadSessionFile file in session.UploadedFiles.Where(file => Path.GetExtension(file.FilePath) == ".xml").ToList()) { @@ -553,7 +553,7 @@ namespace RMuseum.Services.Implementation //the code would fail! foreach (PoemAudio audio in PoemAudioListProcessor.Load(file.FilePath)) { - if( await context.AudioFiles.Where(a => a.Mp3FileCheckSum == audio.FileCheckSum).SingleOrDefaultAsync() != null) + if( await context.Recitations.Where(a => a.Mp3FileCheckSum == audio.FileCheckSum).SingleOrDefaultAsync() != null) { session.UploadedFiles.Where(f => f.Id == file.Id).SingleOrDefault().ProcessResultMsg = "فایل صوتیی همسان با فایل ارسالی پیشتر آپلود شده است."; context.UploadSessions.Update(session); @@ -608,19 +608,19 @@ namespace RMuseum.Services.Implementation Guid legacyAudioGuid = audio.SyncGuid; while ( - (await context.AudioFiles.Where(a => a.LegacyAudioGuid == legacyAudioGuid).FirstOrDefaultAsync()) != null + (await context.Recitations.Where(a => a.LegacyAudioGuid == legacyAudioGuid).FirstOrDefaultAsync()) != null ) { legacyAudioGuid = Guid.NewGuid(); } - PoemNarration narration = new PoemNarration() + Recitation narration = new Recitation() { GanjoorPostId = audio.PoemId, OwnerId = session.UseId, - GanjoorAudioId = 1 + await context.AudioFiles.OrderByDescending(a => a.GanjoorAudioId).Select(a => a.GanjoorAudioId).FirstOrDefaultAsync(), - AudioOrder = 1 + await context.AudioFiles.Where(a => a.GanjoorPostId == audio.PoemId).OrderByDescending(a => a.GanjoorAudioId).Select(a => a.GanjoorAudioId).FirstOrDefaultAsync(), + GanjoorAudioId = 1 + await context.Recitations.OrderByDescending(a => a.GanjoorAudioId).Select(a => a.GanjoorAudioId).FirstOrDefaultAsync(), + AudioOrder = 1 + await context.Recitations.Where(a => a.GanjoorPostId == audio.PoemId).OrderByDescending(a => a.GanjoorAudioId).Select(a => a.GanjoorAudioId).FirstOrDefaultAsync(), FileNameWithoutExtension = fileNameWithoutExtension, SoundFilesFolder = currentTargetFolder, AudioTitle = string.IsNullOrEmpty(audio.PoemTitle) ? audio.Description : audio.PoemTitle, @@ -652,7 +652,7 @@ namespace RMuseum.Services.Implementation - context.AudioFiles.Add(narration); + context.Recitations.Add(narration); session.UploadedFiles.Where(f => f.Id == file.Id).SingleOrDefault().ProcessResultMsg = ""; @@ -731,15 +731,15 @@ namespace RMuseum.Services.Implementation /// /// /// - public async Task> ModeratePoemNarration(int id, Guid moderatorId, PoemNarrationModerateViewModel model) + public async Task> ModeratePoemNarration(int id, Guid moderatorId, RecitationModerateViewModel model) { try { - PoemNarration narration = await _context.AudioFiles.Include(a => a.Owner).Where(a => a.Id == id).SingleOrDefaultAsync(); + Recitation narration = await _context.Recitations.Include(a => a.Owner).Where(a => a.Id == id).SingleOrDefaultAsync(); if (narration == null) - return new RServiceResult(null, "404"); + return new RServiceResult(null, "404"); if (narration.ReviewStatus != AudioReviewStatus.Draft && narration.ReviewStatus != AudioReviewStatus.Pending) - return new RServiceResult(null, "خوانش می‌بایست در وضعیت پیش‌نویس یا در انتظار بازبینی باشد."); + return new RServiceResult(null, "خوانش می‌بایست در وضعیت پیش‌نویس یا در انتظار بازبینی باشد."); narration.ReviewDate = DateTime.Now; narration.ReviewerId = moderatorId; if(model.Result != PoemNarrationModerationResult.MetadataNeedsFixation) @@ -752,7 +752,7 @@ namespace RMuseum.Services.Implementation //TODO: delete rejected items files passed a certain period of time in a maintenance job } narration.ReviewMsg = model.Message; - _context.AudioFiles.Update(narration); + _context.Recitations.Update(narration); await _context.SaveChangesAsync(); if (model.Result == PoemNarrationModerationResult.MetadataNeedsFixation) @@ -792,19 +792,19 @@ namespace RMuseum.Services.Implementation - return new RServiceResult(new PoemNarrationViewModel(narration, narration.Owner, await _context.GanjoorPoems.Where(p => p.Id == narration.GanjoorPostId).SingleOrDefaultAsync())); + return new RServiceResult(new RecitationViewModel(narration, narration.Owner, await _context.GanjoorPoems.Where(p => p.Id == narration.GanjoorPostId).SingleOrDefaultAsync())); } catch (Exception exp) { - return new RServiceResult(null, exp.ToString()); + return new RServiceResult(null, exp.ToString()); } } - private async Task _PublishNarration(PoemNarration narration, RMuseumDbContext context) + private async Task _PublishNarration(Recitation narration, RMuseumDbContext context) { - NarrationPublishingTracker tracker = new NarrationPublishingTracker() + RecitationPublishingTracker tracker = new RecitationPublishingTracker() { PoemNarrationId = narration.Id, StartDate = DateTime.Now, @@ -813,7 +813,7 @@ namespace RMuseum.Services.Implementation FirstDbUpdated = false, SecondDbUpdated = false, }; - context.NarrationPublishingTrackers.Add(tracker); + context.RecitationPublishingTrackers.Add(tracker); await context.SaveChangesAsync(); using var client = new SftpClient @@ -831,14 +831,14 @@ namespace RMuseum.Services.Implementation client.UploadFile(x, $"{Configuration.GetSection("AudioSFPServer")["RootPath"]}{narration.RemoteXMLFilePath}", true); tracker.XmlFileCopied = true; - context.NarrationPublishingTrackers.Update(tracker); + context.RecitationPublishingTrackers.Update(tracker); await context.SaveChangesAsync(); using var s = File.OpenRead(narration.LocalMp3FilePath); client.UploadFile(s, $"{Configuration.GetSection("AudioSFPServer")["RootPath"]}{narration.RemoteMp3FilePath}", true); tracker.Mp3FileCopied = true; - context.NarrationPublishingTrackers.Update(tracker); + context.RecitationPublishingTrackers.Update(tracker); await context.SaveChangesAsync(); string sql = $"INSERT INTO ganja_gaudio (audio_post_ID,audio_order,audio_xml,audio_ogg,audio_mp3,audio_title,audio_artist," + @@ -856,7 +856,7 @@ namespace RMuseum.Services.Implementation } tracker.FirstDbUpdated = true; - context.NarrationPublishingTrackers.Update(tracker); + context.RecitationPublishingTrackers.Update(tracker); await context.SaveChangesAsync(); //We are using two database for different purposes on the remote @@ -870,11 +870,11 @@ namespace RMuseum.Services.Implementation } tracker.SecondDbUpdated = true; - context.NarrationPublishingTrackers.Update(tracker); + context.RecitationPublishingTrackers.Update(tracker); await context.SaveChangesAsync(); narration.AudioSyncStatus = (int)AudioSyncStatus.SynchronizedOrRejected; - context.AudioFiles.Update(narration); + context.Recitations.Update(narration); await context.SaveChangesAsync(); @@ -889,7 +889,7 @@ namespace RMuseum.Services.Implementation tracker.Finished = true; tracker.FinishDate = DateTime.Now; - context.NarrationPublishingTrackers.Update(tracker); + context.RecitationPublishingTrackers.Update(tracker); await context.SaveChangesAsync(); @@ -898,7 +898,7 @@ namespace RMuseum.Services.Implementation { //if an error occurs, narration.AudioSyncStatus is not updated and narration can be idetified later to do "retrypublish" attempts tracker.LastException = exp.ToString(); - context.NarrationPublishingTrackers.Update(tracker); + context.RecitationPublishingTrackers.Update(tracker); await context.SaveChangesAsync(); } finally @@ -918,8 +918,8 @@ namespace RMuseum.Services.Implementation { using (RMuseumDbContext context = new RMuseumDbContext(Configuration)) //this is long running job, so _context might be already been freed/collected by GC { - var list = await context.AudioFiles.Where(a => a.ReviewStatus == AudioReviewStatus.Approved && a.AudioSyncStatus != (int)AudioSyncStatus.SynchronizedOrRejected).ToListAsync(); - foreach (PoemNarration narration in list) + var list = await context.Recitations.Where(a => a.ReviewStatus == AudioReviewStatus.Approved && a.AudioSyncStatus != (int)AudioSyncStatus.SynchronizedOrRejected).ToListAsync(); + foreach (Recitation narration in list) { await _PublishNarration(narration, context); } @@ -954,22 +954,22 @@ namespace RMuseum.Services.Implementation /// /// /// - public async Task> GetUserNarrationProfiles(Guid userId) + public async Task> GetUserNarrationProfiles(Guid userId) { try { - List profiles = new List(); + List profiles = new List(); - foreach(UserNarrationProfile p in (await _context.UserNarrationProfiles.Include(p => p.User).Where(p => p.UserId == userId).ToArrayAsync())) + foreach(UserRecitationProfile p in (await _context.UserRecitationProfiles.Include(p => p.User).Where(p => p.UserId == userId).ToArrayAsync())) { - profiles.Add(new UserNarrationProfileViewModel(p)); + profiles.Add(new UserRecitationProfileViewModel(p)); } - return new RServiceResult(profiles.ToArray()); + return new RServiceResult(profiles.ToArray()); } catch (Exception exp) { - return new RServiceResult(null, exp.ToString()); + return new RServiceResult(null, exp.ToString()); } } @@ -978,7 +978,7 @@ namespace RMuseum.Services.Implementation /// /// /// - private static string GetUserProfileValidationError(UserNarrationProfile p) + private static string GetUserProfileValidationError(UserRecitationProfile p) { if(string.IsNullOrEmpty(p.Name)) { @@ -1048,11 +1048,11 @@ namespace RMuseum.Services.Implementation /// /// /// - public async Task> AddUserNarrationProfiles(UserNarrationProfileViewModel profile) + public async Task> AddUserNarrationProfiles(UserRecitationProfileViewModel profile) { try { - var p = new UserNarrationProfile() + var p = new UserRecitationProfile() { UserId = profile.UserId, Name = profile.Name.Trim(), @@ -1067,31 +1067,31 @@ namespace RMuseum.Services.Implementation string error = GetUserProfileValidationError(p); if(error != "") { - return new RServiceResult(null, error); + return new RServiceResult(null, error); } - if((await _context.UserNarrationProfiles.Where(e => e.UserId == p.Id && e.Name == p.Name).SingleOrDefaultAsync())!=null) + if((await _context.UserRecitationProfiles.Where(e => e.UserId == p.Id && e.Name == p.Name).SingleOrDefaultAsync())!=null) { - return new RServiceResult(null, "شما نمایهٔ دیگری با همین نام دارید."); + return new RServiceResult(null, "شما نمایهٔ دیگری با همین نام دارید."); } - await _context.UserNarrationProfiles.AddAsync(p); + await _context.UserRecitationProfiles.AddAsync(p); await _context.SaveChangesAsync(); if(p.IsDefault) { - foreach(var o in _context.UserNarrationProfiles.Where(o => o.Id != p.Id && o.IsDefault).Select(o => o)) + foreach(var o in _context.UserRecitationProfiles.Where(o => o.Id != p.Id && o.IsDefault).Select(o => o)) { o.IsDefault = false; - _context.UserNarrationProfiles.Update(o); + _context.UserRecitationProfiles.Update(o); } await _context.SaveChangesAsync(); } - return new RServiceResult(new UserNarrationProfileViewModel(p)); + return new RServiceResult(new UserRecitationProfileViewModel(p)); } catch (Exception exp) { - return new RServiceResult(null, exp.ToString()); + return new RServiceResult(null, exp.ToString()); } } @@ -1100,15 +1100,15 @@ namespace RMuseum.Services.Implementation /// /// /// - public async Task> UpdateUserNarrationProfiles(UserNarrationProfileViewModel profile) + public async Task> UpdateUserNarrationProfiles(UserRecitationProfileViewModel profile) { try { - var p = await _context.UserNarrationProfiles.Where(p => p.Id == profile.Id).SingleOrDefaultAsync(); + var p = await _context.UserRecitationProfiles.Where(p => p.Id == profile.Id).SingleOrDefaultAsync(); if (p.UserId != profile.UserId) - return new RServiceResult(null, "permission error"); + return new RServiceResult(null, "permission error"); p.Name = profile.Name.Trim(); p.ArtistName = profile.ArtistName.Trim(); @@ -1121,31 +1121,31 @@ namespace RMuseum.Services.Implementation string error = GetUserProfileValidationError(p); if (error != "") { - return new RServiceResult(null, error); + return new RServiceResult(null, error); } - if ((await _context.UserNarrationProfiles.Where(e => e.UserId == p.Id && e.Name == p.Name && e.Id != p.Id).SingleOrDefaultAsync()) != null) + if ((await _context.UserRecitationProfiles.Where(e => e.UserId == p.Id && e.Name == p.Name && e.Id != p.Id).SingleOrDefaultAsync()) != null) { - return new RServiceResult(null, "شما نمایهٔ دیگری با همین نام دارید."); + return new RServiceResult(null, "شما نمایهٔ دیگری با همین نام دارید."); } - _context.UserNarrationProfiles.Update(p); + _context.UserRecitationProfiles.Update(p); await _context.SaveChangesAsync(); if (p.IsDefault) { - foreach (var o in _context.UserNarrationProfiles.Where(o => o.Id != p.Id && o.IsDefault).Select(o => o)) + foreach (var o in _context.UserRecitationProfiles.Where(o => o.Id != p.Id && o.IsDefault).Select(o => o)) { o.IsDefault = false; - _context.UserNarrationProfiles.Update(o); + _context.UserRecitationProfiles.Update(o); } await _context.SaveChangesAsync(); } - return new RServiceResult(new UserNarrationProfileViewModel(p)); + return new RServiceResult(new UserRecitationProfileViewModel(p)); } catch (Exception exp) { - return new RServiceResult(null, exp.ToString()); + return new RServiceResult(null, exp.ToString()); } } @@ -1160,12 +1160,12 @@ namespace RMuseum.Services.Implementation try { - var p = await _context.UserNarrationProfiles.Where(p => p.Id == id).SingleOrDefaultAsync(); + var p = await _context.UserRecitationProfiles.Where(p => p.Id == id).SingleOrDefaultAsync(); if (p.UserId != userId) return new RServiceResult(false); - _context.UserNarrationProfiles.Remove(p); + _context.UserRecitationProfiles.Remove(p); await _context.SaveChangesAsync(); @@ -1218,12 +1218,12 @@ namespace RMuseum.Services.Implementation /// /// /// - public async Task> GetPublishingQueueStatus(PagingParameterModel paging, bool inProgress, bool finished) + public async Task> GetPublishingQueueStatus(PagingParameterModel paging, bool inProgress, bool finished) { try { var source = - from tracker in _context.NarrationPublishingTrackers + from tracker in _context.RecitationPublishingTrackers .Include(t => t.PoemNarration) .Where(a => (inProgress && !a.Finished) @@ -1233,14 +1233,14 @@ namespace RMuseum.Services.Implementation .OrderByDescending(a => a.StartDate) select tracker; - (PaginationMetadata PagingMeta, NarrationPublishingTracker[] Items) paginatedResult = - await QueryablePaginator.Paginate(source, paging); + (PaginationMetadata PagingMeta, RecitationPublishingTracker[] Items) paginatedResult = + await QueryablePaginator.Paginate(source, paging); - return new RServiceResult<(PaginationMetadata PagingMeta, NarrationPublishingTracker[] Items)>(paginatedResult); + return new RServiceResult<(PaginationMetadata PagingMeta, RecitationPublishingTracker[] Items)>(paginatedResult); } catch (Exception exp) { - return new RServiceResult<(PaginationMetadata PagingMeta, NarrationPublishingTracker[] Items)>((PagingMeta: null, Items: null), exp.ToString()); + return new RServiceResult<(PaginationMetadata PagingMeta, RecitationPublishingTracker[] Items)>((PagingMeta: null, Items: null), exp.ToString()); } } @@ -1272,7 +1272,7 @@ namespace RMuseum.Services.Implementation /// /// /// - public AudioNarrationService(RMuseumDbContext context, IConfiguration configuration, IBackgroundTaskQueue backgroundTaskQueue, IRNotificationService notificationService) + public RecitationService(RMuseumDbContext context, IConfiguration configuration, IBackgroundTaskQueue backgroundTaskQueue, IRNotificationService notificationService) { _context = context; Configuration = configuration; diff --git a/RMuseum/Startup.cs b/RMuseum/Startup.cs index e1f5da81..83910507 100644 --- a/RMuseum/Startup.cs +++ b/RMuseum/Startup.cs @@ -253,7 +253,7 @@ namespace RMuseum services.AddTransient(); //audio service - services.AddTransient(); + services.AddTransient(); //ganjoor service services.AddTransient();