diff options
Diffstat (limited to 'import/src/lib.rs')
| -rw-r--r-- | import/src/lib.rs | 108 |
1 files changed, 0 insertions, 108 deletions
diff --git a/import/src/lib.rs b/import/src/lib.rs index ceda42f..ecb39db 100644 --- a/import/src/lib.rs +++ b/import/src/lib.rs @@ -565,114 +565,6 @@ pub fn is_useful_attachment(a: &AttachedFile) -> Option<&'static str> { } } -// for tok in filename_toks { -// apply_node_flag(db, rthandle, apis, node, tok)?; -// } - -// fn apply_musicbrainz_recording( -// db: &Database, -// rthandle: &Handle, -// apis: &Apis, -// node: NodeID, -// mbid: String, -// ) -> Result<()> { -// let rec = apis.musicbrainz.lookup_recording(mbid, rthandle)?; - -// db.update_node_init(node, |node| { -// node.title = Some(rec.title.clone()); -// node.identifiers -// .insert(IdentifierType::MusicbrainzRecording, rec.id.to_string()); -// if let Some(a) = rec.artist_credit.first() { -// node.subtitle = Some(a.artist.name.clone()); -// node.identifiers -// .insert(IdentifierType::MusicbrainzArtist, a.artist.id.to_string()); -// } - -// // // TODO proper dedup -// // node.people.clear(); - -// for rel in &rec.relations { -// use musicbrainz::reltypes::*; -// let a = match rel.type_id.as_str() { -// INSTRUMENT => Some(("", CreditCategory::Instrument)), -// VOCAL => Some(("", CreditCategory::Vocal)), -// PRODUCER => Some(("", CreditCategory::Producer)), -// MIX => Some(("mix ", CreditCategory::Engineer)), -// PHONOGRAPHIC_COPYRIGHT => { -// Some(("phonographic copyright ", CreditCategory::Engineer)) -// } -// PROGRAMMING => Some(("programming ", CreditCategory::Engineer)), -// _ => None, -// }; - -// if let Some((note, group)) = a { -// let artist = rel.artist.as_ref().unwrap(); - -// let artist = apis -// .musicbrainz -// .lookup_artist(artist.id.clone(), rthandle)?; - -// let mut image_1 = None; -// let mut image_2 = None; - -// for rel in &artist.relations { -// match rel.type_id.as_str() { -// WIKIDATA => { -// let url = rel.url.as_ref().unwrap().resource.clone(); -// if let Some(id) = url.strip_prefix("https://www.wikidata.org/wiki/") { -// if let Some(filename) = -// apis.wikidata.query_image_path(id.to_owned(), rthandle)? -// { -// image_1 = Some( -// apis.wikimedia_commons -// .image_by_filename(filename, rthandle)?, -// ); -// } -// } -// } -// VGMDB => { -// let url = rel.url.as_ref().unwrap().resource.clone(); -// if let Some(id) = url.strip_prefix("https://vgmdb.net/artist/") { -// let id = id.parse::<u64>().context("parse vgmdb id")?; -// if let Some(path) = apis.vgmdb.get_artist_image(id, rthandle)? { -// image_2 = Some(path); -// } -// } -// } -// _ => (), -// } -// } -// let mut jobs = vec![]; -// if !note.is_empty() { -// jobs.push(note.to_string()); -// } -// jobs.extend(rel.attributes.clone()); - -// let _headshot = match image_1.or(image_2) { -// Some(x) => x, -// None => Asset(cache_store( -// format!("fallback/{}.image", HashKey(&artist.sort_name)), -// || generate_fallback(&artist.sort_name), -// )?), -// }; - -// node.credits.entry(group).or_default().push(Appearance { -// jobs, -// characters: vec![], -// node: NodeID([0; 32]), // TODO -// }); -// } -// } - -// for isrc in &rec.isrcs { -// node.identifiers -// .insert(IdentifierType::Isrc, isrc.to_string()); -// } -// Ok(()) -// })?; -// Ok(()) -// } - // fn make_kebab(i: &str) -> String { // let mut o = String::with_capacity(i.len()); // for c in i.chars() { |