mirror of
https://github.com/JockeTF/fimfareader.git
synced 2024-11-23 22:07:59 +01:00
Use struct instead of map for author avatar
This commit is contained in:
parent
21088cb539
commit
a9b6351737
1 changed files with 29 additions and 3 deletions
32
src/story.rs
32
src/story.rs
|
@ -1,7 +1,5 @@
|
||||||
//! Story meta.
|
//! Story meta.
|
||||||
|
|
||||||
use std::collections::BTreeMap;
|
|
||||||
|
|
||||||
use chrono::prelude::*;
|
use chrono::prelude::*;
|
||||||
use serde::de::Error;
|
use serde::de::Error;
|
||||||
use serde::{Deserialize, Deserializer};
|
use serde::{Deserialize, Deserializer};
|
||||||
|
@ -53,7 +51,7 @@ pub struct Archive {
|
||||||
|
|
||||||
#[derive(Clone, Debug, Deserialize)]
|
#[derive(Clone, Debug, Deserialize)]
|
||||||
pub struct Author {
|
pub struct Author {
|
||||||
pub avatar: Option<BTreeMap<String, String>>,
|
pub avatar: Option<Avatar>,
|
||||||
pub bio_html: Option<String>,
|
pub bio_html: Option<String>,
|
||||||
pub date_joined: Option<DateTime<Utc>>,
|
pub date_joined: Option<DateTime<Utc>>,
|
||||||
#[serde(deserialize_with = "string_to_id")]
|
#[serde(deserialize_with = "string_to_id")]
|
||||||
|
@ -65,6 +63,34 @@ pub struct Author {
|
||||||
pub url: String,
|
pub url: String,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[derive(Clone, Debug, Deserialize)]
|
||||||
|
pub struct Avatar {
|
||||||
|
#[serde(rename = "16")]
|
||||||
|
pub x16: Option<String>,
|
||||||
|
#[serde(rename = "32")]
|
||||||
|
pub x32: Option<String>,
|
||||||
|
#[serde(rename = "48")]
|
||||||
|
pub x48: Option<String>,
|
||||||
|
#[serde(rename = "64")]
|
||||||
|
pub x64: Option<String>,
|
||||||
|
#[serde(rename = "96")]
|
||||||
|
pub x96: Option<String>,
|
||||||
|
#[serde(rename = "128")]
|
||||||
|
pub x128: Option<String>,
|
||||||
|
#[serde(rename = "160")]
|
||||||
|
pub x160: Option<String>,
|
||||||
|
#[serde(rename = "192")]
|
||||||
|
pub x192: Option<String>,
|
||||||
|
#[serde(rename = "256")]
|
||||||
|
pub x256: Option<String>,
|
||||||
|
#[serde(rename = "320")]
|
||||||
|
pub x320: Option<String>,
|
||||||
|
#[serde(rename = "384")]
|
||||||
|
pub x384: Option<String>,
|
||||||
|
#[serde(rename = "512")]
|
||||||
|
pub x512: Option<String>,
|
||||||
|
}
|
||||||
|
|
||||||
#[derive(Clone, Debug, Deserialize)]
|
#[derive(Clone, Debug, Deserialize)]
|
||||||
pub struct Chapter {
|
pub struct Chapter {
|
||||||
pub chapter_number: i32,
|
pub chapter_number: i32,
|
||||||
|
|
Loading…
Reference in a new issue