transmission: add notification when download finished
This commit is contained in:
parent
6110b5b024
commit
adcf1e0dac
1 changed files with 12 additions and 0 deletions
|
@ -95,6 +95,18 @@ in {
|
|||
# Start torrents as soon as they are added
|
||||
|
||||
start-added-torrents = true;
|
||||
script-torrent-done-enabled = true;
|
||||
script-torrent-done-filename =
|
||||
(pkgs.writers.writeBash "torrent-finished" ''
|
||||
JSON_STRING=$( ${pkgs.jq}/bin/jq -n --arg torrent_name "$TR_TORRENT_NAME" \
|
||||
'{text: ":tada: \($torrent_name)", channel: "torrent"}' )
|
||||
${pkgs.curl}/bin/curl \
|
||||
--include \
|
||||
--request POST \
|
||||
--data-urlencode \
|
||||
"payload=$JSON_STRING" \
|
||||
${lib.fileContents <common_secrets/mattermost_sink_url>}
|
||||
'');
|
||||
|
||||
};
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue