Skip to content

Commit 95df7a9

Browse files
committed
add with_vote_average_gte
Signed-off-by: brandy <[email protected]>
1 parent 5e01297 commit 95df7a9

File tree

2 files changed

+27
-1
lines changed

2 files changed

+27
-1
lines changed

src/movie/discover.rs

+14-1
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,9 @@ pub struct MovieDiscover {
2222
pub sort_by: Option<String>,
2323
/// With watch monetization types
2424
pub with_watch_monetization_types: Option<String>,
25-
2625
pub with_primary_release_date_gte: Option<String>,
26+
// vote_average.gte
27+
pub with_vote_average_gte: Option<f32>,
2728
}
2829

2930
impl MovieDiscover {
@@ -39,6 +40,7 @@ impl MovieDiscover {
3940
sort_by: Some("popularity.desc".into()),
4041
with_watch_monetization_types: None,
4142
with_primary_release_date_gte: None,
43+
with_vote_average_gte: None,
4244
}
4345
}
4446

@@ -91,6 +93,11 @@ impl MovieDiscover {
9193
self.with_primary_release_date_gte = value;
9294
self
9395
}
96+
97+
pub fn with_vote_average_gte(mut self, value: Option<f32>) -> Self {
98+
self.with_vote_average_gte = value;
99+
self
100+
}
94101
}
95102

96103
impl crate::prelude::Command for MovieDiscover {
@@ -145,6 +152,12 @@ impl crate::prelude::Command for MovieDiscover {
145152
Cow::Owned(with_primary_release_date_gte.to_string()),
146153
));
147154
}
155+
if let Some(with_vote_average_gte) = self.with_vote_average_gte {
156+
res.push((
157+
"vote_average.gte",
158+
Cow::Owned(with_vote_average_gte.to_string()),
159+
));
160+
}
148161

149162
res
150163
}

src/tvshow/discover.rs

+13
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ pub struct TVShowDiscover {
2323
/// With watch monetization types
2424
pub with_watch_monetization_types: Option<String>,
2525
pub with_primary_release_date_gte: Option<String>,
26+
pub with_vote_average_gte: Option<f32>,
2627
}
2728

2829
impl TVShowDiscover {
@@ -38,6 +39,7 @@ impl TVShowDiscover {
3839
sort_by: Some("popularity.desc".into()),
3940
with_watch_monetization_types: None,
4041
with_primary_release_date_gte: None,
42+
with_vote_average_gte: None,
4143
}
4244
}
4345

@@ -90,6 +92,11 @@ impl TVShowDiscover {
9092
self.with_primary_release_date_gte = value;
9193
self
9294
}
95+
96+
pub fn with_vote_average_gte(mut self, value: Option<f32>) -> Self {
97+
self.with_vote_average_gte = value;
98+
self
99+
}
93100
}
94101

95102
impl crate::prelude::Command for TVShowDiscover {
@@ -144,6 +151,12 @@ impl crate::prelude::Command for TVShowDiscover {
144151
Cow::Owned(with_primary_release_date_gte.to_string()),
145152
));
146153
}
154+
if let Some(with_vote_average_gte) = self.with_vote_average_gte {
155+
res.push((
156+
"vote_average.gte",
157+
Cow::Owned(with_vote_average_gte.to_string()),
158+
));
159+
}
147160

148161
res
149162
}

0 commit comments

Comments
 (0)