-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
MusicBrainz: Extended metadata support (pre-gsoc2020) #2522
Conversation
Are you planning to apply? 😆 |
;) I have completed most of the work some time ago, but these changes have not yet been published. It's a prerequisite in case someone wants to continue working on extended topics, other than importing metadata. The missing step was to rewrite the HTTP clients for AcoustID and MusicBrainz to reuse the recently finished infrastructure that is used for aoide. It is far more complicated and inconvenient than even legacy async Rust (i.e. with futures 0.1 from 2018/2019), but at least it allows to chain multiple requests. |
Now the title should no longer be misleading. |
Also considered ready for 2.3.0. The improvements around handling of network requests and of the XML parser alone are worth to include it. Only some additional fields (like album artist and track numbers) are imported from MusicBrainz if |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some first comments.
src/library/dlgtagfetcher.cpp
Outdated
namespace { | ||
|
||
QStringList track2row(const Track& track) { | ||
const auto trackNumbers = TrackNumbers::joinStrings( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This reads as if the return value is a QStringList. I think this is not the case so it is not a good use case for auto.
We should also consider to rename the function to makeNumberOfTotalString()
or something more intelligent.
src/library/dlgtagfetcher.cpp
Outdated
|
||
namespace { | ||
|
||
QStringList track2row(const Track& track) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why 2row? Track2MetadataList.
It look like the underlying issue is, that the resultAvailable signal returning tracks.
It would be easier to understand and is probably more performant if it will directly return a custom track object containing the results (a single row) only. Can this be TrackRelease?
The string list solution here draws the column sorting into the management code which is also subobtimal. I think we should at least name the indexes of the list.
Thinking about all of this ... can't we deduplicate the results earlyer just after receiving them.
A custom deduplicate code, working in the temporary track objects would also be a solution.
Ideas?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have updated the dialog only as needed. I will not implements further improvements other than passing-through of mixxx::musicbrainz::TrackRelease
as suggested.
PS: Performance doesn't matter here. I only changed the signal types, because the status quo of using QObjects for this purpose was wrong.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The dialogue needs to be extended anyway in the future. Whoever will do this can improve the deduplication logic and replace the QStringList. The deduplication currently depends on the displayed columns that are actually displayed and therefore must be done here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The simplistic deduplication logic before is really displaced and the code is difficult to follow. Now everything is co-located on the display layer were it actually matters. It's not optimal, but without a rationale for deduplication this is the best we could do for now.
src/library/dlgtagfetcher.cpp
Outdated
importedMetadata.getTrackInfo().getMusicBrainzReleaseId() | ||
); | ||
} | ||
if (!importedMetadata.getAlbumInfo().getMusicBrainzArtistId().isNull()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder how the artist Id compared to the string representation. I think we need to handle them at once.
For example if the user changes the Artist, it does not match the string stored for this Id at music brains.
This can be an issue when handling Artist with special characters like Tiësto or P!ink or features like "Lena feat. Nico Santos"
For my feeling it is required to use the consolodated string when assigning the Artist ID.
What do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about the recording id and the title? I will not make up a custom correlation logic without any foundation.
I can only offer to implement one of the following options:
- Overwrite all fields unconditionally
- Set single fields one-by-one conditionally (current version)
If someone knows how to correlate the fields in a consistent manner, please do so. I refuse to do it, because I am not able to come up with a solution that is supposed to be "correct".
src/musicbrainz/musicbrainzxml.cpp
Outdated
DEBUG_ASSERT(reader.tokenType() != QXmlStreamReader::EndDocument); | ||
DEBUG_ASSERT(reader.tokenType() != QXmlStreamReader::DTD); | ||
DEBUG_ASSERT(reader.tokenType() != QXmlStreamReader::EntityReference); | ||
// ignore other token types |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it is Characters, Comment and ProcessingInstructions.
Please name them explicit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
Thank you. I will do some manual test before merge. Unfortunately CI build fails:
|
Thank you, it Looks and works good. |
https://bugs.launchpad.net/mixxx/+bug/1581256
https://www.mixxx.org/wiki/doku.php/gsoc2020ideas
This branch has undergone multiple transformations with intermediate steps since then. In order to get rid of obsolete code while moving to the new networking framework I had to recombine commits into larger chunks.