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:
parent
bc34f77624
commit
450e98fd91
1 changed files with 2 additions and 1 deletions
|
@ -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() },
|
||||
|
|
Loading…
Reference in a new issue