Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions Backend/Services/LiftService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,8 @@ public async Task<string> LiftExport(string projectId, IProjectRepository projRe
// Get every word with all of its information.
var allWords = await wordRepo.GetAllWords(projectId);
var frontier = await wordRepo.GetAllFrontier(projectId);
// All words in the frontier with any senses are considered current.
// The Combine does not import senseless entries and the interface is supposed to prevent creating them.
var activeWords = frontier.Where(
x => x.Senses.Any(s => s.Accessibility == Status.Active || s.Accessibility == Status.Protected)).ToList();
var hasFlags = activeWords.Any(w => w.Flag.Active);
Expand All @@ -308,11 +310,11 @@ public async Task<string> LiftExport(string projectId, IProjectRepository projRe
// Get all project speakers for exporting audio and consents.
var projSpeakers = await speakerRepo.GetAllSpeakers(projectId);

// All words in the frontier with any senses are considered current.
// The Combine does not import senseless entries and the interface is supposed to prevent creating them.
// So the words found in allWords with no matching guid in activeWords are exported as 'deleted'.
var deletedWords = allWords.Where(
x => activeWords.All(w => w.Guid != x.Guid)).DistinctBy(w => w.Guid).ToList();
// Deleted words found in allWords with no matching guid in activeWords are exported as 'deleted'.
var activeWordGuids = activeWords.Select(w => w.Guid).ToHashSet();
var deletedWords = allWords
.Where(w => w.Accessibility == Status.Deleted && !activeWordGuids.Contains(w.Guid))
.DistinctBy(w => w.Guid).ToList();
var englishSemDoms = await semDomRepo.GetAllSemanticDomainTreeNodes("en") ?? [];
var semDomNames = englishSemDoms.ToDictionary(x => x.Id, x => x.Name);

Expand Down
Loading