fix: parsing rss feeds of empty channels

This commit is contained in:
ThetaDev 2023-02-08 16:54:35 +01:00
parent 49148711e0
commit f98c85b385
2 changed files with 12 additions and 0 deletions

View file

@ -11,6 +11,7 @@ pub(crate) struct ChannelRss {
pub author: Author,
#[serde(rename = "published", with = "time::serde::rfc3339")]
pub create_date: OffsetDateTime,
#[serde(default)]
pub entry: Vec<Entry>,
}

View file

@ -996,6 +996,17 @@ mod channel_rss {
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]
fn get_channel_rss_not_found(rp: RustyPipe) {
let err =