Merge branch 'main' into v17/dev

This commit is contained in:
Andy Butland
2025-08-20 11:57:01 +01:00
137 changed files with 4637 additions and 372 deletions

View File

@@ -1671,6 +1671,27 @@ public class DocumentRepository : ContentRepositoryBase<int, IContent, DocumentR
return MapDtosToContent(Database.Fetch<DocumentDto>(sql));
}
/// <inheritdoc />
public IEnumerable<Guid> GetScheduledContentKeys(Guid[] keys)
{
var action = ContentScheduleAction.Release.ToString();
DateTime now = DateTime.UtcNow;
Sql<ISqlContext> sql = SqlContext.Sql();
sql
.Select<NodeDto>(x => x.UniqueId)
.From<DocumentDto>()
.InnerJoin<ContentDto>().On<DocumentDto, ContentDto>(left => left.NodeId, right => right.NodeId)
.InnerJoin<NodeDto>().On<ContentDto, NodeDto>(left => left.NodeId, right => right.NodeId)
.WhereIn<NodeDto>(x => x.UniqueId, keys)
.WhereIn<NodeDto>(x => x.NodeId, Sql()
.Select<ContentScheduleDto>(x => x.NodeId)
.From<ContentScheduleDto>()
.Where<ContentScheduleDto>(x => x.Action == action && x.Date >= now));
return Database.Fetch<Guid>(sql);
}
/// <inheritdoc />
public IEnumerable<IContent> GetContentForExpiration(DateTime date)
{