fix: parsing rss feeds of empty channels
This commit is contained in:
parent
49148711e0
commit
f98c85b385
2 changed files with 12 additions and 0 deletions
|
|
@ -11,6 +11,7 @@ pub(crate) struct ChannelRss {
|
||||||
pub author: Author,
|
pub author: Author,
|
||||||
#[serde(rename = "published", with = "time::serde::rfc3339")]
|
#[serde(rename = "published", with = "time::serde::rfc3339")]
|
||||||
pub create_date: OffsetDateTime,
|
pub create_date: OffsetDateTime,
|
||||||
|
#[serde(default)]
|
||||||
pub entry: Vec<Entry>,
|
pub entry: Vec<Entry>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -996,6 +996,17 @@ mod channel_rss {
|
||||||
assert!(!channel.videos.is_empty());
|
assert!(!channel.videos.is_empty());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[rstest]
|
||||||
|
fn get_channel_rss_empty(rp: RustyPipe) {
|
||||||
|
let channel =
|
||||||
|
tokio_test::block_on(rp.query().channel_rss("UC4fJNIVEOQ1fk15B_sqoOqg")).unwrap();
|
||||||
|
|
||||||
|
assert_eq!(channel.id, "UC4fJNIVEOQ1fk15B_sqoOqg");
|
||||||
|
assert_eq!(channel.name, "Bilal Saeed - Topic");
|
||||||
|
|
||||||
|
assert!(channel.videos.is_empty());
|
||||||
|
}
|
||||||
|
|
||||||
#[rstest]
|
#[rstest]
|
||||||
fn get_channel_rss_not_found(rp: RustyPipe) {
|
fn get_channel_rss_not_found(rp: RustyPipe) {
|
||||||
let err =
|
let err =
|
||||||
|
|
|
||||||
Reference in a new issue