Return absolute paths for files in project_properties()
This commit is contained in:
parent
384f87f399
commit
9d3067ae75
2 changed files with 5 additions and 5 deletions
|
@ -92,9 +92,9 @@ fs::path Path::MakeRelative(fs::path const& path, fs::path const& base) const {
|
|||
}
|
||||
|
||||
fs::path Path::MakeAbsolute(fs::path path, std::string const& token) const {
|
||||
if (path.empty()) return path;
|
||||
const auto it = tokens.find(token);
|
||||
if (it == tokens.end()) throw agi::InternalError("Bad token: " + token, nullptr);
|
||||
if (path.empty()) return path;
|
||||
|
||||
path.make_preferred();
|
||||
const auto str = path.string();
|
||||
|
|
|
@ -271,10 +271,6 @@ namespace {
|
|||
PUSH_FIELD(export_filters);
|
||||
PUSH_FIELD(export_encoding);
|
||||
PUSH_FIELD(style_storage);
|
||||
PUSH_FIELD(audio_file);
|
||||
PUSH_FIELD(video_file);
|
||||
PUSH_FIELD(timecodes_file);
|
||||
PUSH_FIELD(keyframes_file);
|
||||
PUSH_FIELD(video_zoom);
|
||||
PUSH_FIELD(ar_value);
|
||||
PUSH_FIELD(scroll_position);
|
||||
|
@ -282,6 +278,10 @@ namespace {
|
|||
PUSH_FIELD(ar_mode);
|
||||
PUSH_FIELD(video_position);
|
||||
#undef PUSH_FIELD
|
||||
set_field(L, "audio_file", config::path->MakeAbsolute(c->ass->Properties.audio_file, "?script"));
|
||||
set_field(L, "video_file", config::path->MakeAbsolute(c->ass->Properties.video_file, "?script"));
|
||||
set_field(L, "timecodes_file", config::path->MakeAbsolute(c->ass->Properties.timecodes_file, "?script"));
|
||||
set_field(L, "keyframes_file", config::path->MakeAbsolute(c->ass->Properties.keyframes_file, "?script"));
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue