MBS-6395, call DurationLookup->update() on medium insert + add test.
Kuno
Branch: warp/musicbrainz-server:mbs-6395
warp/musicbrainz-server:mbs-6395
Branch: metabrainz/musicbrainz-server:master
metabrainz/musicbrainz-server:master
Merged
#230 · Created  · Last updated
Description
This fixes the bug but doesn't correct the data which is now corrupted. I'll work on that in a separate branch / pull request.
NOTE: currently the diff shown here is busted, and I do not know why. Please check the actual changes with git diff.
UPDATE: I just realized this is not enough. Previously doing this on insert was sufficient because tracklists never changed -- they would be inserted and garbage collected. But mediums can change, so this also needs to happen on other medium edits.
UPDATE 2: Only Data::Medium, Edit::Medium::Edit and Edit::Release::EditArtist call Track->update, the last of which obviously only changes the artist, not the track lengths. I've added DurationLookup->update to Edit::Medium::Edit.
UPDATE 3: changed DurationLookup->update to correctly deal with entries which need to be deleted and with discs on which some tracks have a length, but not all.
UPDATE 4: move DurationLookup->update calls to Data::Track.
UPDATE 5: don't try to get track.medium from deleted tracks.
This fixes the bug but doesn't correct the data which is now corrupted. I'll work on that in a separate branch / pull request.
NOTE: currently the diff shown here is busted, and I do not know why. Please check the actual changes with git diff.
UPDATE: I just realized this is not enough. Previously doing this on insert was sufficient because tracklists never changed -- they would be inserted and garbage collected. But mediums can change, so this also needs to happen on other medium edits.
UPDATE 2: Only Data::Medium, Edit::Medium::Edit and Edit::Release::EditArtist call Track->update, the last of which obviously only changes the artist, not the track lengths. I've added DurationLookup->update to Edit::Medium::Edit.
UPDATE 3: changed DurationLookup->update to correctly deal with entries which need to be deleted and with discs on which some tracks have a length, but not all.
UPDATE 4: move DurationLookup->update calls to Data::Track.
UPDATE 5: don't try to get track.medium from deleted tracks.