diff options
Diffstat (limited to 'import/src/lib.rs')
-rw-r--r-- | import/src/lib.rs | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/import/src/lib.rs b/import/src/lib.rs index 36014ea..125b20b 100644 --- a/import/src/lib.rs +++ b/import/src/lib.rs @@ -213,6 +213,20 @@ fn import_file( Ok(()) })?; } + "children" => { + info!("import children at {path:?}"); + for line in read_to_string(path)?.lines() { + let line = line.trim(); + if line.starts_with("#") || line.is_empty() { + continue; + } + db.update_node_init(NodeID::from_slug(line), |n| { + n.slug = line.to_owned(); + n.parents.insert(parent); + Ok(()) + })?; + } + } "channel.info.json" => { info!("import channel info.json at {path:?}"); let data = serde_json::from_reader::<_, YVideo>(BufReader::new(File::open(path)?))?; @@ -355,10 +369,18 @@ fn import_media_file( node.visibility = visibility; node.poster = m.cover.clone().or(poster); node.backdrop = backdrop; - node.description = tags.remove("DESCRIPTION"); + node.description = tags.remove("DESCRIPTION").or(tags.remove("SYNOPSIS")); node.tagline = tags.remove("COMMENT"); node.parents.insert(parent); + if let Some(ct) = tags.get("CONTENT_TYPE") { + node.kind = match ct.to_lowercase().trim() { + "movie" | "documentary" | "film" => NodeKind::Movie, + "music" | "recording" => NodeKind::Music, + _ => NodeKind::Unknown, + } + } + if let Some(data) = tmdb_data { node.title = data.title.clone(); node.tagline = data.tagline.clone(); |