Skip to content

Commit

Permalink
Merge pull request #5 from flbn/ov/random-fixes
Browse files Browse the repository at this point in the history
random fixes
  • Loading branch information
pombadev authored Sep 17, 2023
2 parents 150bc6a + 0c7778c commit 199a6e9
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/lib/multi_dl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ impl<'a> Downloader<'a> {
.enumerate()
.filter(|(_, (track, root))| {
if make_path(track, root, &tf).exists() {
eprintln!("`{}` already exist, skipping", track.name);
eprintln!("`{}` already exists, skipping", track.name);
false
} else {
true
Expand Down
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
2 changes: 1 addition & 1 deletion src/lib/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ pub fn track_path(track: &Track, root: &Path, track_format: &String) -> Result<P
let file = root.join(file_name).with_extension("mp3");

if file.exists() {
bail!("{} already exist", file.display())
bail!("{} already exists", file.display())
}

Ok(file)
Expand Down

0 comments on commit 199a6e9

Please sign in to comment.