1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2024-12-30 19:46:56 +00:00

fix: TR_TIME_LOCALTIME value in torrent scripts (#5006)

This commit is contained in:
wiz78 2023-02-23 14:18:29 +01:00 committed by GitHub
parent bc34f77624
commit 450e98fd91
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -475,10 +475,11 @@ void torrentCallScript(tr_torrent const* tor, std::string const& script)
auto const labels_str = buildLabelsString(tor);
auto const trackers_str = buildTrackersString(tor);
auto const bytes_downloaded_str = std::to_string(tor->downloadedCur + tor->downloadedPrev);
auto const localtime_str = fmt::format("{:%a %b %d %T %Y%n}", fmt::localtime(tr_time()));
auto const env = std::map<std::string_view, std::string_view>{
{ "TR_APP_VERSION"sv, SHORT_VERSION_STRING },
{ "TR_TIME_LOCALTIME"sv, fmt::format("{:%a %b %d %T %Y%n}", fmt::localtime(tr_time())) },
{ "TR_TIME_LOCALTIME"sv, localtime_str },
{ "TR_TORRENT_BYTES_DOWNLOADED"sv, bytes_downloaded_str },
{ "TR_TORRENT_DIR"sv, torrent_dir.c_str() },
{ "TR_TORRENT_HASH"sv, tor->infoHashString() },