Skip to content

Commit

Permalink
Created in last 3 montgs
Browse files Browse the repository at this point in the history
  • Loading branch information
angrave committed Jan 26, 2024
1 parent d33788f commit d68e773
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions TaskEngine/Tasks/QueueAwakerTask.cs
Original file line number Diff line number Diff line change
Expand Up @@ -198,18 +198,19 @@ private async Task PendingJobs()
// todoVTTs = await context.Transcriptions.AsNoTracking().Where(
// t => t.Captions.Count > 0 && t.File == null && t.CreatedAt < tooRecentCutoff
// ).OrderByDescending(t => t.CreatedAt).Take(maxVTTs).Select(e => e.Id).ToListAsync();
var last3Months = DateTime.Now.AddMonths(-3);

var maxSceneDetection = 400;
todoSceneDetection = await context.Videos.AsNoTracking().Where(
v=> (v.PhraseHintsDataId== null) && v.PhraseHints == null &&
v.Medias.Any() && v.CreatedAt < tooRecentCutoff
v.Medias.Any() && v.CreatedAt < tooRecentCutoff && v.CreatedAt > last3Months
).OrderByDescending(t => t.CreatedAt).Take(maxSceneDetection).Select(e => e.Id).ToListAsync();

var maxTranscriptions = 40;
todoTranscriptions = await context.Videos.AsNoTracking().Where(
v=> (v.PhraseHintsDataId != null || v.PhraseHints != null) &&
v.TranscribingAttempts < 41 && v.TranscriptionStatus != "NoError" &&
v.Medias.Any() && v.CreatedAt < tooRecentCutoff
v.Medias.Any() && v.CreatedAt < tooRecentCutoff && v.CreatedAt > last3Months
).OrderByDescending(t => t.CreatedAt).Take(maxTranscriptions).Select(e => e.Id).ToListAsync();

// Medias for which no videos have downloaded
Expand Down

0 comments on commit d68e773

Please sign in to comment.