Skip to content

Commit

Permalink
Issue !11: Update of wording and readme fixes
Browse files Browse the repository at this point in the history
Close !11
  • Loading branch information
vlacour97 committed Jan 30, 2023
1 parent 7a92c19 commit eead5fc
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 14 deletions.
5 changes: 3 additions & 2 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ The options used in this command are:
| Environment Variable | Required ? | Default value | Available values | Description |
| --- | --- | --- | --- | --- |
| NOTIFIER_SERVICES | No | stdout | stdout, pushover | Choice of notification services separated by a comma |
| NOTIFIER_SERVICES_CONFIG | No | {} | **Keys**: stdout, pushover<br>**Values**: 'all' or an array with the values specified in [the table below](#Type-of-actions) | Choice of which actions should be notified on which service in JSON<br>Example:<br> `{"stdout": "all", "pushover": ["download_start", "download_done"]` |
| NOTIFIER_SERVICES_CONFIG | No | {} | **Keys**: stdout, pushover<br>**Values**: 'all' or an array with the values specified in [the table below](#Type-of-actions) | Choice of which actions should be notified on which service in JSON<br>Example:<br> `{"stdout": "all", "pushover": ["download_start", "download_done"]}` |

#### Type of actions
| Valeur | Description |
Expand All @@ -195,7 +195,8 @@ The options used in this command are:
No configuration possible

#### Pushover

> Action `download_progress` was not supported by pushover notifier.
| Environment Variable | Required ? | Default value | Description |
| --- | --- | --- | --- |
| PUSHOVER_USER_TOKEN | Yes | | [Pushover](https://pushover.net/) User Token. Set PUSHOVER_USER_TOKEN and PUSHOVER_APP_TOKEN to use pushover app to be notified when download was finish |
Expand Down
10 changes: 5 additions & 5 deletions app/src/notifier/pushover-notifier.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,22 +43,22 @@ export default class PushoverNotifier implements NotifierInterface {

notifyOnWatch(torrent: Torrent): void {
this.pusher.send({
title: 'New file was watched',
title: 'New watched file',
message: `The file "${torrent.name}" has been watched on your server`
})
}

notifyOnDebrid(file: File): void {
this.pusher.send({
title: 'New file was debrided',
title: 'New debrided file',
message: `The file "${file.filename}" has been debrided on your server`
})
}

notifyOnDownloadStart(downloadFile: DownloadFile): void {
this.pusher.send({
title: 'Download started',
message: `The download of file "${downloadFile.file.filename}" has been started on your server`
title: 'Download started !',
message: `The file "${downloadFile.file.filename}" is being downloaded on your server`
})
}

Expand All @@ -68,7 +68,7 @@ export default class PushoverNotifier implements NotifierInterface {

notifyOnDownloadDone(downloadFile: DownloadFile): void {
this.pusher.send({
title: 'Download finish',
title: 'File downloaded !',
message: `The file "${downloadFile.file.filename}" has been downloaded on your server`
})
}
Expand Down
2 changes: 1 addition & 1 deletion app/src/notifier/stdout-notifier.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export default class StdoutNotifier implements NotifierInterface {
}

notifyOnDownloadStart(downloadFile: DownloadFile): void {
console.log(`The download of file "${downloadFile.file.filename}" has been started on your server`)
console.log(`The file "${downloadFile.file.filename}" is being downloaded on your server`)
}

notifyOnDownloadProgress(downloadFile: DownloadFile, progress: number): void {
Expand Down
10 changes: 5 additions & 5 deletions app/tests/notifier/pushover-notifier.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ describe(PushoverNotifier.name, () => {
notifier.notifyOnWatch(torrent);

expect(pushoverSendMethod).toHaveBeenCalledWith({
title: 'New file was watched',
title: 'New watched file',
message: `The file "filename" has been watched on your server`
})
})
Expand All @@ -47,7 +47,7 @@ describe(PushoverNotifier.name, () => {
notifier.notifyOnDebrid(file);

expect(pushoverSendMethod).toHaveBeenCalledWith({
title: 'New file was debrided',
title: 'New debrided file',
message: `The file "filename" has been debrided on your server`
})
})
Expand All @@ -65,8 +65,8 @@ describe(PushoverNotifier.name, () => {
notifier.notifyOnDownloadStart(downloadFile);

expect(pushoverSendMethod).toHaveBeenCalledWith({
title: 'Download started',
message: `The download of file "filename" has been started on your server`
title: 'Download started !',
message: `The file "filename" is being downloaded on your server`
})
})

Expand Down Expand Up @@ -120,7 +120,7 @@ describe(PushoverNotifier.name, () => {
notifier.notifyOnDownloadDone(downloadFile);

expect(pushoverSendMethod).toHaveBeenCalledWith({
title: 'Download finish',
title: 'File downloaded !',
message: `The file "filename" has been downloaded on your server`
})
})
Expand Down
2 changes: 1 addition & 1 deletion app/tests/notifier/stdout-notifier.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ describe(StdoutNotifier.name, () => {

notifier.notifyOnDownloadStart(downloadFile);

expect(console.log).toHaveBeenCalledWith('The download of file "filename" has been started on your server')
expect(console.log).toHaveBeenCalledWith('The file "filename" is being downloaded on your server')
})

test('notifyOnDownloadProgress', () => {
Expand Down

0 comments on commit eead5fc

Please sign in to comment.