From 0c7778c3f6581a0204de208111e42e73133406c8 Mon Sep 17 00:00:00 2001 From: woven ink Date: Mon, 4 Sep 2023 16:43:41 -0400 Subject: [PATCH] chore: add str replacement to avoid weird directory stuff --- src/lib/spider.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/lib/spider.rs b/src/lib/spider.rs index 8f2f1ed..8ea5e24 100644 --- a/src/lib/spider.rs +++ b/src/lib/spider.rs @@ -86,7 +86,7 @@ fn scrape_by_application_ld_json(dom: &Html) -> Option { vec![Track { num: 1, - name: track_name.to_string(), + name: track_name.to_string().replace("/", ":"), url, lyrics: None, album: album.clone(), @@ -113,7 +113,9 @@ fn scrape_by_application_ld_json(dom: &Html) -> Option { Some(Track { num: track.get("position").i32(), - name: decode_html_entities(&track.get("item.name").to_string()).into(), + name: decode_html_entities(&track.get("item.name").to_string()) + .replace("/", ":") + .into(), url: decode_html_entities(&url).to_string(), lyrics: Some(track.get("item.recordingOf.lyrics.text").to_string()), album: album.clone(),