sorta works with links now
This commit is contained in:
parent
c3b1afe267
commit
b90e557a3d
1 changed files with 11 additions and 0 deletions
11
src/lib.rs
11
src/lib.rs
|
@ -49,6 +49,7 @@ fn process_children(children: &Vec<Item>) -> String {
|
|||
result
|
||||
}
|
||||
|
||||
|
||||
fn has_image(children: &Vec<Item>) -> bool {
|
||||
let mut result = false;
|
||||
for c in children {
|
||||
|
@ -125,6 +126,16 @@ fn get_media_source(children: &Vec<Item>) -> Option<String> {
|
|||
|
||||
fn media_content(item: &Item) -> Content{
|
||||
match item {
|
||||
Item::Link(_,children) => {
|
||||
for c in children {
|
||||
match c {
|
||||
Item::Video(_) => {return media_content(c);}
|
||||
Item::Audio(_) => {return media_content(c);}
|
||||
_ => {}
|
||||
}
|
||||
}
|
||||
Content::Ignore
|
||||
}
|
||||
Item::Audio(children) => {
|
||||
match get_media_source(children) {
|
||||
Some(s) => {
|
||||
|
|
Loading…
Reference in a new issue