summaryrefslogtreecommitdiff
path: root/src/tools
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2024-03-15 00:41:20 +0100
committerCarl Hetherington <cth@carlh.net>2024-05-11 21:00:37 +0200
commitd2c665cba983c625933817e0bf05e298f80f0119 (patch)
treec631beb6a9f56b76df71285559a042809d47851e /src/tools
parent59195cd423442f1c2b6c1d97162c1f5ecfe1f609 (diff)
Stop using video directory and hard-linking (#2756).
Instead store details of a previously-created asset in the film's metadata and then look there for potential video files to re-use.
Diffstat (limited to 'src/tools')
-rw-r--r--src/tools/dcpomatic.cc13
-rw-r--r--src/tools/dcpomatic_batch.cc5
2 files changed, 7 insertions, 11 deletions
diff --git a/src/tools/dcpomatic.cc b/src/tools/dcpomatic.cc
index 8f65fa83d..63802279f 100644
--- a/src/tools/dcpomatic.cc
+++ b/src/tools/dcpomatic.cc
@@ -102,6 +102,7 @@
#include <dcp/exceptions.h>
#include <dcp/filesystem.h>
#include <dcp/raw_convert.h>
+#include <dcp/scope_guard.h>
#include <dcp/warnings.h>
LIBDCP_DISABLE_WARNINGS
#include <wx/cmdline.h>
@@ -816,15 +817,9 @@ private:
{
double required;
double available;
- bool can_hard_link;
- if (!_film->should_be_enough_disk_space (required, available, can_hard_link)) {
- wxString message;
- if (can_hard_link) {
- message = wxString::Format (_("The DCP for this film will take up about %.1f GB, and the disk that you are using only has %.1f GB available. Do you want to continue anyway?"), required, available);
- } else {
- message = wxString::Format (_("The DCP and intermediate files for this film will take up about %.1f GB, and the disk that you are using only has %.1f GB available. You would need half as much space if the filesystem supported hard links, but it does not. Do you want to continue anyway?"), required, available);
- }
+ if (!_film->should_be_enough_disk_space(required, available)) {
+ auto const message = wxString::Format(_("The DCP for this film will take up about %.1f GB, and the disk that you are using only has %.1f GB available. Do you want to continue anyway?"), required, available);
if (!confirm_dialog (this, message)) {
return;
}
@@ -854,6 +849,8 @@ private:
if (!confirm_dialog (this, wxString::Format (_("Do you want to overwrite the existing DCP %s?"), std_to_wx(dcp_dir.string()).data()))) {
return;
}
+
+ preserve_assets(dcp_dir, _film->assets_path());
dcp::filesystem::remove_all(dcp_dir);
}
diff --git a/src/tools/dcpomatic_batch.cc b/src/tools/dcpomatic_batch.cc
index 32e8dec08..51d700d20 100644
--- a/src/tools/dcpomatic_batch.cc
+++ b/src/tools/dcpomatic_batch.cc
@@ -220,9 +220,8 @@ public:
double total_required;
double available;
- bool can_hard_link;
- film->should_be_enough_disk_space (total_required, available, can_hard_link);
+ film->should_be_enough_disk_space(total_required, available);
set<shared_ptr<const Film>> films;
@@ -239,7 +238,7 @@ public:
}
double required;
- i->should_be_enough_disk_space (required, available, can_hard_link);
+ i->should_be_enough_disk_space(required, available);
total_required += (1 - progress) * required;
}