Added description field to jnovel PostInfo struct

This commit is contained in:
Neshura 2023-12-17 14:42:22 +01:00
parent da9505cd61
commit dd11620ffa
Signed by: Neshura
GPG key ID: B6983AAA6B9A7A6C

View file

@ -149,7 +149,7 @@ impl PartialOrd for PartInfo {
#[derive(Debug, Clone)]
pub(crate) enum PostInfo {
Chapter { part: PartInfo, volume: u8, lemmy_info: LemmyPostInfo },
Volume { part: PartInfo, lemmy_info: LemmyPostInfo },
Volume { part: PartInfo, description: String, lemmy_info: LemmyPostInfo },
}
impl PostInfo {
@ -166,6 +166,13 @@ impl PostInfo {
Volume {lemmy_info: lemmy_info, ..} => lemmy_info.clone()
}
}
pub(crate) fn get_description(&self) -> Option<String> {
match self {
_Chapter => None,
Volume {description, ..} => Some(description.clone())
}
}
}
impl PartialEq for PostInfo {
@ -286,6 +293,7 @@ pub(crate) async fn check_feed(series_slug: &str, series_has_parts: bool) -> Res
let new_post_info = Volume {
part: new_part_info,
description: volume.short_description.clone(),
lemmy_info: post_details,
};