Skip to content

Commit

Permalink
chore: resuse client
Browse files Browse the repository at this point in the history
  • Loading branch information
tsukinaha committed Apr 9, 2024
1 parent 86d5236 commit 1fb356b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 17 deletions.
9 changes: 0 additions & 9 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,10 +1 @@
/target
.VSCodeCounter/2024-03-06_19-29-13/details.md
.VSCodeCounter/2024-03-06_19-29-13/diff-details.md
.VSCodeCounter/2024-03-06_19-29-13/diff.csv
.VSCodeCounter/2024-03-06_19-29-13/diff.md
.VSCodeCounter/2024-03-06_19-29-13/diff.txt
.VSCodeCounter/2024-03-06_19-29-13/results.csv
.VSCodeCounter/2024-03-06_19-29-13/results.json
.VSCodeCounter/2024-03-06_19-29-13/results.md
.VSCodeCounter/2024-03-06_19-29-13/results.txt
16 changes: 8 additions & 8 deletions src/ui/network.rs
Original file line number Diff line number Diff line change
Expand Up @@ -431,11 +431,11 @@ pub(crate) async fn resume() -> Result<Vec<Resume>, Error> {
pub async fn get_image(id: String) -> Result<String, Error> {
let server_info = config::set_config();

let result = reqwest::get(&format!(
let result = client().get(&format!(
"{}:{}/emby/Items/{}/Images/Primary?maxHeight=400",
server_info.domain, server_info.port, id
))
.await;
.send().await;

match result {
Ok(response) => {
Expand Down Expand Up @@ -476,11 +476,11 @@ pub async fn get_image(id: String) -> Result<String, Error> {
pub async fn get_thumbimage(id: String) -> Result<String, Error> {
let server_info = config::set_config();

let result = reqwest::get(&format!(
let result = client().get(&format!(
"{}:{}/emby/Items/{}/Images/Thumb",
server_info.domain, server_info.port, id
))
.await;
.send().await;

match result {
Ok(response) => {
Expand Down Expand Up @@ -521,11 +521,11 @@ pub async fn get_thumbimage(id: String) -> Result<String, Error> {
pub async fn get_backdropimage(id: String) -> Result<String, Error> {
let server_info = config::set_config();

let result = reqwest::get(&format!(
let result = client().get(&format!(
"{}:{}/emby/Items/{}/Images/Backdrop",
server_info.domain, server_info.port, id
))
.await;
.send().await;

match result {
Ok(response) => {
Expand Down Expand Up @@ -566,11 +566,11 @@ pub async fn get_backdropimage(id: String) -> Result<String, Error> {
pub async fn get_logoimage(id: String) -> Result<String, Error> {
let server_info = config::set_config();

let result = reqwest::get(&format!(
let result = client().get(&format!(
"{}:{}/emby/Items/{}/Images/Logo",
server_info.domain, server_info.port, id
))
.await;
.send().await;

match result {
Ok(response) => {
Expand Down

0 comments on commit 1fb356b

Please sign in to comment.