Closed tippenein closed 11 years ago
So I tried this code and it:
Are these known issues (i.e. it's still a WIP), or has it been working for you? I'll see if I can write test cases for those bugs.
(Specifically, what I did was blow away tracks.db, then ran ./manage.py createdb
. I haven't tried update
yet.)
Instead of a pull request, why don't we go back and forth together fixing the issues with this? I'll pull your changes to a feature branch on my repo and keep working on it there.
sounds good. Some tests for update would be sensible to add to this branch as well.
By the way, createdb works for me. Even more reason to write some tests I suppose
When you delete the tracks.db and rerun createdb, it groups albums and finds folder.jpg files correctly? That's quite weird.
On further investigation, there's only one album in my collection (so far) that isn't grouped and it's this one. Every other album I've tried is grouped. I'm currently trying to figure out what is special about this album or its tags that throws it off. Feel free to help. (Edit: a second album does the same thing and it's also from Free Music Archive.)
However, contrarily, I can't find any albums that do get cover art. They are all without art.
Also this is creating album objects when the album tag is the empty string. Those should get album_id NULL.
And the comparison between artist/album titles which determines same-album membership should be case insensitive.
Mystery solved: Free Music Archive's MP3s have extremely specific date information that varies between tracks.
>>> track1 = mutagen.File('01 - Chitauri Mind Field.mp3', easy=True)
>>> print track1.tags['date']
[u'2011-09-26 04:17:14']
>>> track2 = mutagen.File('02 - March of the MUTWAWA Police.mp3', easy=True)
>>> print track2.tags['date']
[u'2011-07-16 16:01:09']
Your rewritten code is comparing based on date, while master only compares artist name and album title. I'm in favor of keeping the behavior of master, disregarding dates.
I'm not sure why this is still open, but I certainly merged the feature (if not this pull request) — closing!
Did a few tests with this and it seems to work for detecting both adds and removes from the music directory. So, basically update purges old junk that's not there anymore and adds new stuff that wasn't added with createdb.
I merged in your db_test branch and got them working.