-
-
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
Automatically update track metadata from file tags if outdated #4218
Conversation
Pull Request Test Coverage Report for Build 1154288098
💛 - Coveralls |
Did you consider the special case where the user has metadata export enabled, but not Serato metadata export? Or should we exclude serato metadata completely because it's not completely lossless? |
I have reverted the preference changes regarding Serato metadata. There should not be any distinction between an automatic or manual import/export, both should behave exactly the same. I don't want to split the option into Export only (one-way sync) and "Export/Re-import" (two-way sync). Every new option increases the maintenance burden. Either all-in (= full sync) or all-out (= no sync), but no middle ground. Please give an example where this doesn't work as expect for a file with Serato tags. Then we can create a test and try to find a solution for resolving the issues. |
I'm open to remove the separate preferences option for serato export, as there doesn't seem to be major issues with it (or nobody besides me tested it). However, I'm worried about potential data loss. For example, saved loops can't have a color in serato, but they can in Mixxx. What happens in the following case?
|
How to merge existing data with (re-)imported data from Serato tags must be solved in the Serato tag import code. This issue also occurs when re-importing metadata manually. We need to investigate that. I have already experienced issues with the round-trip in the past and had to disable writing of Serato tags: https://bugs.launchpad.net/mixxx/+bug/1921646 |
When loading a track from the database check if the underlying file has been modified. If the time stamp is newer than the timestamp of the last synchronization then update track metadata from file tags. But only if export of track metadata into file tags has been enabled by the user to reduce surprising side-effects to a minimum. Introducing a new configuration option for this feature has deliberately been avoided to reduce the number of possible configurations. Either you want to keep your file tags synchronized or not, no exceptions! # Conflicts: # src/sources/metadatasourcetaglib.cpp
</property> | ||
</widget> | ||
</item> | ||
<item row="1" column="0"> | ||
<widget class="QCheckBox" name="checkBox_SeratoMetadataExport"> | ||
<property name="text"> | ||
<string>Write Serato Metadata to files (experimental)</string> | ||
<string>Write Serato metadata to files (experimental)</string> |
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.
Is this now also in both directions?
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.
Serato metadata is implicitly re-imported if available. Not sure what happens when new cue points/loops and color have been edited in Mixxx and the file is re-imported.
I have added a TODO.
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.
@Holzhaus Can you test/explain the situation, that we can adjust the text in one or the other direction?
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 don't have the time to deal with these incompatibilities or special cases that may only affect a few users. The only option then is to introduce a new preference setting that explicitly enables re-import of updated metadata with a disclaimer. |
Changing the current behavior of how Serato metadata is synchronized is out of scope. If merging of existing with imported metadata is desired then this has to be implemented separately, non-trivial. Currently metadata is simply replaced. The behavior is documented and the user is informed about it, see uklotzde@f315803. |
This is becoming mature. Is it still a draft? I think it required some manual tests. Please remove the draft state of ready for that. |
…tadata-sync # Conflicts: # src/preferences/dialog/dlgpreflibrary.cpp
@Holzhaus will you have time to do a final review soon? |
I didn't rebase on purpose and resolved the recent conflicts by merging. No substantial changes expected. The TODOs are just sit there as a reminder what would be desirable. Edit: Marked as optional, because I am unsure how much more time I am willing to spend on this. |
Please note that I marked this PR as ready weeks ago. The open TODOs might be confusing. |
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.
LGTM, Thank you.
Sorry for the delay, this has slipped through.
TODO:
When loading a track from the database check if the underlying file has been modified. If the time stamp is newer than the timestamp of the last synchronization then update track metadata from file tags. Please note that this only works for files that have been (re-)imported with the new
sourceSynchronizedAt
property populated. Existing tracks in the library are not updated to prevent overwriting of modified data.Restriction: Only iff export of track metadata into file tags has been enabled by the user to reduce surprising side-effects to a minimum. Introducing a new configuration option for this feature has deliberately been avoided to reduce the number of possible configurations. Either you want to keep your file tags synchronized or not, no exceptions! Consequently I have re-phrased the preference options.
Migration
Existing files without a synchronization time stamp are unaffected. The following query could be used to enforce that those files are re-imported eventually:
Currently, there is no user operation in Mixxx to trigger this. If we want to offer this option to users we need to be clear about the consequences! The next time when such a file/track is loaded its properties in Mixxx will be replaced unconditionally with values from the file tags. Beat grid and cue points are preserved, as well as properties that are missing in file tags. Out of scope of this PR.
The query is also useful for testing, if you are sure that your file tags are up-to-date or considered more recent than the information stored in Mixxx.