Compare commits
15 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
ba1cf0182b
|
|||
|
5cccec88c9
|
|||
|
bbcd3f00a9
|
|||
| 2e339dd73b | |||
|
f988cf0f26
|
|||
|
ff82dc2012
|
|||
|
|
89a692ad90 | ||
|
|
d77ec5fb34 | ||
|
|
ec90e2dca7 | ||
|
5a4e6c9623
|
|||
|
9a6a06ee20
|
|||
|
5556e48fc0
|
|||
|
af573cac2a
|
|||
|
447cf6a2b4
|
|||
|
203bf9cb66
|
@@ -0,0 +1,11 @@
|
|||||||
|
### AI assistance (if any):
|
||||||
|
- List tools here and files touched by them
|
||||||
|
|
||||||
|
### Authorship & Understanding
|
||||||
|
|
||||||
|
- [ ] I wrote or heavily modified this code myself
|
||||||
|
- [ ] I understand how it works end-to-end
|
||||||
|
- [ ] I can maintain this code in the future
|
||||||
|
- [ ] No undisclosed AI-generated code was used
|
||||||
|
- [ ] If AI assistance was used, it is documented below
|
||||||
|
|
||||||
@@ -5,6 +5,29 @@ All notable changes to this project will be documented in this file.
|
|||||||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
||||||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||||
|
|
||||||
|
## v0.7.1 (2026-02-04)
|
||||||
|
|
||||||
|
### Feat
|
||||||
|
|
||||||
|
- Added support for a system-wide notification popup mechanism that works across Servarrs
|
||||||
|
- Implemented a 'config-path' command to print out the default Managarr configuration file path to help address #54
|
||||||
|
- Full support for filtering disks and aggregating root folders in the UI's 'Stats' block
|
||||||
|
- proper collapsing of root folder paths in the stats layer of the UI
|
||||||
|
- Added config option to filter for specific disk space paths to display in the UI (CLI is unaffected)
|
||||||
|
- Improved disk-space UI and CLI that shows the actual path being monitored instead of just a disk number
|
||||||
|
- Implemented the forgotten lidarr list disk-space command
|
||||||
|
|
||||||
|
### Fix
|
||||||
|
|
||||||
|
- Improved the system notification feature so it can persist between modals
|
||||||
|
- Sonarr API updated to somtimes allow either seeders or leechers to be null
|
||||||
|
- Improved the first-time run behavior so that it outputs the default configuration file it tries to load to help users locate the file on first-runs
|
||||||
|
- 'managarr config-path' should work without a pre-existing config already in place [#54]
|
||||||
|
|
||||||
|
### Refactor
|
||||||
|
|
||||||
|
- Removed the filtering of monitored_storage_paths from the networking module and migrated all of it to the UI
|
||||||
|
|
||||||
## v0.7.0 (2026-01-21)
|
## v0.7.0 (2026-01-21)
|
||||||
|
|
||||||
### Feat
|
### Feat
|
||||||
|
|||||||
@@ -91,5 +91,12 @@ Then, you can run workflows locally without having to commit and see if the GitH
|
|||||||
act -W .github/workflows/release.yml --input_type bump=minor
|
act -W .github/workflows/release.yml --input_type bump=minor
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Authorship Policy
|
||||||
|
|
||||||
|
All code in this repository is written and reviewed by humans. AI-generated code (e.g., Copilot, ChatGPT,
|
||||||
|
Claude, etc.) is not permitted unless explicitly disclosed and approved.
|
||||||
|
|
||||||
|
Submissions must certify that the contributor understands and can maintain the code they submit.
|
||||||
|
|
||||||
## Questions? Reach out to me!
|
## Questions? Reach out to me!
|
||||||
If you encounter any questions while developing Managarr, please don't hesitate to reach out to me at alex.j.tusa@gmail.com. I'm happy to help contributors, new and experienced in any way I can!
|
If you encounter any questions while developing Managarr, please don't hesitate to reach out to me at alex.j.tusa@gmail.com. I'm happy to help contributors, new and experienced in any way I can!
|
||||||
|
|||||||
Generated
+35
-36
@@ -99,9 +99,9 @@ checksum = "a23eb6b1614318a8071c9b2521f36b424b2c83db5eb3a0fead4a6c0809af6e61"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "arc-swap"
|
name = "arc-swap"
|
||||||
version = "1.8.0"
|
version = "1.8.1"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "51d03449bb8ca2cc2ef70869af31463d1ae5ccc8fa3e334b307203fbf815207e"
|
checksum = "9ded5f9a03ac8f24d1b8a25101ee812cd32cdc8c50a4c50237de2c4915850e73"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"rustversion",
|
"rustversion",
|
||||||
]
|
]
|
||||||
@@ -278,15 +278,15 @@ checksum = "5dd9dc738b7a8311c7ade152424974d8115f2cdad61e8dab8dac9f2362298510"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "bytemuck"
|
name = "bytemuck"
|
||||||
version = "1.24.0"
|
version = "1.25.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "1fbdf580320f38b612e485521afda1ee26d10cc9884efaaa750d383e13e3c5f4"
|
checksum = "c8efb64bd706a16a1bdde310ae86b351e4d21550d98d056f22f8a7f7a2183fec"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "bytes"
|
name = "bytes"
|
||||||
version = "1.11.0"
|
version = "1.11.1"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "b35204fbdc0b3f4446b89fc1ac2cf84a8a68971995d0bf2e925ec7cd960f9cb3"
|
checksum = "1e748733b7cbc798e1434b6ac524f0c1ff2ab456fe201501e6497c8417a4fc33"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "cargo-husky"
|
name = "cargo-husky"
|
||||||
@@ -341,9 +341,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "clap"
|
name = "clap"
|
||||||
version = "4.5.56"
|
version = "4.5.57"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "a75ca66430e33a14957acc24c5077b503e7d374151b2b4b3a10c83b4ceb4be0e"
|
checksum = "6899ea499e3fb9305a65d5ebf6e3d2248c5fab291f300ad0a704fbe142eae31a"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"clap_builder",
|
"clap_builder",
|
||||||
"clap_derive",
|
"clap_derive",
|
||||||
@@ -351,9 +351,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "clap_builder"
|
name = "clap_builder"
|
||||||
version = "4.5.56"
|
version = "4.5.57"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "793207c7fa6300a0608d1080b858e5fdbe713cdc1c8db9fb17777d8a13e63df0"
|
checksum = "7b12c8b680195a62a8364d16b8447b01b6c2c8f9aaf68bee653be34d4245e238"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anstream",
|
"anstream",
|
||||||
"anstyle",
|
"anstyle",
|
||||||
@@ -1263,14 +1263,13 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "hyper-util"
|
name = "hyper-util"
|
||||||
version = "0.1.19"
|
version = "0.1.20"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "727805d60e7938b76b826a6ef209eb70eaa1812794f9424d4a4e2d740662df5f"
|
checksum = "96547c2556ec9d12fb1578c4eaf448b04993e7fb79cbaad930a656880a6bdfa0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"base64",
|
"base64",
|
||||||
"bytes",
|
"bytes",
|
||||||
"futures-channel",
|
"futures-channel",
|
||||||
"futures-core",
|
|
||||||
"futures-util",
|
"futures-util",
|
||||||
"http",
|
"http",
|
||||||
"http-body",
|
"http-body",
|
||||||
@@ -1453,9 +1452,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "insta"
|
name = "insta"
|
||||||
version = "1.46.1"
|
version = "1.46.3"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "248b42847813a1550dafd15296fd9748c651d0c32194559dbc05d804d54b21e8"
|
checksum = "e82db8c87c7f1ccecb34ce0c24399b8a73081427f3c7c50a5d597925356115e4"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"console",
|
"console",
|
||||||
"once_cell",
|
"once_cell",
|
||||||
@@ -1669,7 +1668,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "managarr"
|
name = "managarr"
|
||||||
version = "0.7.0"
|
version = "0.7.1"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anyhow",
|
"anyhow",
|
||||||
"assert_cmd",
|
"assert_cmd",
|
||||||
@@ -1818,9 +1817,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "mockito"
|
name = "mockito"
|
||||||
version = "1.7.1"
|
version = "1.7.2"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "7e0603425789b4a70fcc4ac4f5a46a566c116ee3e2a6b768dc623f7719c611de"
|
checksum = "90820618712cab19cfc46b274c6c22546a82affcb3c3bdf0f29e3db8e1bb92c0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"assert-json-diff",
|
"assert-json-diff",
|
||||||
"bytes",
|
"bytes",
|
||||||
@@ -2214,9 +2213,9 @@ checksum = "7edddbd0b52d732b21ad9a5fab5c704c14cd949e5e9a1ec5929a24fded1b904c"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "portable-atomic"
|
name = "portable-atomic"
|
||||||
version = "1.13.0"
|
version = "1.13.1"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "f89776e4d69bb58bc6993e99ffa1d11f228b839984854c7daeb5d37f87cbe950"
|
checksum = "c33a9471896f1c69cecef8d20cbe2f7accd12527ce60845ff44c153bb2a21b49"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "potential_utf"
|
name = "potential_utf"
|
||||||
@@ -2497,9 +2496,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "regex"
|
name = "regex"
|
||||||
version = "1.12.2"
|
version = "1.12.3"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "843bc0191f75f3e22651ae5f1e72939ab2f72a4bc30fa80a066bd66edefc24d4"
|
checksum = "e10754a14b9137dd7b1e3e5b0493cc9171fdd105e0ab477f51b72e7f3ac0e276"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"aho-corasick",
|
"aho-corasick",
|
||||||
"memchr",
|
"memchr",
|
||||||
@@ -2509,9 +2508,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "regex-automata"
|
name = "regex-automata"
|
||||||
version = "0.4.13"
|
version = "0.4.14"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "5276caf25ac86c8d810222b3dbb938e512c55c6831a10f3e6ed1c93b84041f1c"
|
checksum = "6e1dd4122fc1595e8162618945476892eefca7b88c52820e74af6262213cae8f"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"aho-corasick",
|
"aho-corasick",
|
||||||
"memchr",
|
"memchr",
|
||||||
@@ -2520,9 +2519,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "regex-syntax"
|
name = "regex-syntax"
|
||||||
version = "0.8.8"
|
version = "0.8.9"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "7a2d987857b319362043e95f5353c0535c1f58eec5336fdfcf626430af7def58"
|
checksum = "a96887878f22d7bad8a3b6dc5b7440e0ada9a245242924394987b21cf2210a4c"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "relative-path"
|
name = "relative-path"
|
||||||
@@ -2946,9 +2945,9 @@ checksum = "b2aa850e253778c88a04c3d7323b043aeda9d3e30d5971937c1855769763678e"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "slab"
|
name = "slab"
|
||||||
version = "0.4.11"
|
version = "0.4.12"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "7a2ae44ef20feb57a68b23d846850f861394c2e02dc425a50098ae8c90267589"
|
checksum = "0c790de23124f9ab44544d7ac05d60440adc586479ce501c1d6d7da3cd8c9cf5"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "smallvec"
|
name = "smallvec"
|
||||||
@@ -3091,9 +3090,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "system-configuration"
|
name = "system-configuration"
|
||||||
version = "0.6.1"
|
version = "0.7.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "3c879d448e9d986b661742763247d3693ed13609438cf3d006f51f5368a5ba6b"
|
checksum = "a13f3d0daba03132c0aa9767f98351b3488edc2c100cda2d2ec2b04f3d8d3c8b"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bitflags 2.10.0",
|
"bitflags 2.10.0",
|
||||||
"core-foundation",
|
"core-foundation",
|
||||||
@@ -4230,18 +4229,18 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "zerocopy"
|
name = "zerocopy"
|
||||||
version = "0.8.37"
|
version = "0.8.38"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "7456cf00f0685ad319c5b1693f291a650eaf345e941d082fc4e03df8a03996ac"
|
checksum = "57cf3aa6855b23711ee9852dfc97dfaa51c45feaba5b645d0c777414d494a961"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"zerocopy-derive",
|
"zerocopy-derive",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "zerocopy-derive"
|
name = "zerocopy-derive"
|
||||||
version = "0.8.37"
|
version = "0.8.38"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "1328722bbf2115db7e19d69ebcc15e795719e2d66b60827c6a69a117365e37a0"
|
checksum = "8a616990af1a287837c4fe6596ad77ef57948f787e46ce28e166facc0cc1cb75"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
"quote",
|
"quote",
|
||||||
@@ -4310,6 +4309,6 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "zmij"
|
name = "zmij"
|
||||||
version = "1.0.17"
|
version = "1.0.19"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "02aae0f83f69aafc94776e879363e9771d7ecbffe2c7fbb6c14c5e00dfe88439"
|
checksum = "3ff05f8caa9038894637571ae6b9e29466c1f4f829d26c9b28f869a29cbe3445"
|
||||||
|
|||||||
+34
-34
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "managarr"
|
name = "managarr"
|
||||||
version = "0.7.0"
|
version = "0.7.1"
|
||||||
authors = ["Alex Clarke <alex.j.tusa@gmail.com>"]
|
authors = ["Alex Clarke <alex.j.tusa@gmail.com>"]
|
||||||
description = "A TUI and CLI to manage your Servarrs"
|
description = "A TUI and CLI to manage your Servarrs"
|
||||||
keywords = ["managarr", "ratatui", "dashboard", "servarr", "tui"]
|
keywords = ["managarr", "ratatui", "dashboard", "servarr", "tui"]
|
||||||
@@ -20,67 +20,67 @@ members = [
|
|||||||
]
|
]
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
anyhow = "1.0.68"
|
anyhow = "1.0.100"
|
||||||
backtrace = "0.3.74"
|
backtrace = "0.3.76"
|
||||||
bimap = { version = "0.6.3", features = ["serde"] }
|
bimap = { version = "0.6.3", features = ["serde"] }
|
||||||
chrono = { version = "0.4.38", features = ["serde"] }
|
chrono = { version = "0.4.43", features = ["serde"] }
|
||||||
confy = { version = "2.0.0", default-features = false, features = [
|
confy = { version = "2.0.0", default-features = false, features = [
|
||||||
"yaml_conf",
|
"yaml_conf",
|
||||||
] }
|
] }
|
||||||
crossterm = "0.28.1"
|
crossterm = "0.28.1"
|
||||||
derivative = "2.2.0"
|
derivative = "2.2.0"
|
||||||
human-panic = "2.0.2"
|
human-panic = "2.0.6"
|
||||||
indoc = "2.0.0"
|
indoc = "2.0.7"
|
||||||
log = "0.4.17"
|
log = "0.4.29"
|
||||||
log4rs = { version = "1.2.0", features = ["file_appender"] }
|
log4rs = { version = "1.4.0", features = ["file_appender"] }
|
||||||
regex = "1.11.1"
|
regex = "1.12.2"
|
||||||
reqwest = { version = "0.12.9", features = ["json"] }
|
reqwest = { version = "0.12.28", features = ["json"] }
|
||||||
serde_yaml = "0.9.16"
|
serde_yaml = "0.9.34"
|
||||||
serde_json = "1.0.91"
|
serde_json = "1.0.149"
|
||||||
serde = { version = "1.0.214", features = ["derive"] }
|
serde = { version = "1.0.228", features = ["derive"] }
|
||||||
strum = { version = "0.26.3", features = ["derive"] }
|
strum = { version = "0.26.3", features = ["derive"] }
|
||||||
strum_macros = "0.26.4"
|
strum_macros = "0.26.4"
|
||||||
tokio = { version = "1.44.2", features = ["full"] }
|
tokio = { version = "1.49.0", features = ["full"] }
|
||||||
tokio-util = "0.7.8"
|
tokio-util = "0.7.18"
|
||||||
ratatui = { version = "0.30.0", features = [
|
ratatui = { version = "0.30.0", features = [
|
||||||
"all-widgets",
|
"all-widgets",
|
||||||
"unstable-widget-ref",
|
"unstable-widget-ref",
|
||||||
] }
|
] }
|
||||||
urlencoding = "2.1.2"
|
urlencoding = "2.1.3"
|
||||||
clap = { version = "4.5.20", features = [
|
clap = { version = "4.5.56", features = [
|
||||||
"derive",
|
"derive",
|
||||||
"cargo",
|
"cargo",
|
||||||
"env",
|
"env",
|
||||||
"wrap_help",
|
"wrap_help",
|
||||||
] }
|
] }
|
||||||
clap_complete = "4.5.33"
|
clap_complete = "4.5.65"
|
||||||
itertools = "0.14.0"
|
itertools = "0.14.0"
|
||||||
ctrlc = "3.4.5"
|
ctrlc = "3.5.1"
|
||||||
colored = "3.0.0"
|
colored = "3.1.1"
|
||||||
async-trait = "0.1.83"
|
async-trait = "0.1.89"
|
||||||
dirs-next = "2.0.0"
|
dirs-next = "2.0.0"
|
||||||
managarr-tree-widget = "0.25.0"
|
managarr-tree-widget = "0.25.0"
|
||||||
indicatif = "0.17.9"
|
indicatif = "0.17.11"
|
||||||
derive_setters = "0.1.6"
|
derive_setters = "0.1.9"
|
||||||
deunicode = "1.6.0"
|
deunicode = "1.6.2"
|
||||||
openssl = { version = "0.10.70", features = ["vendored"] }
|
openssl = { version = "0.10.75", features = ["vendored"] }
|
||||||
veil = "0.2.0"
|
veil = "0.2.0"
|
||||||
validate_theme_derive = "0.1.0"
|
validate_theme_derive = "0.1.0"
|
||||||
enum_display_style_derive = "0.1.0"
|
enum_display_style_derive = "0.1.0"
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
assert_cmd = "2.0.16"
|
assert_cmd = "2.1.2"
|
||||||
mockall = "0.13.0"
|
mockall = "0.13.1"
|
||||||
mockito = "1.0.0"
|
mockito = "1.7.1"
|
||||||
pretty_assertions = "1.3.0"
|
pretty_assertions = "1.4.1"
|
||||||
proptest = "1.6.0"
|
proptest = "1.9.0"
|
||||||
rstest = "0.25.0"
|
rstest = "0.25.0"
|
||||||
serial_test = "3.2.0"
|
serial_test = "3.3.1"
|
||||||
assertables = "9.8.2"
|
assertables = "9.8.4"
|
||||||
insta = "1.41.1"
|
insta = "1.46.1"
|
||||||
|
|
||||||
[dev-dependencies.cargo-husky]
|
[dev-dependencies.cargo-husky]
|
||||||
version = "1"
|
version = "1.5.0"
|
||||||
default-features = false
|
default-features = false
|
||||||
features = ["user-hooks"]
|
features = ["user-hooks"]
|
||||||
|
|
||||||
|
|||||||
@@ -21,6 +21,8 @@ RUN mv target/release/managarr .
|
|||||||
|
|
||||||
FROM debian:stable-slim
|
FROM debian:stable-slim
|
||||||
|
|
||||||
|
RUN apt-get update && apt-get install -y --no-install-recommends ca-certificates && rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
# Copy the compiled binary from the builder container
|
# Copy the compiled binary from the builder container
|
||||||
COPY --from=builder --chown=nonroot:nonroot /usr/src/managarr-temp/managarr /usr/local/bin
|
COPY --from=builder --chown=nonroot:nonroot /usr/src/managarr-temp/managarr /usr/local/bin
|
||||||
|
|
||||||
|
|||||||
@@ -55,9 +55,9 @@ Run Managarr as a docker container by mounting your `config.yml` file to `/root/
|
|||||||
docker run --rm -it -v /home/aclarke/.config/managarr/config.yml:/root/.config/managarr/config.yml darkalex17/managarr:latest
|
docker run --rm -it -v /home/aclarke/.config/managarr/config.yml:/root/.config/managarr/config.yml darkalex17/managarr:latest
|
||||||
```
|
```
|
||||||
|
|
||||||
You can also clone this repo and run `make docker` to build a docker image locally and run it using the above command.
|
You can also clone this repo and run `just build-docker` to build a docker image locally and run it using the above command.
|
||||||
|
|
||||||
Please note that you will need to create and popular your configuration file first before starting the container. Otherwise, the container will fail to start.
|
Please note that you will need to create and populate your configuration file first before starting the container. Otherwise, the container will fail to start.
|
||||||
|
|
||||||
**Note:** If you run into errors using relative file paths when mounting the volume with the configuration file, try using an absolute path.
|
**Note:** If you run into errors using relative file paths when mounting the volume with the configuration file, try using an absolute path.
|
||||||
|
|
||||||
@@ -364,7 +364,16 @@ radarr:
|
|||||||
- host: 192.168.0.78
|
- host: 192.168.0.78
|
||||||
port: 7878
|
port: 7878
|
||||||
api_token: someApiToken1234567890
|
api_token: someApiToken1234567890
|
||||||
ssl_cert_path: /path/to/radarr.crt # Required to enable SSL
|
ssl_cert_path: /path/to/radarr.crt # Use the specified SSL certificate to connect to this Servarr
|
||||||
|
# Enables SSL regardless of the value of the 'ssl'
|
||||||
|
# See the SSL Configuration section below for more information
|
||||||
|
|
||||||
|
- host: 192.168.0.79
|
||||||
|
port: 7878
|
||||||
|
api_token: someApiToken1234567890
|
||||||
|
ssl: true # Use SSL to connect to this Servarr
|
||||||
|
# This will assume that you have the SSL certificate installed to your system trust store
|
||||||
|
# See the SSL Configuration section below for more information
|
||||||
|
|
||||||
- uri: http://htpc.local/radarr # Example of using the 'uri' key instead of 'host' and 'port'
|
- uri: http://htpc.local/radarr # Example of using the 'uri' key instead of 'host' and 'port'
|
||||||
api_token: someApiToken1234567890
|
api_token: someApiToken1234567890
|
||||||
@@ -400,6 +409,59 @@ lidarr:
|
|||||||
SOME-OTHER-CUSTOM-HEADER: ${MY_CUSTOM_HEADER_VALUE}
|
SOME-OTHER-CUSTOM-HEADER: ${MY_CUSTOM_HEADER_VALUE}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### SSL Configuration
|
||||||
|
If your Servarr is using SSL or self-signed certificates, you may need to specify additional configuration options to connect without issues.
|
||||||
|
|
||||||
|
|
||||||
|
**If your Servarr's domain CA is installed in the system's trust store:**
|
||||||
|
Then you can simply specify `ssl: true` and Managarr will be able to connect to your Servarr:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
radarr:
|
||||||
|
- host: 192.168.0.78
|
||||||
|
port: 7878
|
||||||
|
api_token: yourApiTokenHere
|
||||||
|
ssl: true
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
**If your Servarr's domain CA is not installed:**
|
||||||
|
You'll either need to specify the path to the certificate via the `ssl_cert_path` property, or you'll need to install the certificate into your system store.
|
||||||
|
|
||||||
|
To acquire the cert for your Servarr's domain, you can use the following command:
|
||||||
|
```shell
|
||||||
|
openssl s_client -show-certs -connect <your-servarr-domain.com>:<port> </dev/null |\
|
||||||
|
sed -n -e '/-.BEGIN/,/-.END/ p' > /path/to/your/servarr.pem
|
||||||
|
```
|
||||||
|
|
||||||
|
Now, you can either specify `ssl_cert_path: /path/to/your/servarr.pem`:
|
||||||
|
|
||||||
|
Example configuration with a certificate that's not installed to the system trust store:
|
||||||
|
```yaml
|
||||||
|
radarr:
|
||||||
|
- host: 192.168.0.78
|
||||||
|
port: 7878
|
||||||
|
api_token: yourApiTokenHere
|
||||||
|
ssl_cert_path: /path/to/your/certificate.crt
|
||||||
|
```
|
||||||
|
|
||||||
|
Or install the certificate into your system's trust store.
|
||||||
|
|
||||||
|
For example, if you're on a Debian-based system and have `ca-certificates` installed (`sudo apt install ca-certificates`):
|
||||||
|
```shell
|
||||||
|
sudo mv /path/to/your/servarr.pem /usr/local/share/ca-certificates/servarr.pem
|
||||||
|
sudo update-ca-certificates
|
||||||
|
```
|
||||||
|
|
||||||
|
Example configuration with a certificate that is installed to the system trust store:
|
||||||
|
```yaml
|
||||||
|
radarr:
|
||||||
|
- host: 192.168.0.78
|
||||||
|
port: 7878
|
||||||
|
api_token: yourApiTokenHere
|
||||||
|
ssl: true
|
||||||
|
```
|
||||||
|
|
||||||
### Example Multi-Instance Configuration:
|
### Example Multi-Instance Configuration:
|
||||||
```yaml
|
```yaml
|
||||||
theme: default
|
theme: default
|
||||||
|
|||||||
@@ -85,5 +85,5 @@ build build_type='debug':
|
|||||||
|
|
||||||
# Build the docker image
|
# Build the docker image
|
||||||
[group: 'build']
|
[group: 'build']
|
||||||
build-docker:
|
build-docker version=VERSION:
|
||||||
@DOCKER_BUILDKIT=1 docker build --rm -t {{IMG_NAME}}:{{VERSION}} .
|
@DOCKER_BUILDKIT=1 docker build --rm -t {{IMG_NAME}}:{{version}} .
|
||||||
|
|||||||
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
tab_spaces=2
|
tab_spaces=2
|
||||||
edition = "2021"
|
edition = "2024"
|
||||||
reorder_imports = true
|
reorder_imports = true
|
||||||
imports_granularity = "Crate"
|
imports_granularity = "Crate"
|
||||||
group_imports = "StdExternalCrate"
|
group_imports = "StdExternalCrate"
|
||||||
|
|||||||
+74
-1
@@ -447,6 +447,78 @@ mod tests {
|
|||||||
assert_none!(config.port);
|
assert_none!(config.port);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
#[serial]
|
||||||
|
fn test_deserialize_optional_env_var_bool_is_bool() {
|
||||||
|
let yaml_data = r#"
|
||||||
|
host: localhost
|
||||||
|
api_token: "test123"
|
||||||
|
ssl: true
|
||||||
|
"#;
|
||||||
|
|
||||||
|
let config: ServarrConfig = serde_yaml::from_str(yaml_data).unwrap();
|
||||||
|
|
||||||
|
assert_some_eq_x!(&config.ssl, &true);
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
#[serial]
|
||||||
|
fn test_deserialize_optional_env_var_bool_is_string() {
|
||||||
|
let yaml_data = r#"
|
||||||
|
host: localhost
|
||||||
|
api_token: "test123"
|
||||||
|
ssl: "true"
|
||||||
|
"#;
|
||||||
|
|
||||||
|
let config: ServarrConfig = serde_yaml::from_str(yaml_data).unwrap();
|
||||||
|
|
||||||
|
assert_some_eq_x!(&config.ssl, &true);
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
#[serial]
|
||||||
|
fn test_deserialize_optional_env_var_bool_is_present() {
|
||||||
|
unsafe { std::env::set_var("TEST_VAR_DESERIALIZE_OPTION_BOOL", "true") };
|
||||||
|
let yaml_data = r#"
|
||||||
|
host: localhost
|
||||||
|
api_token: "test123"
|
||||||
|
ssl: ${TEST_VAR_DESERIALIZE_OPTION_BOOL}
|
||||||
|
"#;
|
||||||
|
|
||||||
|
let config: ServarrConfig = serde_yaml::from_str(yaml_data).unwrap();
|
||||||
|
|
||||||
|
assert_some_eq_x!(&config.ssl, &true);
|
||||||
|
unsafe { std::env::remove_var("TEST_VAR_DESERIALIZE_OPTION_BOOL") };
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
#[serial]
|
||||||
|
fn test_deserialize_optional_env_var_bool_defaults_to_false() {
|
||||||
|
unsafe { std::env::set_var("TEST_VAR_DESERIALIZE_OPTION_BOOL_FALSEY", "test") };
|
||||||
|
let yaml_data = r#"
|
||||||
|
host: localhost
|
||||||
|
api_token: "test123"
|
||||||
|
ssl: ${TEST_VAR_DESERIALIZE_OPTION_BOOL_FALSEY}
|
||||||
|
"#;
|
||||||
|
|
||||||
|
let config: ServarrConfig = serde_yaml::from_str(yaml_data).unwrap();
|
||||||
|
|
||||||
|
assert_some_eq_x!(&config.ssl, &false);
|
||||||
|
unsafe { std::env::remove_var("TEST_VAR_DESERIALIZE_OPTION_BOOL_FALSEY") };
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn test_deserialize_optional_env_var_bool_empty() {
|
||||||
|
let yaml_data = r#"
|
||||||
|
host: localhost
|
||||||
|
api_token: "test123"
|
||||||
|
"#;
|
||||||
|
|
||||||
|
let config: ServarrConfig = serde_yaml::from_str(yaml_data).unwrap();
|
||||||
|
|
||||||
|
assert_none!(config.ssl);
|
||||||
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
#[serial]
|
#[serial]
|
||||||
fn test_deserialize_optional_env_var_header_map_is_present() {
|
fn test_deserialize_optional_env_var_header_map_is_present() {
|
||||||
@@ -674,7 +746,7 @@ mod tests {
|
|||||||
let mut custom_headers = HeaderMap::new();
|
let mut custom_headers = HeaderMap::new();
|
||||||
custom_headers.insert("X-Custom-Header", "value".parse().unwrap());
|
custom_headers.insert("X-Custom-Header", "value".parse().unwrap());
|
||||||
let expected_str = format!(
|
let expected_str = format!(
|
||||||
"ServarrConfig {{ name: Some(\"{name}\"), host: Some(\"{host}\"), port: Some({port}), uri: Some(\"{uri}\"), weight: Some({weight}), api_token: Some(\"***********\"), api_token_file: Some(\"{api_token_file}\"), ssl_cert_path: Some(\"{ssl_cert_path}\"), custom_headers: Some({{\"x-custom-header\": \"value\"}}), monitored_storage_paths: Some([\"/path1\", \"/path2\"]) }}"
|
"ServarrConfig {{ name: Some(\"{name}\"), host: Some(\"{host}\"), port: Some({port}), uri: Some(\"{uri}\"), weight: Some({weight}), api_token: Some(\"***********\"), api_token_file: Some(\"{api_token_file}\"), ssl: Some(true), ssl_cert_path: Some(\"{ssl_cert_path}\"), custom_headers: Some({{\"x-custom-header\": \"value\"}}), monitored_storage_paths: Some([\"/path1\", \"/path2\"]) }}"
|
||||||
);
|
);
|
||||||
let servarr_config = ServarrConfig {
|
let servarr_config = ServarrConfig {
|
||||||
name: Some(name),
|
name: Some(name),
|
||||||
@@ -685,6 +757,7 @@ mod tests {
|
|||||||
api_token: Some(api_token),
|
api_token: Some(api_token),
|
||||||
api_token_file: Some(api_token_file),
|
api_token_file: Some(api_token_file),
|
||||||
ssl_cert_path: Some(ssl_cert_path),
|
ssl_cert_path: Some(ssl_cert_path),
|
||||||
|
ssl: Some(true),
|
||||||
custom_headers: Some(custom_headers),
|
custom_headers: Some(custom_headers),
|
||||||
monitored_storage_paths: Some(monitored_storage),
|
monitored_storage_paths: Some(monitored_storage),
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ use tokio_util::sync::CancellationToken;
|
|||||||
use veil::Redact;
|
use veil::Redact;
|
||||||
|
|
||||||
use crate::cli::Command;
|
use crate::cli::Command;
|
||||||
|
use crate::models::servarr_data::Notification;
|
||||||
use crate::models::servarr_data::lidarr::lidarr_data::{ActiveLidarrBlock, LidarrData};
|
use crate::models::servarr_data::lidarr::lidarr_data::{ActiveLidarrBlock, LidarrData};
|
||||||
use crate::models::servarr_data::radarr::radarr_data::{ActiveRadarrBlock, RadarrData};
|
use crate::models::servarr_data::radarr::radarr_data::{ActiveRadarrBlock, RadarrData};
|
||||||
use crate::models::servarr_data::sonarr::sonarr_data::{ActiveSonarrBlock, SonarrData};
|
use crate::models::servarr_data::sonarr::sonarr_data::{ActiveSonarrBlock, SonarrData};
|
||||||
@@ -38,6 +39,7 @@ pub struct App<'a> {
|
|||||||
pub server_tabs: TabState,
|
pub server_tabs: TabState,
|
||||||
pub keymapping_table: Option<StatefulTable<KeybindingItem>>,
|
pub keymapping_table: Option<StatefulTable<KeybindingItem>>,
|
||||||
pub error: HorizontallyScrollableText,
|
pub error: HorizontallyScrollableText,
|
||||||
|
pub notification: Option<Notification>,
|
||||||
pub tick_until_poll: u64,
|
pub tick_until_poll: u64,
|
||||||
pub ticks_until_scroll: u64,
|
pub ticks_until_scroll: u64,
|
||||||
pub tick_count: u64,
|
pub tick_count: u64,
|
||||||
@@ -254,6 +256,7 @@ impl Default for App<'_> {
|
|||||||
cancellation_token: CancellationToken::new(),
|
cancellation_token: CancellationToken::new(),
|
||||||
keymapping_table: None,
|
keymapping_table: None,
|
||||||
error: HorizontallyScrollableText::default(),
|
error: HorizontallyScrollableText::default(),
|
||||||
|
notification: None,
|
||||||
is_first_render: true,
|
is_first_render: true,
|
||||||
server_tabs: TabState::new(Vec::new()),
|
server_tabs: TabState::new(Vec::new()),
|
||||||
tick_until_poll: 400,
|
tick_until_poll: 400,
|
||||||
@@ -428,6 +431,8 @@ pub struct ServarrConfig {
|
|||||||
pub api_token: Option<String>,
|
pub api_token: Option<String>,
|
||||||
#[serde(default, deserialize_with = "deserialize_optional_env_var")]
|
#[serde(default, deserialize_with = "deserialize_optional_env_var")]
|
||||||
pub api_token_file: Option<String>,
|
pub api_token_file: Option<String>,
|
||||||
|
#[serde(default, deserialize_with = "deserialize_optional_env_var_bool")]
|
||||||
|
pub ssl: Option<bool>,
|
||||||
#[serde(default, deserialize_with = "deserialize_optional_env_var")]
|
#[serde(default, deserialize_with = "deserialize_optional_env_var")]
|
||||||
pub ssl_cert_path: Option<String>,
|
pub ssl_cert_path: Option<String>,
|
||||||
#[serde(
|
#[serde(
|
||||||
@@ -483,6 +488,7 @@ impl Default for ServarrConfig {
|
|||||||
api_token: Some(String::new()),
|
api_token: Some(String::new()),
|
||||||
api_token_file: None,
|
api_token_file: None,
|
||||||
ssl_cert_path: None,
|
ssl_cert_path: None,
|
||||||
|
ssl: None,
|
||||||
custom_headers: None,
|
custom_headers: None,
|
||||||
monitored_storage_paths: None,
|
monitored_storage_paths: None,
|
||||||
}
|
}
|
||||||
@@ -529,6 +535,29 @@ where
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn deserialize_optional_env_var_bool<'de, D>(deserializer: D) -> Result<Option<bool>, D::Error>
|
||||||
|
where
|
||||||
|
D: serde::Deserializer<'de>,
|
||||||
|
{
|
||||||
|
#[derive(Deserialize)]
|
||||||
|
#[serde(untagged)]
|
||||||
|
enum StringOrBool {
|
||||||
|
Bool(bool),
|
||||||
|
String(String),
|
||||||
|
}
|
||||||
|
|
||||||
|
match StringOrBool::deserialize(deserializer)? {
|
||||||
|
StringOrBool::Bool(b) => Ok(Some(b)),
|
||||||
|
StringOrBool::String(s) => {
|
||||||
|
let val = interpolate_env_vars(&s)
|
||||||
|
.to_lowercase()
|
||||||
|
.parse()
|
||||||
|
.unwrap_or(false);
|
||||||
|
Ok(Some(val))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
fn deserialize_optional_env_var_header_map<'de, D>(
|
fn deserialize_optional_env_var_header_map<'de, D>(
|
||||||
deserializer: D,
|
deserializer: D,
|
||||||
) -> Result<Option<HeaderMap>, D::Error>
|
) -> Result<Option<HeaderMap>, D::Error>
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
|
|
||||||
use anyhow::Result;
|
use anyhow::Result;
|
||||||
use clap::{ArgAction, Subcommand, arg};
|
use clap::{ArgAction, Subcommand};
|
||||||
use tokio::sync::Mutex;
|
use tokio::sync::Mutex;
|
||||||
|
|
||||||
use super::LidarrCommand;
|
use super::LidarrCommand;
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
|
|
||||||
use anyhow::Result;
|
use anyhow::Result;
|
||||||
use clap::{Subcommand, arg};
|
use clap::Subcommand;
|
||||||
use serde_json::json;
|
use serde_json::json;
|
||||||
use tokio::sync::Mutex;
|
use tokio::sync::Mutex;
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ use std::sync::Arc;
|
|||||||
|
|
||||||
use add_command_handler::{LidarrAddCommand, LidarrAddCommandHandler};
|
use add_command_handler::{LidarrAddCommand, LidarrAddCommandHandler};
|
||||||
use anyhow::Result;
|
use anyhow::Result;
|
||||||
use clap::{Subcommand, arg};
|
use clap::Subcommand;
|
||||||
use delete_command_handler::{LidarrDeleteCommand, LidarrDeleteCommandHandler};
|
use delete_command_handler::{LidarrDeleteCommand, LidarrDeleteCommandHandler};
|
||||||
use edit_command_handler::{LidarrEditCommand, LidarrEditCommandHandler};
|
use edit_command_handler::{LidarrEditCommand, LidarrEditCommandHandler};
|
||||||
use get_command_handler::{LidarrGetCommand, LidarrGetCommandHandler};
|
use get_command_handler::{LidarrGetCommand, LidarrGetCommandHandler};
|
||||||
|
|||||||
+1
-1
@@ -1,7 +1,7 @@
|
|||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
|
|
||||||
use anyhow::Result;
|
use anyhow::Result;
|
||||||
use clap::{Subcommand, command};
|
use clap::Subcommand;
|
||||||
use clap_complete::Shell;
|
use clap_complete::Shell;
|
||||||
use indoc::indoc;
|
use indoc::indoc;
|
||||||
use lidarr::{LidarrCliHandler, LidarrCommand};
|
use lidarr::{LidarrCliHandler, LidarrCommand};
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
|
|
||||||
use anyhow::Result;
|
use anyhow::Result;
|
||||||
use clap::{ArgAction, Subcommand, arg, command};
|
use clap::{ArgAction, Subcommand};
|
||||||
use tokio::sync::Mutex;
|
use tokio::sync::Mutex;
|
||||||
|
|
||||||
use super::RadarrCommand;
|
use super::RadarrCommand;
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
|
|
||||||
use anyhow::Result;
|
use anyhow::Result;
|
||||||
use clap::{Subcommand, command};
|
use clap::Subcommand;
|
||||||
use tokio::sync::Mutex;
|
use tokio::sync::Mutex;
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
|
|
||||||
use anyhow::Result;
|
use anyhow::Result;
|
||||||
use clap::{Subcommand, command};
|
use clap::Subcommand;
|
||||||
use tokio::sync::Mutex;
|
use tokio::sync::Mutex;
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
|
|||||||
@@ -20,10 +20,10 @@ mod tests {
|
|||||||
use crate::handlers::{handle_events, populate_keymapping_table};
|
use crate::handlers::{handle_events, populate_keymapping_table};
|
||||||
use crate::models::HorizontallyScrollableText;
|
use crate::models::HorizontallyScrollableText;
|
||||||
use crate::models::Route;
|
use crate::models::Route;
|
||||||
use crate::models::servarr_data::ActiveKeybindingBlock;
|
|
||||||
use crate::models::servarr_data::lidarr::lidarr_data::ActiveLidarrBlock;
|
use crate::models::servarr_data::lidarr::lidarr_data::ActiveLidarrBlock;
|
||||||
use crate::models::servarr_data::radarr::radarr_data::{ActiveRadarrBlock, RadarrData};
|
use crate::models::servarr_data::radarr::radarr_data::{ActiveRadarrBlock, RadarrData};
|
||||||
use crate::models::servarr_data::sonarr::sonarr_data::ActiveSonarrBlock;
|
use crate::models::servarr_data::sonarr::sonarr_data::ActiveSonarrBlock;
|
||||||
|
use crate::models::servarr_data::{ActiveKeybindingBlock, Notification};
|
||||||
use crate::models::servarr_models::KeybindingItem;
|
use crate::models::servarr_models::KeybindingItem;
|
||||||
use crate::models::stateful_table::StatefulTable;
|
use crate::models::stateful_table::StatefulTable;
|
||||||
|
|
||||||
@@ -174,6 +174,26 @@ mod tests {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn test_handle_clear_notification() {
|
||||||
|
let mut app = App::test_default();
|
||||||
|
app.notification = Some(Notification::new(
|
||||||
|
"Test".to_owned(),
|
||||||
|
"Test".to_owned(),
|
||||||
|
true,
|
||||||
|
));
|
||||||
|
app.push_navigation_stack(ActiveRadarrBlock::Movies.into());
|
||||||
|
app.push_navigation_stack(ActiveRadarrBlock::MovieDetails.into());
|
||||||
|
|
||||||
|
handle_events(DEFAULT_KEYBINDINGS.esc.key, &mut app);
|
||||||
|
|
||||||
|
assert_none!(app.notification);
|
||||||
|
assert_eq!(
|
||||||
|
app.get_current_route(),
|
||||||
|
ActiveRadarrBlock::MovieDetails.into()
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
#[rstest]
|
#[rstest]
|
||||||
fn test_handle_prompt_toggle_left_right_radarr(#[values(Key::Left, Key::Right)] key: Key) {
|
fn test_handle_prompt_toggle_left_right_radarr(#[values(Key::Left, Key::Right)] key: Key) {
|
||||||
let mut app = App::test_default();
|
let mut app = App::test_default();
|
||||||
@@ -284,6 +304,39 @@ mod tests {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn test_handle_events_esc_clears_notification() {
|
||||||
|
let mut app = App::test_default();
|
||||||
|
app.notification = Some(Notification::new(
|
||||||
|
"Download Result".to_owned(),
|
||||||
|
"Download request sent successfully".to_owned(),
|
||||||
|
true,
|
||||||
|
));
|
||||||
|
app.push_navigation_stack(ActiveRadarrBlock::Movies.into());
|
||||||
|
|
||||||
|
handle_events(DEFAULT_KEYBINDINGS.esc.key, &mut app);
|
||||||
|
|
||||||
|
assert_none!(app.notification);
|
||||||
|
assert_eq!(app.get_current_route(), ActiveRadarrBlock::Movies.into());
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn test_handle_events_esc_does_not_clear_notification_when_none() {
|
||||||
|
let mut app = App::test_default();
|
||||||
|
app
|
||||||
|
.data
|
||||||
|
.radarr_data
|
||||||
|
.movies
|
||||||
|
.set_items(vec![Movie::default()]);
|
||||||
|
app.push_navigation_stack(ActiveRadarrBlock::Movies.into());
|
||||||
|
app.push_navigation_stack(ActiveRadarrBlock::SearchMovie.into());
|
||||||
|
|
||||||
|
handle_events(DEFAULT_KEYBINDINGS.esc.key, &mut app);
|
||||||
|
|
||||||
|
assert_none!(app.notification);
|
||||||
|
assert_navigation_popped!(app, ActiveRadarrBlock::Movies.into());
|
||||||
|
}
|
||||||
|
|
||||||
fn context_clue_to_keybinding_item(key: &KeyBinding, desc: &&str) -> KeybindingItem {
|
fn context_clue_to_keybinding_item(key: &KeyBinding, desc: &&str) -> KeybindingItem {
|
||||||
let (key, alt_key) = if key.alt.is_some() {
|
let (key, alt_key) = if key.alt.is_some() {
|
||||||
(key.key.to_string(), key.alt.as_ref().unwrap().to_string())
|
(key.key.to_string(), key.alt.as_ref().unwrap().to_string())
|
||||||
|
|||||||
@@ -116,6 +116,8 @@ pub fn handle_events(key: Key, app: &mut App<'_>) {
|
|||||||
} else {
|
} else {
|
||||||
app.keymapping_table = None;
|
app.keymapping_table = None;
|
||||||
}
|
}
|
||||||
|
} else if matches_key!(esc, key) && app.notification.is_some() {
|
||||||
|
app.notification.take();
|
||||||
} else {
|
} else {
|
||||||
match app.get_current_route() {
|
match app.get_current_route() {
|
||||||
_ if app.keymapping_table.is_some() => {
|
_ if app.keymapping_table.is_some() => {
|
||||||
|
|||||||
+5
-1
@@ -185,7 +185,11 @@ async fn main() -> Result<()> {
|
|||||||
generate(shell, &mut cli, "managarr", &mut io::stdout())
|
generate(shell, &mut cli, "managarr", &mut io::stdout())
|
||||||
}
|
}
|
||||||
Command::TailLogs { no_color } => tail_logs(no_color).await?,
|
Command::TailLogs { no_color } => tail_logs(no_color).await?,
|
||||||
_ => {}
|
Command::ConfigPath => {
|
||||||
|
unreachable!(
|
||||||
|
"ConfigPath command is handled before this match and should be unreachable here"
|
||||||
|
);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
None => {
|
None => {
|
||||||
let app_nw = Arc::clone(&app);
|
let app_nw = Arc::clone(&app);
|
||||||
|
|||||||
@@ -10,6 +10,23 @@ pub(in crate::models::servarr_data) mod data_test_utils;
|
|||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod servarr_data_tests;
|
mod servarr_data_tests;
|
||||||
|
|
||||||
|
#[derive(Clone, Debug, PartialEq, Eq)]
|
||||||
|
pub struct Notification {
|
||||||
|
pub title: String,
|
||||||
|
pub message: String,
|
||||||
|
pub success: bool,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl Notification {
|
||||||
|
pub fn new(title: String, message: String, success: bool) -> Self {
|
||||||
|
Self {
|
||||||
|
title,
|
||||||
|
message,
|
||||||
|
success,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#[derive(Clone, Copy, PartialEq, Eq, Debug, Default)]
|
#[derive(Clone, Copy, PartialEq, Eq, Debug, Default)]
|
||||||
pub enum ActiveKeybindingBlock {
|
pub enum ActiveKeybindingBlock {
|
||||||
#[default]
|
#[default]
|
||||||
|
|||||||
@@ -1,8 +1,10 @@
|
|||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests {
|
mod tests {
|
||||||
use crate::models::lidarr_models::LidarrReleaseDownloadBody;
|
use crate::models::lidarr_models::LidarrReleaseDownloadBody;
|
||||||
|
use crate::models::servarr_data::Notification;
|
||||||
use crate::network::lidarr_network::LidarrEvent;
|
use crate::network::lidarr_network::LidarrEvent;
|
||||||
use crate::network::network_tests::test_utils::{MockServarrApi, test_network};
|
use crate::network::network_tests::test_utils::{MockServarrApi, test_network};
|
||||||
|
use pretty_assertions::assert_eq;
|
||||||
use serde_json::json;
|
use serde_json::json;
|
||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
@@ -30,5 +32,51 @@ mod tests {
|
|||||||
|
|
||||||
mock.assert_async().await;
|
mock.assert_async().await;
|
||||||
assert_ok!(result);
|
assert_ok!(result);
|
||||||
|
assert_eq!(
|
||||||
|
app.lock().await.notification,
|
||||||
|
Some(Notification::new(
|
||||||
|
"Download Result".to_owned(),
|
||||||
|
"Download request sent successfully".to_owned(),
|
||||||
|
true,
|
||||||
|
))
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
#[tokio::test]
|
||||||
|
async fn test_handle_download_lidarr_release_event_sets_failure_notification_on_error() {
|
||||||
|
let params = LidarrReleaseDownloadBody {
|
||||||
|
guid: "1234".to_owned(),
|
||||||
|
indexer_id: 2,
|
||||||
|
};
|
||||||
|
|
||||||
|
let (mock, app, _server) = MockServarrApi::post()
|
||||||
|
.with_request_body(json!({
|
||||||
|
"guid": "1234",
|
||||||
|
"indexerId": 2,
|
||||||
|
}))
|
||||||
|
.returns(json!({}))
|
||||||
|
.status(500)
|
||||||
|
.build_for(LidarrEvent::DownloadRelease(params.clone()))
|
||||||
|
.await;
|
||||||
|
|
||||||
|
app.lock().await.server_tabs.set_index(2);
|
||||||
|
let mut network = test_network(&app);
|
||||||
|
|
||||||
|
let result = network
|
||||||
|
.handle_lidarr_event(LidarrEvent::DownloadRelease(params))
|
||||||
|
.await;
|
||||||
|
|
||||||
|
mock.assert_async().await;
|
||||||
|
assert_err!(result);
|
||||||
|
let app = app.lock().await;
|
||||||
|
assert_is_empty!(app.error.text);
|
||||||
|
assert_some_eq_x!(
|
||||||
|
&app.notification,
|
||||||
|
&Notification::new(
|
||||||
|
"Download Failed".to_owned(),
|
||||||
|
"Download request failed. Check the logs for more details.".to_owned(),
|
||||||
|
false,
|
||||||
|
)
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
use crate::models::lidarr_models::LidarrReleaseDownloadBody;
|
use crate::models::lidarr_models::LidarrReleaseDownloadBody;
|
||||||
|
use crate::models::servarr_data::Notification;
|
||||||
use crate::network::lidarr_network::LidarrEvent;
|
use crate::network::lidarr_network::LidarrEvent;
|
||||||
use crate::network::{Network, RequestMethod};
|
use crate::network::{Network, RequestMethod};
|
||||||
use anyhow::Result;
|
use anyhow::Result;
|
||||||
@@ -31,8 +32,26 @@ impl Network<'_, '_> {
|
|||||||
)
|
)
|
||||||
.await;
|
.await;
|
||||||
|
|
||||||
self
|
let result = self
|
||||||
.handle_request::<LidarrReleaseDownloadBody, Value>(request_props, |_, _| ())
|
.handle_request::<LidarrReleaseDownloadBody, Value>(request_props, |_, mut app| {
|
||||||
.await
|
app.notification = Some(Notification::new(
|
||||||
|
"Download Result".to_owned(),
|
||||||
|
"Download request sent successfully".to_owned(),
|
||||||
|
true,
|
||||||
|
));
|
||||||
|
})
|
||||||
|
.await;
|
||||||
|
|
||||||
|
if result.is_err() {
|
||||||
|
let mut app = self.app.lock().await;
|
||||||
|
std::mem::take(&mut app.error.text);
|
||||||
|
app.notification = Some(Notification::new(
|
||||||
|
"Download Failed".to_owned(),
|
||||||
|
"Download request failed. Check the logs for more details.".to_owned(),
|
||||||
|
false,
|
||||||
|
));
|
||||||
|
}
|
||||||
|
|
||||||
|
result
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-1
@@ -229,6 +229,7 @@ impl<'a, 'b> Network<'a, 'b> {
|
|||||||
uri,
|
uri,
|
||||||
api_token,
|
api_token,
|
||||||
ssl_cert_path,
|
ssl_cert_path,
|
||||||
|
ssl,
|
||||||
custom_headers: custom_headers_option,
|
custom_headers: custom_headers_option,
|
||||||
..
|
..
|
||||||
} = app
|
} = app
|
||||||
@@ -245,7 +246,7 @@ impl<'a, 'b> Network<'a, 'b> {
|
|||||||
let mut uri = if let Some(servarr_uri) = uri {
|
let mut uri = if let Some(servarr_uri) = uri {
|
||||||
format!("{servarr_uri}/api/{api_version}{resource}")
|
format!("{servarr_uri}/api/{api_version}{resource}")
|
||||||
} else {
|
} else {
|
||||||
let protocol = if ssl_cert_path.is_some() {
|
let protocol = if ssl_cert_path.is_some() || ssl.unwrap_or(false) {
|
||||||
"https"
|
"https"
|
||||||
} else {
|
} else {
|
||||||
"http"
|
"http"
|
||||||
|
|||||||
@@ -409,7 +409,7 @@ mod tests {
|
|||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
#[should_panic(expected = "Servarr config is undefined")]
|
#[should_panic(expected = "Servarr config is undefined")]
|
||||||
#[rstest]
|
#[rstest]
|
||||||
async fn test_request_props_from_requires_radarr_config_to_be_present_for_all_network_events(
|
async fn test_request_props_from_requires_config_to_be_present_for_all_network_events(
|
||||||
#[values(RadarrEvent::HealthCheck, SonarrEvent::HealthCheck)] network_event: impl Into<NetworkEvent>
|
#[values(RadarrEvent::HealthCheck, SonarrEvent::HealthCheck)] network_event: impl Into<NetworkEvent>
|
||||||
+ NetworkResource,
|
+ NetworkResource,
|
||||||
) {
|
) {
|
||||||
@@ -492,6 +492,82 @@ mod tests {
|
|||||||
assert!(request_props.custom_headers.is_empty());
|
assert!(request_props.custom_headers.is_empty());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[rstest]
|
||||||
|
#[tokio::test]
|
||||||
|
async fn test_request_props_from_custom_config_ssl_doesnt_affect_ssl_cert_path(
|
||||||
|
#[values(RadarrEvent::GetMovies, SonarrEvent::ListSeries)] network_event: impl Into<NetworkEvent>
|
||||||
|
+ NetworkResource,
|
||||||
|
#[values(Some(true), Some(false), None)] ssl_option: Option<bool>,
|
||||||
|
) {
|
||||||
|
let api_token = "testToken1234".to_owned();
|
||||||
|
let app_arc = Arc::new(Mutex::new(App::test_default()));
|
||||||
|
let resource = network_event.resource();
|
||||||
|
let servarr_config = ServarrConfig {
|
||||||
|
host: Some("192.168.0.123".to_owned()),
|
||||||
|
port: Some(8080),
|
||||||
|
api_token: Some(api_token.clone()),
|
||||||
|
ssl_cert_path: Some("/test/cert.crt".to_owned()),
|
||||||
|
ssl: ssl_option,
|
||||||
|
..ServarrConfig::default()
|
||||||
|
};
|
||||||
|
{
|
||||||
|
let mut app = app_arc.lock().await;
|
||||||
|
app.server_tabs.tabs[0].config = Some(servarr_config.clone());
|
||||||
|
app.server_tabs.tabs[1].config = Some(servarr_config);
|
||||||
|
}
|
||||||
|
let network = test_network(&app_arc);
|
||||||
|
|
||||||
|
let request_props = network
|
||||||
|
.request_props_from(network_event, RequestMethod::Get, None::<()>, None, None)
|
||||||
|
.await;
|
||||||
|
|
||||||
|
assert_str_eq!(
|
||||||
|
request_props.uri,
|
||||||
|
format!("https://192.168.0.123:8080/api/v3{resource}")
|
||||||
|
);
|
||||||
|
assert_eq!(request_props.method, RequestMethod::Get);
|
||||||
|
assert_eq!(request_props.body, None);
|
||||||
|
assert_str_eq!(request_props.api_token, api_token);
|
||||||
|
assert!(request_props.custom_headers.is_empty());
|
||||||
|
}
|
||||||
|
|
||||||
|
#[rstest]
|
||||||
|
#[tokio::test]
|
||||||
|
async fn test_request_props_uses_ssl_property(
|
||||||
|
#[values(RadarrEvent::GetMovies, SonarrEvent::ListSeries)] network_event: impl Into<NetworkEvent>
|
||||||
|
+ NetworkResource,
|
||||||
|
) {
|
||||||
|
let api_token = "testToken1234".to_owned();
|
||||||
|
let app_arc = Arc::new(Mutex::new(App::test_default()));
|
||||||
|
let resource = network_event.resource();
|
||||||
|
let servarr_config = ServarrConfig {
|
||||||
|
host: Some("192.168.0.123".to_owned()),
|
||||||
|
port: Some(8080),
|
||||||
|
api_token: Some(api_token.clone()),
|
||||||
|
ssl: Some(true),
|
||||||
|
..ServarrConfig::default()
|
||||||
|
};
|
||||||
|
{
|
||||||
|
let mut app = app_arc.lock().await;
|
||||||
|
app.server_tabs.tabs[0].config = Some(servarr_config.clone());
|
||||||
|
app.server_tabs.tabs[1].config = Some(servarr_config);
|
||||||
|
}
|
||||||
|
let network = test_network(&app_arc);
|
||||||
|
|
||||||
|
let request_props = network
|
||||||
|
.request_props_from(network_event, RequestMethod::Get, None::<()>, None, None)
|
||||||
|
.await;
|
||||||
|
|
||||||
|
assert_str_eq!(
|
||||||
|
request_props.uri,
|
||||||
|
format!("https://192.168.0.123:8080/api/v3{resource}")
|
||||||
|
);
|
||||||
|
assert_eq!(request_props.method, RequestMethod::Get);
|
||||||
|
assert_eq!(request_props.body, None);
|
||||||
|
assert_str_eq!(request_props.api_token, api_token);
|
||||||
|
assert!(request_props.custom_headers.is_empty());
|
||||||
|
}
|
||||||
|
|
||||||
#[rstest]
|
#[rstest]
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
async fn test_request_props_from_custom_config_custom_headers(
|
async fn test_request_props_from_custom_config_custom_headers(
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ use crate::models::radarr_models::{
|
|||||||
EditMovieParams, Movie, MovieCommandBody, MovieHistoryItem, RadarrRelease,
|
EditMovieParams, Movie, MovieCommandBody, MovieHistoryItem, RadarrRelease,
|
||||||
RadarrReleaseDownloadBody,
|
RadarrReleaseDownloadBody,
|
||||||
};
|
};
|
||||||
|
use crate::models::servarr_data::Notification;
|
||||||
use crate::models::servarr_data::radarr::modals::MovieDetailsModal;
|
use crate::models::servarr_data::radarr::modals::MovieDetailsModal;
|
||||||
use crate::models::servarr_data::radarr::radarr_data::ActiveRadarrBlock;
|
use crate::models::servarr_data::radarr::radarr_data::ActiveRadarrBlock;
|
||||||
use crate::models::stateful_table::StatefulTable;
|
use crate::models::stateful_table::StatefulTable;
|
||||||
@@ -85,9 +86,27 @@ impl Network<'_, '_> {
|
|||||||
.request_props_from(event, RequestMethod::Post, Some(params), None, None)
|
.request_props_from(event, RequestMethod::Post, Some(params), None, None)
|
||||||
.await;
|
.await;
|
||||||
|
|
||||||
self
|
let result = self
|
||||||
.handle_request::<RadarrReleaseDownloadBody, Value>(request_props, |_, _| ())
|
.handle_request::<RadarrReleaseDownloadBody, Value>(request_props, |_, mut app| {
|
||||||
.await
|
app.notification = Some(Notification::new(
|
||||||
|
"Download Result".to_owned(),
|
||||||
|
"Download request sent successfully".to_owned(),
|
||||||
|
true,
|
||||||
|
));
|
||||||
|
})
|
||||||
|
.await;
|
||||||
|
|
||||||
|
if result.is_err() {
|
||||||
|
let mut app = self.app.lock().await;
|
||||||
|
std::mem::take(&mut app.error.text);
|
||||||
|
app.notification = Some(Notification::new(
|
||||||
|
"Download Failed".to_owned(),
|
||||||
|
"Download request failed. Check the logs for more details.".to_owned(),
|
||||||
|
false,
|
||||||
|
));
|
||||||
|
}
|
||||||
|
|
||||||
|
result
|
||||||
}
|
}
|
||||||
|
|
||||||
pub(in crate::network::radarr_network) async fn edit_movie(
|
pub(in crate::network::radarr_network) async fn edit_movie(
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ mod tests {
|
|||||||
AddMovieBody, AddMovieOptions, Credit, DeleteMovieParams, DownloadRecord, EditMovieParams,
|
AddMovieBody, AddMovieOptions, Credit, DeleteMovieParams, DownloadRecord, EditMovieParams,
|
||||||
MinimumAvailability, Movie, MovieHistoryItem, MovieMonitor, RadarrReleaseDownloadBody,
|
MinimumAvailability, Movie, MovieHistoryItem, MovieMonitor, RadarrReleaseDownloadBody,
|
||||||
};
|
};
|
||||||
|
use crate::models::servarr_data::Notification;
|
||||||
use crate::models::servarr_data::radarr::modals::MovieDetailsModal;
|
use crate::models::servarr_data::radarr::modals::MovieDetailsModal;
|
||||||
use crate::models::servarr_data::radarr::radarr_data::ActiveRadarrBlock;
|
use crate::models::servarr_data::radarr::radarr_data::ActiveRadarrBlock;
|
||||||
use crate::models::stateful_table::SortOption;
|
use crate::models::stateful_table::SortOption;
|
||||||
@@ -164,14 +165,58 @@ mod tests {
|
|||||||
.await;
|
.await;
|
||||||
let mut network = test_network(&app);
|
let mut network = test_network(&app);
|
||||||
|
|
||||||
assert!(
|
let result = network
|
||||||
network
|
.handle_radarr_event(RadarrEvent::DownloadRelease(expected_body))
|
||||||
.handle_radarr_event(RadarrEvent::DownloadRelease(expected_body))
|
.await;
|
||||||
.await
|
|
||||||
.is_ok()
|
|
||||||
);
|
|
||||||
|
|
||||||
mock.assert_async().await;
|
mock.assert_async().await;
|
||||||
|
assert_ok!(result);
|
||||||
|
assert_some_eq_x!(
|
||||||
|
&app.lock().await.notification,
|
||||||
|
&Notification::new(
|
||||||
|
"Download Result".to_owned(),
|
||||||
|
"Download request sent successfully".to_owned(),
|
||||||
|
true,
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
#[tokio::test]
|
||||||
|
async fn test_handle_download_radarr_release_event_sets_failure_notification_on_error() {
|
||||||
|
let expected_body = RadarrReleaseDownloadBody {
|
||||||
|
guid: "1234".to_owned(),
|
||||||
|
indexer_id: 2,
|
||||||
|
movie_id: 1,
|
||||||
|
};
|
||||||
|
let body = json!({
|
||||||
|
"guid": "1234",
|
||||||
|
"indexerId": 2,
|
||||||
|
"movieId": 1
|
||||||
|
});
|
||||||
|
let (mock, app, _server) = MockServarrApi::post()
|
||||||
|
.with_request_body(body)
|
||||||
|
.returns(json!({}))
|
||||||
|
.status(500)
|
||||||
|
.build_for(RadarrEvent::DownloadRelease(expected_body.clone()))
|
||||||
|
.await;
|
||||||
|
let mut network = test_network(&app);
|
||||||
|
|
||||||
|
let result = network
|
||||||
|
.handle_radarr_event(RadarrEvent::DownloadRelease(expected_body))
|
||||||
|
.await;
|
||||||
|
|
||||||
|
mock.assert_async().await;
|
||||||
|
assert_err!(result);
|
||||||
|
let app = app.lock().await;
|
||||||
|
assert_is_empty!(app.error.text);
|
||||||
|
assert_some_eq_x!(
|
||||||
|
&app.notification,
|
||||||
|
&Notification::new(
|
||||||
|
"Download Failed".to_owned(),
|
||||||
|
"Download request failed. Check the logs for more details.".to_owned(),
|
||||||
|
false,
|
||||||
|
)
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
use crate::models::servarr_data::Notification;
|
||||||
use crate::models::sonarr_models::SonarrReleaseDownloadBody;
|
use crate::models::sonarr_models::SonarrReleaseDownloadBody;
|
||||||
use crate::network::sonarr_network::SonarrEvent;
|
use crate::network::sonarr_network::SonarrEvent;
|
||||||
use crate::network::{Network, RequestMethod};
|
use crate::network::{Network, RequestMethod};
|
||||||
@@ -31,8 +32,26 @@ impl Network<'_, '_> {
|
|||||||
)
|
)
|
||||||
.await;
|
.await;
|
||||||
|
|
||||||
self
|
let result = self
|
||||||
.handle_request::<SonarrReleaseDownloadBody, Value>(request_props, |_, _| ())
|
.handle_request::<SonarrReleaseDownloadBody, Value>(request_props, |_, mut app| {
|
||||||
.await
|
app.notification = Some(Notification::new(
|
||||||
|
"Download Result".to_owned(),
|
||||||
|
"Download request sent successfully".to_owned(),
|
||||||
|
true,
|
||||||
|
));
|
||||||
|
})
|
||||||
|
.await;
|
||||||
|
|
||||||
|
if result.is_err() {
|
||||||
|
let mut app = self.app.lock().await;
|
||||||
|
std::mem::take(&mut app.error.text);
|
||||||
|
app.notification = Some(Notification::new(
|
||||||
|
"Download Failed".to_owned(),
|
||||||
|
"Download request failed. Check the logs for more details.".to_owned(),
|
||||||
|
false,
|
||||||
|
));
|
||||||
|
}
|
||||||
|
|
||||||
|
result
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,8 +1,10 @@
|
|||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests {
|
mod tests {
|
||||||
|
use crate::models::servarr_data::Notification;
|
||||||
use crate::models::sonarr_models::SonarrReleaseDownloadBody;
|
use crate::models::sonarr_models::SonarrReleaseDownloadBody;
|
||||||
use crate::network::network_tests::test_utils::{MockServarrApi, test_network};
|
use crate::network::network_tests::test_utils::{MockServarrApi, test_network};
|
||||||
use crate::network::sonarr_network::SonarrEvent;
|
use crate::network::sonarr_network::SonarrEvent;
|
||||||
|
use pretty_assertions::assert_eq;
|
||||||
use serde_json::json;
|
use serde_json::json;
|
||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
@@ -33,5 +35,54 @@ mod tests {
|
|||||||
|
|
||||||
mock.assert_async().await;
|
mock.assert_async().await;
|
||||||
assert_ok!(result);
|
assert_ok!(result);
|
||||||
|
assert_eq!(
|
||||||
|
app.lock().await.notification,
|
||||||
|
Some(Notification::new(
|
||||||
|
"Download Result".to_owned(),
|
||||||
|
"Download request sent successfully".to_owned(),
|
||||||
|
true,
|
||||||
|
))
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
#[tokio::test]
|
||||||
|
async fn test_handle_download_sonarr_release_event_sets_failure_notification_on_error() {
|
||||||
|
let params = SonarrReleaseDownloadBody {
|
||||||
|
guid: "1234".to_owned(),
|
||||||
|
indexer_id: 2,
|
||||||
|
series_id: Some(1),
|
||||||
|
..SonarrReleaseDownloadBody::default()
|
||||||
|
};
|
||||||
|
|
||||||
|
let (mock, app, _server) = MockServarrApi::post()
|
||||||
|
.with_request_body(json!({
|
||||||
|
"guid": "1234",
|
||||||
|
"indexerId": 2,
|
||||||
|
"seriesId": 1,
|
||||||
|
}))
|
||||||
|
.returns(json!({}))
|
||||||
|
.status(500)
|
||||||
|
.build_for(SonarrEvent::DownloadRelease(params.clone()))
|
||||||
|
.await;
|
||||||
|
|
||||||
|
app.lock().await.server_tabs.next();
|
||||||
|
let mut network = test_network(&app);
|
||||||
|
|
||||||
|
let result = network
|
||||||
|
.handle_sonarr_event(SonarrEvent::DownloadRelease(params))
|
||||||
|
.await;
|
||||||
|
|
||||||
|
mock.assert_async().await;
|
||||||
|
assert_err!(result);
|
||||||
|
let app = app.lock().await;
|
||||||
|
assert_is_empty!(app.error.text);
|
||||||
|
assert_some_eq_x!(
|
||||||
|
&app.notification,
|
||||||
|
&Notification::new(
|
||||||
|
"Download Failed".to_owned(),
|
||||||
|
"Download request failed. Check the logs for more details.".to_owned(),
|
||||||
|
false,
|
||||||
|
)
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -356,12 +356,12 @@ fn draw_album_releases(f: &mut Frame<'_>, app: &mut App<'_>, area: Rect) {
|
|||||||
.clone()
|
.clone()
|
||||||
.unwrap_or(Number::from(0u64))
|
.unwrap_or(Number::from(0u64))
|
||||||
.as_u64()
|
.as_u64()
|
||||||
.unwrap();
|
.unwrap_or_default();
|
||||||
let leechers = leechers
|
let leechers = leechers
|
||||||
.clone()
|
.clone()
|
||||||
.unwrap_or(Number::from(0u64))
|
.unwrap_or(Number::from(0u64))
|
||||||
.as_u64()
|
.as_u64()
|
||||||
.unwrap();
|
.unwrap_or_default();
|
||||||
|
|
||||||
decorate_peer_style(
|
decorate_peer_style(
|
||||||
seeders,
|
seeders,
|
||||||
|
|||||||
@@ -501,12 +501,12 @@ fn draw_artist_releases(f: &mut Frame<'_>, app: &mut App<'_>, area: Rect) {
|
|||||||
.clone()
|
.clone()
|
||||||
.unwrap_or(Number::from(0u64))
|
.unwrap_or(Number::from(0u64))
|
||||||
.as_u64()
|
.as_u64()
|
||||||
.unwrap();
|
.unwrap_or_default();
|
||||||
let leechers = leechers
|
let leechers = leechers
|
||||||
.clone()
|
.clone()
|
||||||
.unwrap_or(Number::from(0u64))
|
.unwrap_or(Number::from(0u64))
|
||||||
.as_u64()
|
.as_u64()
|
||||||
.unwrap();
|
.unwrap_or_default();
|
||||||
|
|
||||||
decorate_peer_style(
|
decorate_peer_style(
|
||||||
seeders,
|
seeders,
|
||||||
|
|||||||
+23
-1
@@ -14,6 +14,7 @@ use sonarr_ui::SonarrUi;
|
|||||||
use utils::layout_block;
|
use utils::layout_block;
|
||||||
|
|
||||||
use crate::app::App;
|
use crate::app::App;
|
||||||
|
use crate::models::servarr_data::Notification;
|
||||||
use crate::models::servarr_models::KeybindingItem;
|
use crate::models::servarr_models::KeybindingItem;
|
||||||
use crate::models::{HorizontallyScrollableText, Route, TabState};
|
use crate::models::{HorizontallyScrollableText, Route, TabState};
|
||||||
use crate::ui::radarr_ui::RadarrUi;
|
use crate::ui::radarr_ui::RadarrUi;
|
||||||
@@ -25,7 +26,8 @@ use crate::ui::utils::{
|
|||||||
};
|
};
|
||||||
use crate::ui::widgets::input_box::InputBox;
|
use crate::ui::widgets::input_box::InputBox;
|
||||||
use crate::ui::widgets::managarr_table::ManagarrTable;
|
use crate::ui::widgets::managarr_table::ManagarrTable;
|
||||||
use crate::ui::widgets::popup::Size;
|
use crate::ui::widgets::message::Message;
|
||||||
|
use crate::ui::widgets::popup::{Popup, Size};
|
||||||
|
|
||||||
mod builtin_themes;
|
mod builtin_themes;
|
||||||
mod lidarr_ui;
|
mod lidarr_ui;
|
||||||
@@ -95,6 +97,10 @@ pub fn ui(f: &mut Frame<'_>, app: &mut App<'_>) {
|
|||||||
_ => (),
|
_ => (),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if let Some(notification) = &app.notification {
|
||||||
|
draw_notification_popup(f, notification);
|
||||||
|
}
|
||||||
|
|
||||||
if app.keymapping_table.is_some() {
|
if app.keymapping_table.is_some() {
|
||||||
draw_help_popup(f, app);
|
draw_help_popup(f, app);
|
||||||
}
|
}
|
||||||
@@ -183,6 +189,22 @@ pub fn draw_help_popup(f: &mut Frame<'_>, app: &mut App<'_>) {
|
|||||||
f.render_widget(keymapping_table, table_area);
|
f.render_widget(keymapping_table, table_area);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn draw_notification_popup(f: &mut Frame<'_>, notification: &Notification) {
|
||||||
|
let style = if notification.success {
|
||||||
|
styles::success_style().bold()
|
||||||
|
} else {
|
||||||
|
styles::failure_style().bold()
|
||||||
|
};
|
||||||
|
|
||||||
|
let popup = Popup::new(
|
||||||
|
Message::new(notification.message.as_str())
|
||||||
|
.title(notification.title.as_str())
|
||||||
|
.style(style),
|
||||||
|
)
|
||||||
|
.size(Size::Message);
|
||||||
|
f.render_widget(popup, f.area());
|
||||||
|
}
|
||||||
|
|
||||||
fn draw_tabs(f: &mut Frame<'_>, area: Rect, title: &str, tab_state: &TabState) -> Rect {
|
fn draw_tabs(f: &mut Frame<'_>, area: Rect, title: &str, tab_state: &TabState) -> Rect {
|
||||||
if title.is_empty() {
|
if title.is_empty() {
|
||||||
f.render_widget(layout_block().default_color(), area);
|
f.render_widget(layout_block().default_color(), area);
|
||||||
|
|||||||
+54
@@ -0,0 +1,54 @@
|
|||||||
|
---
|
||||||
|
source: src/ui/ui_tests.rs
|
||||||
|
expression: output
|
||||||
|
---
|
||||||
|
╭ Managarr - A Servarr management TUI ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
|
||||||
|
│ Radarr │ Sonarr │ Lidarr <?> to open help│
|
||||||
|
╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
|
||||||
|
╭ Stats ──────────────────────────────────────────────────────────────╮╭ Downloads ─────────────────────────────────────────────────────────╮╭──────────────────╮
|
||||||
|
│Lidarr Version: 1.2.3.4 ││Test download title ││ ⠀⠀⠀⣠⣴⣶⡿⠻⣿⣶⣦⣄⠀⠀⠀ │
|
||||||
|
│Uptime: 0d 00:00:44 ││50% ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━││ ⠀⢠⣾⠟⠋⠀⠀⢀⣀⠀⠙⠻⣷⡄⠀ │
|
||||||
|
│Storage: ││ ││ ⢠⣿⠋⠀⣴⠃⠀⢸⣿⣿⣦⡀⠙⣿⡄ │
|
||||||
|
│/path: 100% ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━││ ││ ⣾⡟⠀⢸⠃⠀⠀⠀⠈⠉⠉⠁⠀⢹⣷ │
|
||||||
|
│Root Folders: ││ ││ ⢿⣧⠀⠈⠀⠀⠀⠀⠀⠀⢀⡟⠀⣸⡿ │
|
||||||
|
│/nfs: 204800.00 GB free ││ ││ ⠘⣿⣄⠀⠻⣿⣿⡇⠀⢀⠞⠀⣠⣿⠃ │
|
||||||
|
│ ││ ││ ⠀⠘⢿⣦⣄⠀⠉⠁⠀⠀⣠⣴⡿⠃⠀ │
|
||||||
|
│ ││ ││ ⠀⠀⠀⠉⠻⠿⢿⡆⡾⠿⠟⠉⠀⠀⠀ │
|
||||||
|
╰───────────────────────────────────────────────────────────────────────╯╰──────────────────────────────────────────────────────────────────────╯╰──────────────────╯
|
||||||
|
╭ Artists ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
|
||||||
|
│ Library │ Downloads │ Blocklist │ History │ Root Folders │ Indexers │ System │
|
||||||
|
│───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────│
|
||||||
|
│ Name ▼ Type Status Quality Profile Metadata Profile Albums Tracks Size Monitored Tags │
|
||||||
|
│=> Alex Person Continuing Lossless Standard 1 15/15 0.00 GB 🏷 alex │
|
||||||
|
│ │
|
||||||
|
│ │
|
||||||
|
│ │
|
||||||
|
│ │
|
||||||
|
│ │
|
||||||
|
│ ╭────────── Download Result ──────────╮ │
|
||||||
|
│ │ Download request sent successfully │ │
|
||||||
|
│ │ │ │
|
||||||
|
│ ╰───────────────────────────────────────╯ │
|
||||||
|
│ │
|
||||||
|
│ │
|
||||||
|
│ │
|
||||||
|
│ │
|
||||||
|
│ │
|
||||||
|
│ │
|
||||||
|
│ │
|
||||||
|
│ │
|
||||||
|
│ │
|
||||||
|
│ │
|
||||||
|
│ │
|
||||||
|
│ │
|
||||||
|
│ │
|
||||||
|
│ │
|
||||||
|
│ │
|
||||||
|
│ │
|
||||||
|
│ │
|
||||||
|
│ │
|
||||||
|
│ │
|
||||||
|
│ │
|
||||||
|
│ │
|
||||||
|
│ │
|
||||||
|
╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
|
||||||
+54
@@ -0,0 +1,54 @@
|
|||||||
|
---
|
||||||
|
source: src/ui/ui_tests.rs
|
||||||
|
expression: output
|
||||||
|
---
|
||||||
|
╭ Managarr - A Servarr management TUI ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
|
||||||
|
│ Radarr │ Sonarr │ Lidarr <?> to open help│
|
||||||
|
╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
|
||||||
|
╭ Stats ──────────────────────────────────────────────────────────────╮╭ Downloads ─────────────────────────────────────────────────────────╮╭──────────────────╮
|
||||||
|
│Radarr Version: 1.2.3.4 ││Test Download Title ││ ⠀⣠⣶⢶⣶⣤⣀⠀⠀⠀⠀⠀⠀⠀⠀ │
|
||||||
|
│Uptime: 0d 00:00:44 ││50% ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━││ ⠀⣿⡇⠀⠈⠙⠻⢿⣶⣤⡀⠀⠀⠀⠀ │
|
||||||
|
│Storage: ││ ││ ⠀⣿⡇⠀⠀⠀⠀⠀⠈⠙⠻⢷⣦⡄⠀ │
|
||||||
|
│/path: 100% ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━││ ││ ⠀⣿⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⢉⠻⠀ │
|
||||||
|
│Root Folders: ││ ││ ⠀⣿⡇⠀⠀⠀⠀⠀⢀⣠⣴⣾⠿⠀⠀ │
|
||||||
|
│/nfs: 204800.00 GB free ││ ││ ⠀⢿⡇⠀⠀⣀⣤⣶⡿⠛⠉⠀⠀⠀⠀ │
|
||||||
|
│ ││ ││ ⠀⠀⠰⠶⡿⠟⠋⠁⠀⠀⠀⠀⠀⠀⠀ │
|
||||||
|
│ ││ ││ │
|
||||||
|
╰───────────────────────────────────────────────────────────────────────╯╰──────────────────────────────────────────────────────────────────────╯╰──────────────────╯
|
||||||
|
╭ Movies ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
|
||||||
|
│ Library │ Collections │ Downloads │ Blocklist │ History │ Root Folders │ Indexers │ System │
|
||||||
|
│───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────│
|
||||||
|
│ Title ▼ Year Studio Runtime Rating Language Size Quality Profile Monitored Tags │
|
||||||
|
│=> Test 2023 21st Century Alex 2h 0m R English 3.30 GB HD - 1080p 🏷 alex │
|
||||||
|
│ │
|
||||||
|
│ │
|
||||||
|
│ │
|
||||||
|
│ │
|
||||||
|
│ │
|
||||||
|
│ ╭────────── Download Failed ──────────╮ │
|
||||||
|
│ │ Request failed. Received 500 response │ │
|
||||||
|
│ │ code │ │
|
||||||
|
│ ╰───────────────────────────────────────╯ │
|
||||||
|
│ │
|
||||||
|
│ │
|
||||||
|
│ │
|
||||||
|
│ │
|
||||||
|
│ │
|
||||||
|
│ │
|
||||||
|
│ │
|
||||||
|
│ │
|
||||||
|
│ │
|
||||||
|
│ │
|
||||||
|
│ │
|
||||||
|
│ │
|
||||||
|
│ │
|
||||||
|
│ │
|
||||||
|
│ │
|
||||||
|
│ │
|
||||||
|
│ │
|
||||||
|
│ │
|
||||||
|
│ │
|
||||||
|
│ │
|
||||||
|
│ │
|
||||||
|
│ │
|
||||||
|
╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
|
||||||
+54
@@ -0,0 +1,54 @@
|
|||||||
|
---
|
||||||
|
source: src/ui/ui_tests.rs
|
||||||
|
expression: output
|
||||||
|
---
|
||||||
|
╭ Managarr - A Servarr management TUI ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
|
||||||
|
│ Radarr │ Sonarr │ Lidarr <?> to open help│
|
||||||
|
╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
|
||||||
|
╭ Stats ──────────────────────────────────────────────────────────────╮╭ Downloads ─────────────────────────────────────────────────────────╮╭──────────────────╮
|
||||||
|
│Radarr Version: 1.2.3.4 ││Test Download Title ││ ⠀⣠⣶⢶⣶⣤⣀⠀⠀⠀⠀⠀⠀⠀⠀ │
|
||||||
|
│Uptime: 0d 00:00:44 ││50% ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━││ ⠀⣿⡇⠀⠈⠙⠻⢿⣶⣤⡀⠀⠀⠀⠀ │
|
||||||
|
│Storage: ││ ││ ⠀⣿⡇⠀⠀⠀⠀⠀⠈⠙⠻⢷⣦⡄⠀ │
|
||||||
|
│/path: 100% ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━││ ││ ⠀⣿⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⢉⠻⠀ │
|
||||||
|
│Root Folders: ││ ││ ⠀⣿⡇⠀⠀⠀⠀⠀⢀⣠⣴⣾⠿⠀⠀ │
|
||||||
|
│/nfs: 204800.00 GB free ││ ││ ⠀⢿⡇⠀⠀⣀⣤⣶⡿⠛⠉⠀⠀⠀⠀ │
|
||||||
|
│ ││ ││ ⠀⠀⠰⠶⡿⠟⠋⠁⠀⠀⠀⠀⠀⠀⠀ │
|
||||||
|
│ ││ ││ │
|
||||||
|
╰───────────────────────────────────────────────────────────────────────╯╰──────────────────────────────────────────────────────────────────────╯╰──────────────────╯
|
||||||
|
╭ Movies ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
|
||||||
|
│ Library │ Collections │ Downloads │ Blocklist │ History │ Root Folders │ Indexers │ System │
|
||||||
|
│───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────│
|
||||||
|
│ Title ▼ Year Studio Runtime Rating Language Size Quality Profile Monitored Tags │
|
||||||
|
│=> Test 2023 21st Century Alex 2h 0m R English 3.30 GB HD - 1080p 🏷 alex │
|
||||||
|
│ │
|
||||||
|
│ │
|
||||||
|
│ │
|
||||||
|
│ │
|
||||||
|
│ │
|
||||||
|
│ ╭────────── Download Result ──────────╮ │
|
||||||
|
│ │ Download request sent successfully │ │
|
||||||
|
│ │ │ │
|
||||||
|
│ ╰───────────────────────────────────────╯ │
|
||||||
|
│ │
|
||||||
|
│ │
|
||||||
|
│ │
|
||||||
|
│ │
|
||||||
|
│ │
|
||||||
|
│ │
|
||||||
|
│ │
|
||||||
|
│ │
|
||||||
|
│ │
|
||||||
|
│ │
|
||||||
|
│ │
|
||||||
|
│ │
|
||||||
|
│ │
|
||||||
|
│ │
|
||||||
|
│ │
|
||||||
|
│ │
|
||||||
|
│ │
|
||||||
|
│ │
|
||||||
|
│ │
|
||||||
|
│ │
|
||||||
|
│ │
|
||||||
|
│ │
|
||||||
|
╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
|
||||||
+54
@@ -0,0 +1,54 @@
|
|||||||
|
---
|
||||||
|
source: src/ui/ui_tests.rs
|
||||||
|
expression: output
|
||||||
|
---
|
||||||
|
╭ Managarr - A Servarr management TUI ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
|
||||||
|
│ Radarr │ Sonarr │ Lidarr <?> to open help│
|
||||||
|
╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
|
||||||
|
╭ Stats ──────────────────────────────────────────────────────────────╮╭ Downloads ─────────────────────────────────────────────────────────╮╭──────────────────╮
|
||||||
|
│Sonarr Version: 1.2.3.4 ││Test Download Title ││ ⠀⠀⠀⣠⣴⣶⣿⣿⣿⣿⣶⣦⣄⠀⠀⠀ │
|
||||||
|
│Uptime: 0d 00:00:44 ││50% ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━││ ⠀⣠⡀⠈⠻⣿⣿⣿⣿⣿⣿⠟⠁⢀⣀⠀ │
|
||||||
|
│Storage: ││ ││ ⢰⣿⣿⣦⠐⠄⠉⠉⠉⠉⠠⠂⣰⣿⣿⡆ │
|
||||||
|
│/path: 100% ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━││ ││ ⣿⣿⣿⣿⡆⠀⣴⣿⣿⣦⠀⢰⣿⣿⣿⣿ │
|
||||||
|
│Root Folders: ││ ││ ⣿⣿⣿⣿⡇⠀⠻⣿⣿⠟⠀⠸⣿⣿⣿⣿ │
|
||||||
|
│/nfs: 204800.00 GB free ││ ││ ⠸⣿⣿⠟⠠⠂⠀⢀⡀⠀⠐⠄⠻⣿⣿⠇ │
|
||||||
|
│ ││ ││ ⠀⠙⠁⢀⣴⣾⣿⣿⣿⣿⣷⣦⡀⠈⠋⠀ │
|
||||||
|
│ ││ ││ ⠀⠀⠀⠘⠻⠿⣿⣿⣿⣿⠿⠟⠋⠀⠀⠀ │
|
||||||
|
╰───────────────────────────────────────────────────────────────────────╯╰──────────────────────────────────────────────────────────────────────╯╰──────────────────╯
|
||||||
|
╭ Series ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
|
||||||
|
│ Library │ Downloads │ Blocklist │ History │ Root Folders │ Indexers │ System │
|
||||||
|
│───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────│
|
||||||
|
│ Title ▼ Year Network Status Rating Type Quality Profile Language Size Monitored Tags │
|
||||||
|
│=> Test 2022 HBO Continuin TV-MA Standard Bluray-1080p English 59.51 GB 🏷 │
|
||||||
|
│ │
|
||||||
|
│ │
|
||||||
|
│ │
|
||||||
|
│ │
|
||||||
|
│ │
|
||||||
|
│ ╭────────── Download Result ──────────╮ │
|
||||||
|
│ │ Download request sent successfully │ │
|
||||||
|
│ │ │ │
|
||||||
|
│ ╰───────────────────────────────────────╯ │
|
||||||
|
│ │
|
||||||
|
│ │
|
||||||
|
│ │
|
||||||
|
│ │
|
||||||
|
│ │
|
||||||
|
│ │
|
||||||
|
│ │
|
||||||
|
│ │
|
||||||
|
│ │
|
||||||
|
│ │
|
||||||
|
│ │
|
||||||
|
│ │
|
||||||
|
│ │
|
||||||
|
│ │
|
||||||
|
│ │
|
||||||
|
│ │
|
||||||
|
│ │
|
||||||
|
│ │
|
||||||
|
│ │
|
||||||
|
│ │
|
||||||
|
│ │
|
||||||
|
│ │
|
||||||
|
╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
|
||||||
@@ -425,12 +425,12 @@ fn draw_episode_releases(f: &mut Frame<'_>, app: &mut App<'_>, area: Rect) {
|
|||||||
.clone()
|
.clone()
|
||||||
.unwrap_or(Number::from(0u64))
|
.unwrap_or(Number::from(0u64))
|
||||||
.as_u64()
|
.as_u64()
|
||||||
.unwrap();
|
.unwrap_or_default();
|
||||||
let leechers = leechers
|
let leechers = leechers
|
||||||
.clone()
|
.clone()
|
||||||
.unwrap_or(Number::from(0u64))
|
.unwrap_or(Number::from(0u64))
|
||||||
.as_u64()
|
.as_u64()
|
||||||
.unwrap();
|
.unwrap_or_default();
|
||||||
|
|
||||||
decorate_peer_style(
|
decorate_peer_style(
|
||||||
seeders,
|
seeders,
|
||||||
|
|||||||
@@ -388,12 +388,12 @@ fn draw_season_releases(f: &mut Frame<'_>, app: &mut App<'_>, area: Rect) {
|
|||||||
.clone()
|
.clone()
|
||||||
.unwrap_or(Number::from(0u64))
|
.unwrap_or(Number::from(0u64))
|
||||||
.as_u64()
|
.as_u64()
|
||||||
.unwrap();
|
.unwrap_or_default();
|
||||||
let leechers = leechers
|
let leechers = leechers
|
||||||
.clone()
|
.clone()
|
||||||
.unwrap_or(Number::from(0u64))
|
.unwrap_or(Number::from(0u64))
|
||||||
.as_u64()
|
.as_u64()
|
||||||
.unwrap();
|
.unwrap_or_default();
|
||||||
|
|
||||||
decorate_peer_style(
|
decorate_peer_style(
|
||||||
seeders,
|
seeders,
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
mod snapshot_tests {
|
mod snapshot_tests {
|
||||||
use crate::app::App;
|
use crate::app::App;
|
||||||
use crate::handlers::populate_keymapping_table;
|
use crate::handlers::populate_keymapping_table;
|
||||||
|
use crate::models::servarr_data::Notification;
|
||||||
use crate::models::servarr_data::lidarr::lidarr_data::ActiveLidarrBlock;
|
use crate::models::servarr_data::lidarr::lidarr_data::ActiveLidarrBlock;
|
||||||
use crate::models::servarr_data::radarr::radarr_data::ActiveRadarrBlock;
|
use crate::models::servarr_data::radarr::radarr_data::ActiveRadarrBlock;
|
||||||
use crate::models::servarr_data::sonarr::sonarr_data::ActiveSonarrBlock;
|
use crate::models::servarr_data::sonarr::sonarr_data::ActiveSonarrBlock;
|
||||||
@@ -46,6 +47,40 @@ mod snapshot_tests {
|
|||||||
insta::assert_snapshot!(output);
|
insta::assert_snapshot!(output);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn test_radarr_ui_renders_notification_success_popup() {
|
||||||
|
let mut app = App::test_default_fully_populated();
|
||||||
|
app.notification = Some(Notification::new(
|
||||||
|
"Download Result".to_owned(),
|
||||||
|
"Download request sent successfully".to_owned(),
|
||||||
|
true,
|
||||||
|
));
|
||||||
|
app.push_navigation_stack(ActiveRadarrBlock::default().into());
|
||||||
|
|
||||||
|
let output = render_to_string_with_app(TerminalSize::Large, &mut app, |f, app| {
|
||||||
|
ui(f, app);
|
||||||
|
});
|
||||||
|
|
||||||
|
insta::assert_snapshot!(output);
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn test_radarr_ui_renders_notification_failure_popup() {
|
||||||
|
let mut app = App::test_default_fully_populated();
|
||||||
|
app.notification = Some(Notification::new(
|
||||||
|
"Download Failed".to_owned(),
|
||||||
|
"Request failed. Received 500 response code".to_owned(),
|
||||||
|
false,
|
||||||
|
));
|
||||||
|
app.push_navigation_stack(ActiveRadarrBlock::default().into());
|
||||||
|
|
||||||
|
let output = render_to_string_with_app(TerminalSize::Large, &mut app, |f, app| {
|
||||||
|
ui(f, app);
|
||||||
|
});
|
||||||
|
|
||||||
|
insta::assert_snapshot!(output);
|
||||||
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_sonarr_ui_renders_library_tab() {
|
fn test_sonarr_ui_renders_library_tab() {
|
||||||
let mut app = App::test_default_fully_populated();
|
let mut app = App::test_default_fully_populated();
|
||||||
@@ -84,6 +119,23 @@ mod snapshot_tests {
|
|||||||
insta::assert_snapshot!(output);
|
insta::assert_snapshot!(output);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn test_sonarr_ui_renders_notification_success_popup() {
|
||||||
|
let mut app = App::test_default_fully_populated();
|
||||||
|
app.notification = Some(Notification::new(
|
||||||
|
"Download Result".to_owned(),
|
||||||
|
"Download request sent successfully".to_owned(),
|
||||||
|
true,
|
||||||
|
));
|
||||||
|
app.push_navigation_stack(ActiveSonarrBlock::default().into());
|
||||||
|
|
||||||
|
let output = render_to_string_with_app(TerminalSize::Large, &mut app, |f, app| {
|
||||||
|
ui(f, app);
|
||||||
|
});
|
||||||
|
|
||||||
|
insta::assert_snapshot!(output);
|
||||||
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_lidarr_ui_renders_library_tab() {
|
fn test_lidarr_ui_renders_library_tab() {
|
||||||
let mut app = App::test_default_fully_populated();
|
let mut app = App::test_default_fully_populated();
|
||||||
@@ -109,6 +161,23 @@ mod snapshot_tests {
|
|||||||
insta::assert_snapshot!(output);
|
insta::assert_snapshot!(output);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn test_lidarr_ui_renders_notification_success_popup() {
|
||||||
|
let mut app = App::test_default_fully_populated();
|
||||||
|
app.notification = Some(Notification::new(
|
||||||
|
"Download Result".to_owned(),
|
||||||
|
"Download request sent successfully".to_owned(),
|
||||||
|
true,
|
||||||
|
));
|
||||||
|
app.push_navigation_stack(ActiveLidarrBlock::default().into());
|
||||||
|
|
||||||
|
let output = render_to_string_with_app(TerminalSize::Large, &mut app, |f, app| {
|
||||||
|
ui(f, app);
|
||||||
|
});
|
||||||
|
|
||||||
|
insta::assert_snapshot!(output);
|
||||||
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_lidarr_ui_renders_library_tab_error_popup() {
|
fn test_lidarr_ui_renders_library_tab_error_popup() {
|
||||||
let mut app = App::test_default_fully_populated();
|
let mut app = App::test_default_fully_populated();
|
||||||
|
|||||||
Reference in New Issue
Block a user