Better album detection songs in Acoustid (filter option?)

All your suggestions, requests and ideas for future development
Post Reply
cowmix
Power User
Posts: 30
Joined: 09 Jan 2015, 11:03

Better album detection songs in Acoustid (filter option?)

Post by cowmix »

Hello again I've moved to messing with music organization :)

Code: Select all

Roots: [/media/Downloads/.music/Lights - The Listening - 2009]
Input: /media/Downloads/.music/Lights - The Listening - 2009/07 Lights - The Last Thing On Your Mind.mp3
Input: /media/Downloads/.music/Lights - The Listening - 2009/10 Lights - Face Up.mp3
Input: /media/Downloads/.music/Lights - The Listening - 2009/05 Lights - Ice.mp3
Input: /media/Downloads/.music/Lights - The Listening - 2009/11 Lights - Lions!.mp3
Input: /media/Downloads/.music/Lights - The Listening - 2009/06 Lights - Pretend.mp3
Input: /media/Downloads/.music/Lights - The Listening - 2009/08 Lights - Second Go.mp3
Input: /media/Downloads/.music/Lights - The Listening - 2009/04 Lights - The Listening.mp3
Input: /media/Downloads/.music/Lights - The Listening - 2009/01 Lights - Saviour.mp3
Input: /media/Downloads/.music/Lights - The Listening - 2009/02 Lights - Drive My Soul.mp3
Input: /media/Downloads/.music/Lights - The Listening - 2009/15 Lights - Saviour (Colin Munroe's Unsung Mix) [Bonus Track].mp3
Input: /media/Downloads/.music/Lights - The Listening - 2009/09 Lights - February Air.mp3
Input: /media/Downloads/.music/Lights - The Listening - 2009/03 Lights - River.mp3
Input: /media/Downloads/.music/Lights - The Listening - 2009/12 Lights - Quiet.mp3
Input: /media/Downloads/.music/Lights - The Listening - 2009/14 Lights - Up Up and Away (Bonus Track).mp3
Input: /media/Downloads/.music/Lights - The Listening - 2009/13 Lights - Pretend (Reprise).mp3
Group: [music:lights the listening 2009] => [07 Lights - The Last Thing On Your Mind.mp3, 10 Lights - Face Up.mp3, 05 Lights - Ice.mp3, 11 Lights - Lions!.mp3, 06 Lights - Pretend.mp3, 08 Lights - Second Go.mp3, 04 Lights - The Listening.mp3, 01 Lights - Saviour.mp3, 02 Lights - Drive My Soul.mp3, 15 Lights - Saviour (Colin Munroe's Unsung Mix) [Bonus Track].mp3, 09 Lights - February Air.mp3, 03 Lights - River.mp3, 12 Lights - Quiet.mp3, 14 Lights - Up Up and Away (Bonus Track).mp3, 13 Lights - Pretend (Reprise).mp3]
Rename music using [AcoustID]
[TEST] Rename [/media/Downloads/.music/Lights - The Listening - 2009/01 Lights - Saviour.mp3] to [/media/Music/Lights/Lights - Saviour.mp3]
[TEST] Rename [/media/Downloads/.music/Lights - The Listening - 2009/02 Lights - Drive My Soul.mp3] to [/media/Music/Lights/LIGHTS/02 - Lights - Drive My Soul.mp3]
[TEST] Rename [/media/Downloads/.music/Lights - The Listening - 2009/03 Lights - River.mp3] to [/media/Music/Lights/The Listening/03 - Lights - River.mp3]
[TEST] Rename [/media/Downloads/.music/Lights - The Listening - 2009/04 Lights - The Listening.mp3] to [/media/Music/Lights/Saviour/02 - Lights - The Listening.mp3]
[TEST] Rename [/media/Downloads/.music/Lights - The Listening - 2009/05 Lights - Ice.mp3] to [/media/Music/Lights/The Listening/05 - Lights - Ice.mp3]
[TEST] Rename [/media/Downloads/.music/Lights - The Listening - 2009/06 Lights - Pretend.mp3] to [/media/Music/Lights/The Listening/06 - Lights - Pretend.mp3]
[TEST] Rename [/media/Downloads/.music/Lights - The Listening - 2009/07 Lights - The Last Thing On Your Mind.mp3] to [/media/Music/Lights/LIGHTS/06 - Lights - The Last Thing on Your Mind.mp3]
[TEST] Rename [/media/Downloads/.music/Lights - The Listening - 2009/08 Lights - Second Go.mp3] to [/media/Music/Lights/The Listening/08 - Lights - Second Go.mp3]
[TEST] Rename [/media/Downloads/.music/Lights - The Listening - 2009/09 Lights - February Air.mp3] to [/media/Music/Lights/Lights - February Air.mp3]
[TEST] Rename [/media/Downloads/.music/Lights - The Listening - 2009/10 Lights - Face Up.mp3] to [/media/Music/Lights/The Listening/10 - Lights - Face Up.mp3]
[TEST] Rename [/media/Downloads/.music/Lights - The Listening - 2009/11 Lights - Lions!.mp3] to [/media/Music/Lights/The Listening/11 - Lights - Lions!.mp3]
[TEST] Rename [/media/Downloads/.music/Lights - The Listening - 2009/12 Lights - Quiet.mp3] to [/media/Music/Lights/The Listening/12 - Lights - Quiet.mp3]
[TEST] Rename [/media/Downloads/.music/Lights - The Listening - 2009/13 Lights - Pretend (Reprise).mp3] to [/media/Music/Lights/The Listening/13 - Lights - Pretend (reprise).mp3]
[TEST] Rename [/media/Downloads/.music/Lights - The Listening - 2009/14 Lights - Up Up and Away (Bonus Track).mp3] to [/media/Music/Lights/The Listening/14 - Lights - Up Up and Away.mp3]
[TEST] Rename [/media/Downloads/.music/Lights - The Listening - 2009/15 Lights - Saviour (Colin Munroe's Unsung Mix) [Bonus Track].mp3] to [/media/Music/Lights/The Listening/15 - Lights - Saviour (Colin Munroe's Unsung mix).mp3]
Processed 15 files
By looking at the scource code in AcoustIDClient.java basically what happens is acoustid will return multiple releasegroups for a song, listing all the albums the song appears on but filebot will always use the first one. Is there a way to use that detection to return consistent results from acoustid by looping over releasegroups checking for a fuzzy match for a detected album name?

One possibly quick solution would to allow the filter parameter passed in rename to influence the releasegroup choice so the album name detection can be handled in amc (this would be similar to how you can pass the season for tvdb). Also greatest hits album names should not be automatically ignored if this query is passed.

maybe something like this might work?

Code: Select all

amc.groovy
rename(file:files, format:format.music, db:'AcoustID', filter:"album = album name")
rename(file:files, format:format.music, db:'AcoustID', filter:"albumArtist = artist name")
rename(file:files, format:format.music, db:'AcoustID', filter:"album = album name, albumArtist = artist name")

various filter passthroughs to AcoustIDClient...

AcoustIDClient.java
122 - public AudioTrack parseResult(String json, final int targetDuration, String filterAlbum, String filterAlbumArtist) throws IOException {
187 - if ((!"Various Artists".equalsIgnoreCase(thisRelease.albumArtist) && (thisRelease.album == null || !thisRelease.album.contains("Greatest Hits")))  || (filterAlbum && filterAlbumArtist && thisRelease.album.contains(filterAlbum) && thisRelease.albumArtist.contains(filterAlbumArtist)) || (filterAlbum && filterAlbumArtist && thisRelease.album.contains(filterAlbum) && thisRelease.albumArtist.contains(filterAlbumArtist)) || (filterAlbum && thisRelease.album.contains(filterAlbum)) || ( filterAlbumArtist && thisRelease.albumArtist.contains(filterAlbumArtist))) {
Note: I think you may also have to loop through recordings not only releasegroups?

P.S. do you have any instructions for how to build a jar from the source?
User avatar
rednoah
The Source
Posts: 23927
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Better album detection songs in Acoustid (filter option?

Post by rednoah »

Yeah, those MusicBrainz records are kinda tricky with multiple releases in all kinds of countries and collections. I don't think --filter is a good idea, since very few people will understand the problem of a certain tracks actually belonging (and rightly so) to more than one album.

Not sure if there's a way to find the "original" album. That would be a good improvement if it could be done automatically without specifying any extra parameters manually.

You should be able to build the executable jar right away assuming ant works:

Code: Select all

ant clean fatjar
EDIT:

Made some improvements with r2792 and it works much better with my tests, but there might some cases where it doesn't work at all now though :D
:idea: Please read the FAQ and How to Request Help.
cowmix
Power User
Posts: 30
Joined: 09 Jan 2015, 11:03

Re: Better album detection songs in Acoustid (filter option?

Post by cowmix »

thanks :) I'll take a look and see if ti fixes the issue I was having.

I was able to build the latest from svn with ant. One quick question is there something special I have to do when building with ant to make the svn version pass correctly?

Code: Select all

filebot -script fn:sysinfo
FileBot 4.5.3 (r0)
User avatar
rednoah
The Source
Posts: 23927
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Better album detection songs in Acoustid (filter option?

Post by rednoah »

The revision is only included with release builds. See build.xml for details. The svn-update task probably won't work if your code has uncommitted changes though.
:idea: Please read the FAQ and How to Request Help.
cowmix
Power User
Posts: 30
Joined: 09 Jan 2015, 11:03

Re: Better album detection songs in Acoustid (filter option?

Post by cowmix »

So I ended up messing around with this in groovy instead of in the java source so its easier for me to use your future updated versions without having to rebuild from sources, heres the sources for the hacked together solution I ended up that seems to work pretty decently if you want to take a look:

amc.groov: https://gist.github.com/cowmix88/02103b308e3a97e3cfeb
acoustid.groovy: https://gist.github.com/cowmix88/8a5be3bce2439b76fbc7

I pretty much use a mixture of acoustid, musicbrainz direct api and string similarity logic to update the id3 tags before pushing to filebot for moving
User avatar
rednoah
The Source
Posts: 23927
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Better album detection songs in Acoustid (filter option?

Post by rednoah »

I kinda lack testdata to test and optimise music mode well. But selected based on similarity to existing tags might yield much better results when it works. :)

Also, for string similarity I added some default methods: String.getSimilarity(otherString) ;)

http://sourceforge.net/p/filebot/code/H ... .java#l364
:idea: Please read the FAQ and How to Request Help.
cowmix
Power User
Posts: 30
Joined: 09 Jan 2015, 11:03

Re: Better album detection songs in Acoustid (filter option?

Post by cowmix »

I've switched over to using your string similarity function and cleaned up the code a bit

I created a new repo for all the stuff I'm working on:
https://github.com/cowmix88/Filebot-Scripts
Post Reply