Add counts to MusicMediaContainer #1383
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
We were trying to figure out why no counts were written for MUSIC jobs even though the AppleMusicImporter sets the counts here:
data-transfer-project/extensions/data-transfer/portability-data-transfer-apple/src/main/java/org/datatransferproject/datatransfer/apple/music/AppleMusicImporter.java
Lines 91 to 97 in 822e0e7
And this should be preserved the same way photos counts are preserved
Upon investigating it looks like we completely disregard the counts returned from the importer in favor of the counts that are with the original exported data here:
data-transfer-project/portability-transfer/src/main/java/org/datatransferproject/transfer/CallableImporter.java
Line 80 in 822e0e7
Which works for Media jobs because the MediaContainerResource overrides the getCounts method here:
data-transfer-project/portability-types-common/src/main/java/org/datatransferproject/types/common/models/media/MediaContainerResource.java
Lines 112 to 118 in 822e0e7
This PR adds a getCounts method to the MusicMediaContainer and updates the strings that are used in the AppleMusicImporter to be the central strings instead (this prevents a mismatch in the strings that are being used)
This PR just makes things operate as they are operating for photos/media, however the larger question is in the callable importer which counts we want to use (the ones from the result of the import or the ones from the data) and that is likely a larger discussion to be had.
This also means that Apple->YTM transfers now have count information as well since the GoogleMusicImporter does not return counts