feat(web): mirror tv results in search client
This commit is contained in:
@@ -804,7 +804,9 @@ mod tests {
|
||||
.await;
|
||||
Mock::given(method("GET"))
|
||||
.and(path("/search/tv"))
|
||||
.respond_with(ResponseTemplate::new(200).set_body_json(serde_json::json!({"results":[]})))
|
||||
.respond_with(
|
||||
ResponseTemplate::new(200).set_body_json(serde_json::json!({"results":[]})),
|
||||
)
|
||||
.mount(&tmdb)
|
||||
.await;
|
||||
let (_dir, state, base) = application(&tmdb, &prowlarr).await;
|
||||
@@ -833,14 +835,16 @@ mod tests {
|
||||
let prowlarr = MockServer::start().await;
|
||||
Mock::given(method("GET"))
|
||||
.and(path("/search/movie"))
|
||||
.respond_with(ResponseTemplate::new(200).set_body_json(serde_json::json!({"results":[]})))
|
||||
.respond_with(
|
||||
ResponseTemplate::new(200).set_body_json(serde_json::json!({"results":[]})),
|
||||
)
|
||||
.mount(&tmdb)
|
||||
.await;
|
||||
Mock::given(method("GET"))
|
||||
.and(path("/search/tv"))
|
||||
.respond_with(
|
||||
ResponseTemplate::new(200).set_body_json(serde_json::json!({"results":[{
|
||||
"id": 827_28, "name": "Bluey", "original_language": "en",
|
||||
"id": 82_728, "name": "Bluey", "original_language": "en",
|
||||
"first_air_date": "2018-10-01"
|
||||
}]})),
|
||||
)
|
||||
@@ -861,12 +865,13 @@ mod tests {
|
||||
.fetch_one(pool)
|
||||
.await
|
||||
.expect("series");
|
||||
let season_id: i64 =
|
||||
sqlx::query_scalar("INSERT INTO seasons (series_id, number) VALUES (?, 1) RETURNING id")
|
||||
.bind(series_id)
|
||||
.fetch_one(pool)
|
||||
.await
|
||||
.expect("season");
|
||||
let season_id: i64 = sqlx::query_scalar(
|
||||
"INSERT INTO seasons (series_id, number) VALUES (?, 1) RETURNING id",
|
||||
)
|
||||
.bind(series_id)
|
||||
.fetch_one(pool)
|
||||
.await
|
||||
.expect("season");
|
||||
sqlx::query("INSERT INTO episodes (season_id, number, title) VALUES (?, 2, 'Hospital')")
|
||||
.bind(season_id)
|
||||
.execute(pool)
|
||||
@@ -898,7 +903,7 @@ mod tests {
|
||||
.expect("json");
|
||||
assert_eq!(response["library"][0]["kind"], "series");
|
||||
assert_eq!(response["library"][0]["title"], "Bluey");
|
||||
assert_eq!(response["library"][0]["tmdb_id"], 827_28);
|
||||
assert_eq!(response["library"][0]["tmdb_id"], 82_728);
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
@@ -926,7 +931,9 @@ mod tests {
|
||||
.await;
|
||||
Mock::given(method("GET"))
|
||||
.and(path("/search/tv"))
|
||||
.respond_with(ResponseTemplate::new(200).set_body_json(serde_json::json!({"results":[]})))
|
||||
.respond_with(
|
||||
ResponseTemplate::new(200).set_body_json(serde_json::json!({"results":[]})),
|
||||
)
|
||||
.mount(&tmdb)
|
||||
.await;
|
||||
let (_dir, state, base) = application(&tmdb, &prowlarr).await;
|
||||
|
||||
Reference in New Issue
Block a user