Commit 91093ecc authored by Lucas Beeler's avatar Lucas Beeler

Jim and I believe this closes #4248. We'll now solicit community input and try to repro in-house.

parent 9d8fb318
......@@ -153,6 +153,7 @@ public abstract class BatchImportJob {
// filesize should only be returned if BatchImportJob represents a single file.
public abstract bool determine_file_size(out uint64 filesize, out File file_or_dir);
// NOTE: prepare( ) is called from a background thread in the worker pool
public abstract bool prepare(out File file_to_import, out bool copy_to_library) throws Error;
// Completes the import for the new library photo once it's been imported.
......@@ -161,6 +162,8 @@ public abstract class BatchImportJob {
// that have been successfully imported.
//
// Returns true if any action was taken, false otherwise.
//
// NOTE: complete( )is called from the foreground thread
public virtual bool complete(MediaSource source, BatchImportRoll import_roll) throws Error {
return false;
}
......
......@@ -15,6 +15,7 @@ public class AlienDatabaseImportJob : BatchImportJob {
private uint64 filesize;
private time_t exposure_time;
private AlienDatabaseImportJob? associated = null;
private HierarchicalTagIndex? detected_htags = null;
public AlienDatabaseImportJob(AlienDatabaseImportSource import_source) {
this.import_source = import_source;
......@@ -86,15 +87,7 @@ public class AlienDatabaseImportJob : BatchImportJob {
file_to_import = src_file;
copy_to_library = false;
HierarchicalTagIndex? detected_htags =
build_exclusion_index(import_source.get_photo().get_tags());
if (detected_htags != null) {
Gee.Collection<string> paths = detected_htags.get_all_paths();
foreach (string path in paths)
Tag.for_path(path);
}
detected_htags = build_exclusion_index(import_source.get_photo().get_tags());
return true;
}
......@@ -107,6 +100,13 @@ public class AlienDatabaseImportJob : BatchImportJob {
AlienDatabasePhoto src_photo = import_source.get_photo();
// tags
if (detected_htags != null) {
Gee.Collection<string> paths = detected_htags.get_all_paths();
foreach (string path in paths)
Tag.for_path(path);
}
Gee.Collection<AlienDatabaseTag> src_tags = src_photo.get_tags();
foreach (AlienDatabaseTag src_tag in src_tags) {
string? prepped = HierarchicalTagUtilities.join_path_components(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment