mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-11-04 21:27:21 +00:00
Added transcription of audio and video files to local data sources (#1081)
Co-authored-by: Paul Koudelka <106623909+PaulKoudelka@users.noreply.github.com>
This commit is contained in:
1 parent
8642ce2d81
commit
752f7d828a
82 files changed
+3231
-302
No files matched your search
+1
-1
@@ -147,7 +147,7 @@ internal sealed partial class VisualBriefingBuildOrchestrator
|
||||
VisualBriefingBuildStage.SOURCE_PREPARATION,
|
||||
"A briefing source is no longer reachable.",
|
||||
$"Source {source.SourceId:D} failed the reachability check.");
|
||||
var sourceHash = await VisualBriefingHashing.ComputeFileAsync(source.Path, token);
|
||||
var sourceHash = await FileContentHash.ComputeAsync(source.Path, token);
|
||||
var transcriptHash = string.Empty;
|
||||
if (source.IsMedia)
|
||||
{
|
||||
|
||||
@@ -23,25 +23,6 @@ internal static class VisualBriefingHashing
|
||||
/// <returns>The lowercase hexadecimal hash.</returns>
|
||||
internal static string ComputeSections(params string?[] values) => Compute(string.Join('\u001e', values.Select(value => value ?? string.Empty)));
|
||||
|
||||
/// <summary>
|
||||
/// Computes a lowercase SHA-256 hash for a file without loading it fully into memory.
|
||||
/// </summary>
|
||||
/// <param name="path">The file path.</param>
|
||||
/// <param name="token">The cancellation token.</param>
|
||||
/// <returns>The lowercase hexadecimal hash.</returns>
|
||||
internal static async Task<string> ComputeFileAsync(string path, CancellationToken token)
|
||||
{
|
||||
await using var stream = new FileStream(
|
||||
path,
|
||||
FileMode.Open,
|
||||
FileAccess.Read,
|
||||
FileShare.Read,
|
||||
65_536,
|
||||
FileOptions.Asynchronous | FileOptions.SequentialScan);
|
||||
|
||||
return Convert.ToHexStringLower(await SHA256.HashDataAsync(stream, token));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns canonical JSON for one value, with ordinally sorted object properties.
|
||||
/// </summary>
|
||||
|
||||
+1
-1
@@ -41,7 +41,7 @@ internal sealed class VisualBriefingSourcePreparationService(VisualBriefingStore
|
||||
var info = new FileInfo(source.Path);
|
||||
totalBytes += info.Length;
|
||||
|
||||
var sourceHash = await VisualBriefingHashing.ComputeFileAsync(source.Path, token);
|
||||
var sourceHash = await FileContentHash.ComputeAsync(source.Path, token);
|
||||
var transcriptHash = string.Empty;
|
||||
|
||||
if (source.IsMedia)
|
||||
|
||||
Reference in new issue
Block a user