diff --git a/module/move/unitore/src/entity/frame.rs b/module/move/unitore/src/entity/frame.rs index 32ba98a4ca..de687ec425 100644 --- a/module/move/unitore/src/entity/frame.rs +++ b/module/move/unitore/src/entity/frame.rs @@ -76,17 +76,21 @@ impl From< ( feed_rs::model::Entry, String ) > for Frame stored_time : entry.updated, authors: ( !authors.is_empty() ).then( || authors ), // qqq : why join? + // aaa : fixed, saved as list content, links: ( !links.is_empty() ).then( || links ), // qqq : why join? + // aaa : fixed, saved as list summary : entry.summary.map( | c | c.content ).clone(), categories: ( !categories.is_empty() ).then( || categories ), // qqq : why join? + // aaa : fixed, saved as list published : entry.published.clone(), source : entry.source.clone(), rights : entry.rights.map( | r | r.content ).clone(), media: ( !media.is_empty() ).then( || media ), // qqq : why join? + // aaa : fixed, saved as list language : entry.language.clone(), feed_link, } @@ -132,27 +136,46 @@ impl From< Frame > for Vec< ExprNode< 'static > > ; let authors = entry.authors - .map( | authors | text(authors[0].clone())) + .map( | authors | + text + ( + format!( "[{}]", authors.into_iter().map( | a | format!( "\"{}\"", a ) ).collect::< Vec< _ > >().join( ", " ) ) + ) + ) .unwrap_or( null() ) ; let content = entry.content - .map( | content | text ( content ) ) + .map( | content | text( content ) ) .unwrap_or( null() ) ; let links = entry.links - .map( | links | text ( links.join(", ") ) ) + .map( | links | + text + ( + format!( "[{}]", links.into_iter().map( | link | format!( "\"{}\"", link ) ).collect::< Vec< _ > >().join( ", " ) ) + ) + ) .unwrap_or( null() ) ; let summary = entry.summary - .map( | summary | text ( summary ) ) + .map( | summary | text( summary ) ) .unwrap_or( null() ) ; let categories = entry.categories - .map( | categories | text ( categories.join(", ") ) ) + .map( | categories | + text + ( + format! + ( + "[{}]", + categories.into_iter().map( | category | format!( "\"{}\"", category ) ).collect::< Vec< _ > >().join( ", " ), + ) + ) + ) .unwrap_or( null() ) ; @@ -164,7 +187,12 @@ impl From< Frame > for Vec< ExprNode< 'static > > let source = entry.source.map( | s | text( s ) ).unwrap_or( null() ); let rights = entry.rights.map( | r | text( r ) ).unwrap_or( null() ); let media = entry.media - .map( | media | text( media.join(", ") ) ) + .map( | media | + text + ( + format!( "[{}]", media.into_iter().map( | media | format!( "\"{}\"", media ) ).collect::< Vec< _ > >().join( ", " ) ) + ) + ) .unwrap_or( null() ) ; diff --git a/module/move/unitore/src/storage.rs b/module/move/unitore/src/storage.rs index 86295eb4f0..98c0fdd72b 100644 --- a/module/move/unitore/src/storage.rs +++ b/module/move/unitore/src/storage.rs @@ -73,15 +73,15 @@ impl FeedStorage< SledStorage > [ "id", "TEXT", "A unique identifier for this frame in the feed. " ], [ "title", "TEXT", "Title of the frame" ], [ "stored_time", "TIMESTAMP", "Time at which this item was fetched from source." ], - [ "authors", "TEXT", "List of authors of the frame, optional." ], + [ "authors", "LIST", "List of authors of the frame, optional." ], [ "content", "TEXT", "The content of the frame in html or plain text, optional." ], - [ "links", "TEXT", "List of links associated with this item of related Web page and attachments." ], + [ "links", "LIST", "List of links associated with this item of related Web page and attachments." ], [ "summary", "TEXT", "Short summary, abstract, or excerpt of the frame item, optional." ], - [ "categories", "TEXT", "Specifies a list of categories that the item belongs to." ], + [ "categories", "LIST", "Specifies a list of categories that the item belongs to." ], [ "published", "TIMESTAMP", "Time at which this item was first published or updated." ], [ "source", "TEXT", "Specifies the source feed if the frame was copied from one feed into another feed, optional." ], [ "rights", "TEXT", "Conveys information about copyrights over the feed, optional." ], - [ "media", "TEXT", "List of media oblects, encountered in the frame, optional." ], + [ "media", "LIST", "List of media oblects, encountered in the frame, optional." ], [ "language", "TEXT", "The language specified on the item, optional." ], [ "feed_link", "TEXT", "Link of feed that contains this frame." ], ];