Skip to content
This repository has been archived by the owner on Aug 31, 2023. It is now read-only.

Commit

Permalink
Publisher name, README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
Marekkon5 committed Jan 22, 2021
1 parent 7f9428c commit 2c108d9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Simple Rust + Webview app to automatically tag your music collection using data from Discogs.

![Screenshot](https://i.imgur.com/lG08mHc.png)
![Screenshot](https://i.imgur.com/uCVeoUu.png)

# Compatibility
<table>
Expand Down Expand Up @@ -31,7 +31,7 @@ Simple Rust + Webview app to automatically tag your music collection using data
</tr>
<tr>
<td>macOS Big Sur</td>
<td></td>
<td></td>
</tr>
<tr>
<td>Linux</td>
Expand Down
6 changes: 3 additions & 3 deletions src/tagger.rs
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ fn write_flac_tag(discogs: &mut Discogs, config: &TaggerConfig, path: &str, rele
.into_iter().map(|a| clean_discogs_artist(a)).collect::<Vec<String>>());
}
if config.label && release.label.is_some() && release.label.as_ref().unwrap().len() > 0 && (config.overwrite || vorbis.get("LABEL").is_none()) {
vorbis.set("LABEL", vec![release.label.as_ref().unwrap().first().unwrap()]);
vorbis.set("LABEL", vec![clean_discogs_artist(release.label.as_ref().unwrap().first().unwrap())]);
}
if config.date && (config.overwrite || vorbis.get("DATE").is_none()) {
if release.released.is_some() {
Expand Down Expand Up @@ -285,7 +285,7 @@ fn write_id3_tag(tag: &mut Tag, discogs: &mut Discogs, config: &TaggerConfig, re
.into_iter().map(|a| clean_discogs_artist(a)).collect::<Vec<String>>().join(&config.artist_separator));
}
if config.label && release.label.is_some() && release.label.as_ref().unwrap().len() > 0 && (config.overwrite || tag.get("TPUB").is_none()) {
tag.set_text("TPUB", release.label.as_ref().unwrap().first().unwrap());
tag.set_text("TPUB", clean_discogs_artist(release.label.as_ref().unwrap().first().unwrap()));
}
if config.date && release.year.is_some() {
//Parse date
Expand Down Expand Up @@ -378,7 +378,7 @@ fn write_id3_tag(tag: &mut Tag, discogs: &mut Discogs, config: &TaggerConfig, re
}

fn clean_discogs_artist(name: &str) -> String {
let re = Regex::new(r"\(\d{1,2}\)$").unwrap();
let re = Regex::new(r" \(\d{1,2}\)$").unwrap();
re.replace(name, "").to_string()
}

Expand Down

0 comments on commit 2c108d9

Please sign in to comment.