Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MBS-11117: Create report for too long discIDs #1700

Merged
merged 2 commits into from Oct 12, 2020

Conversation

loujine
Copy link
Contributor

@loujine loujine commented Sep 19, 2020

Problem

MBS-11117: new report about discid durations above 100 minutes, that should be fixed or removed.
cf https://community.metabrainz.org/t/sacd-types-and-discid/494807/8

Solution

cf screenshot on MBS-11117

Action

There are a few things that need a serious review and will probably need rework:

  • the report could be applied on releases but it makes more sense to have it on discids directly. Since there was no report on cdtocs yet, I had to create a lib/MusicBrainz/Server/Report/CdTocReport.pm that just passes the parameters of the report SQL query. Not sure it would make more sense to pass the 'id' there, since we don't have gid on the cdtoc table. (Edit: I had to use "id" in the end in order to use CDTocLink)

* CDTOCs are not defined with React yet. I didn't want to modify EntityLink so I just defined the href=/cdtoc/... link in root/report/components/CdTocList.js, but that should probably be changed for other conversions to React.

  • I pass durations from SQL in seconds and convert to milliseconds in JS to use formatTrackLength. Exporting durations in millisecond in SQL would be over the 2**31 integer limit in postgres

  • I don't speak Perl so I just copy-pasted lib/MusicBrainz/Server/Report/CdTocReport.pm, I'm not sure what's inside is correct

@loujine loujine force-pushed the MBS-11117-long_discids_report branch from eab9a16 to 1e39e2a Compare September 19, 2020 14:52
@loujine loujine force-pushed the MBS-11117-long_discids_report branch 5 times, most recently from 5fec551 to 8e89e6d Compare September 21, 2020 12:12
Copy link
Contributor

@yvanzo yvanzo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is currently correctly creating and filling the report table but it fails to display it on error:

TypeError: Cannot read property 'total_entries' of undefined
    at CDTocDubiousLength (webpack:///./root/report/CDTocDubiousLength.js?:113:18)

I suspect the code around inflate_rows did not find the cause yet.

@reosarevok reosarevok added the New feature Non urgent new stuff label Oct 9, 2020
DiscIDs should be assigned to only CD format mediums and should not be
above 80-something minutes. CDTOC above the cutoff (set to 100 minutes
here) were probably created with a buggy version of foo_musicbrainz and
can be removed.
Support for MediumCDTocT was added in 50ba95d
@reosarevok reosarevok force-pushed the MBS-11117-long_discids_report branch from 36fc4a9 to 686e18a Compare October 9, 2020 10:19
@reosarevok
Copy link
Member

Pushed a rebased fix. Also changed the Perl files to use CDTOC as we do elsewhere :)

Copy link
Contributor

@yvanzo yvanzo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works flawlessly. Thanks for having fixed the letter casing too.


with 'MusicBrainz::Server::Report::CDTOCReport';

sub table { 'cd_toc_dubious_length' }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess that was the missing bit.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the main issue was the link generated from the reports index was wrong, too :D But a bit of everything maybe :)

@reosarevok reosarevok merged commit 2cf4be1 into metabrainz:master Oct 12, 2020
@loujine loujine deleted the MBS-11117-long_discids_report branch October 20, 2020 19:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
New feature Non urgent new stuff
Projects
None yet
3 participants