Skip to content

Commit

Permalink
chore: add str replacement to avoid weird directory stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
flbn committed Sep 4, 2023
1 parent 46a192b commit 0c7778c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/lib/spider.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ fn scrape_by_application_ld_json(dom: &Html) -> Option<Album> {

vec![Track {
num: 1,
name: track_name.to_string(),
name: track_name.to_string().replace("/", ":"),
url,
lyrics: None,
album: album.clone(),
Expand All @@ -113,7 +113,9 @@ fn scrape_by_application_ld_json(dom: &Html) -> Option<Album> {

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(),
Expand Down

0 comments on commit 0c7778c

Please sign in to comment.