jesseward / discogstagger

Console based audio-file metadata tagger that uses the Discogs.com API v2 (JSON based). Relies on the Mutagen and discogs-client libraries. Currently supports FLAC and MP3 file types.
MIT License
70 stars 13 forks source link

Keep spaces in track names? #31

Closed jvilk closed 7 years ago

jvilk commented 7 years ago

Is there any way to keep spaces in track names? I removed the default {space}=_ substitution rule in the config, but it seems to remove spaces anyway.

I'd also like the option to avoid generating the nfo file and m3u playlist, but those are easy to manually delete.

jesseward commented 7 years ago

hey @jvilk thanks for the suggestion. This should be somewhat straight forward. I can work to add another configuration parameter that will expose this to the user.

jvilk commented 7 years ago

@jesseward that would be awesome. If this would take you a long time to get around to, but it's easy to see where this would be added, I might potentially be able to add the feature myself. I tried removing some suspect regular expressions locally but that didn't seem to do the trick. :)

jvilk commented 7 years ago

@jesseward just a quick poke on this. I know how managing open source projects can be. If you have an opinion on how this should be exposed in the config and point me to relevant code locations for determining track names, I might be able to do this myself since I'd like the feature very much.

jesseward commented 7 years ago

hey @jvilk , i started poking at this on the weekend. I have a few commits staged that work to clean up this script in general as it had not been maintained in a few years.

It will be python3 capable and will have the your features requested here.

jesseward commented 7 years ago

hey @jvilk , i have checked in a v3 branch .

If you'd like to try , please do the following to checkout the latest and install from the v3 branch. This will create a new virtual environment using Python 3 and install its dependencies.

git clone https://github.com/jesseward/discogstagger.git
cd discogstagger/
git checkout v3
python3 -m venv ~/.ve/d3/
source ~/.ve/d3/bin/activate
python setup.py install

I have added the following options to the configuration file. Setting the following should address your requests ..

[options]
...
# Enable the creation of the .m3u file
write_m3u = False

# Enable the creation of the .nfo file
write_nfo = False
...

[character_exceptions]
...
{space}=" "

use the script discogs-tagger to invoke/start tagging your files..

$ discogs-tagger -s pp -r 17541
2017-07-17 01:57:48,679 discogstagger.main INFO     Attempting to tag files from target destination=pp
2017-07-17 01:57:49,041 discogstagger.discogsalbum INFO     Fetching discogs release. artist=Pépé Bradock, title=6 Millions Pintades EP, id=17541
2017-07-17 01:57:49,044 discogstagger.main INFO     Tagging album 'Pépé Bradock - 6 Millions Pintades EP'
2017-07-17 01:57:49,044 discogstagger.main INFO     Creating destination directory 'Pepe Bradock-6 Millions Pintades EP-(ATA 001)-2000-jW'
2017-07-17 01:57:49,044 discogstagger.main INFO     Downloading and storing images
2017-07-17 01:57:52,156 discogstagger.main INFO     Writing file Pepe Bradock-6 Millions Pintades EP-(ATA 001)-2000-jW/01-Pepe Bradock-Life.mp3
2017-07-17 01:57:52,205 discogstagger.main INFO     Writing file Pepe Bradock-6 Millions Pintades EP-(ATA 001)-2000-jW/02-Pepe Bradock-Ghost.mp3
2017-07-17 01:57:52,227 discogstagger.main INFO     Writing file Pepe Bradock-6 Millions Pintades EP-(ATA 001)-2000-jW/03-Pepe Bradock-Peer Pressure.mp3
2017-07-17 01:57:52,248 discogstagger.main INFO     Tagging complete.
jvilk commented 7 years ago

Thanks! I will test this out tomorrow evening.

jvilk commented 7 years ago

@jesseward it works perfectly! :)

Thanks so much. I have digital copies of my entire CD music collection on a headless NAS in my home. I had EAC tag everything when I ripped the CDs using data from some database that I paid to have access to, but EAC did not fill in all of the applicable tags and the data was sometimes incorrect. Often, I would be in a rush to rip the new disc(s) I purchased to listen to it, so I would transfer it to my NAS despite the tagging issues.

To fix the files, I had to mount the NAS as a network drive to use GUI-based taggers. This is quite slow, especially since I can't run wire to my computer and must do so over wireless. It's also infeasible when I am away from home for long periods of time, such as this summer; try mounting a network drive over SSH over DSL! Naturally, I rarely ever fixed the files, and now I have about 100 different albums in various states of tagging!

Now, once I have a decent chunk of time, I can look up all of the release IDs and have discogs-tagger tag everything perfectly via a simple SSH session to the NAS. Maybe I'll finally tame my digital music files! :)

jesseward commented 7 years ago

hi @jvilk thanks for confirming things are working well.

This code has sat stale for some time, but that bump to v3.0 brings an attempt to clean things a bit. So wiring in new config options and conditionals should be a little easier now.