mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-11-05 12:47: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
@@ -52,7 +52,7 @@ const SETTINGS_FILE_NAME: &str = "settings.json";
|
||||
/// (`DataBackupContents`) includes. The runtime refuses a plan which names anything else, so that
|
||||
/// whatever goes wrong in the app, a restore never replaces the logs, the downloaded tools, or the
|
||||
/// data folder as a whole.
|
||||
const REPLACEABLE_ELEMENTS: [(Location, &str); 8] = [
|
||||
const REPLACEABLE_ELEMENTS: [(Location, &str); 9] = [
|
||||
(Location::ConfigDirectory, SETTINGS_FILE_NAME),
|
||||
(Location::DataDirectory, "workspaces/"),
|
||||
(Location::DataDirectory, "tempChats/"),
|
||||
@@ -61,6 +61,7 @@ const REPLACEABLE_ELEMENTS: [(Location, &str); 8] = [
|
||||
(Location::DataDirectory, "visualBriefings/"),
|
||||
(Location::DataDirectory, "databases/sqlite/"),
|
||||
(Location::DataDirectory, "databases/vector_database/stores/"),
|
||||
(Location::DataDirectory, "mediaTranscripts/"),
|
||||
];
|
||||
|
||||
/// Paths which a restore always keeps, whatever the plan says: the plugins which come with AI Studio
|
||||
@@ -794,6 +795,21 @@ mod tests {
|
||||
assert_current_data_untouched(&test);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn a_restore_replaces_the_media_transcripts_of_the_data_sources() {
|
||||
let test = TestFolders::new();
|
||||
test.write_current_data();
|
||||
test.write(Location::DataDirectory, "mediaTranscripts/current/transcript.md", "current transcript");
|
||||
test.prepare_restore(r#"{ "location": "DATA_DIRECTORY", "relative_path": "mediaTranscripts/", "keep": [] }"#);
|
||||
test.write(Location::DataDirectory, ".restore-pending/mediaTranscripts/restored/transcript.md", "restored transcript");
|
||||
|
||||
let outcome = apply_pending_restore_in(&test.folders(), &[]);
|
||||
|
||||
assert_eq!(outcome, Some(RestoreOutcome::Applied));
|
||||
assert_eq!(test.read(Location::DataDirectory, "mediaTranscripts/restored/transcript.md").as_deref(), Some("restored transcript"));
|
||||
assert!(!test.exists(Location::DataDirectory, "mediaTranscripts/current"));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn a_plan_which_names_another_element_is_refused() {
|
||||
for relative_path in ["", "events.log", "databases/", "../data/", "pandoc/"] {
|
||||
|
||||
Reference in new issue
Block a user