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

iTunes: Obtain FileAccess before accessing iTunes XML #13013

Merged
merged 2 commits into from
May 6, 2024

Conversation

fwcd
Copy link
Member

@fwcd fwcd commented Mar 27, 2024

This fixes an issue where opening an iTunes XML outside sandboxed directories would error in App Sandbox-enabled macOS builds, triggering the following dialog:

Screenshot 2024-03-27 at 23 33 34

#13012 reveals that the error in this case is "Operation not permitted". Obtaining a mixxx::FileAccess fixes the issue.

@@ -65,6 +67,9 @@ ITunesImport ITunesXMLImporter::importLibrary() {
ITunesImport iTunesImport;
bool isMusicFolderLocatedAfterTracks = false;

// In sandboxed builds we have to obtain an access token
auto access = mixxx::FileAccess(mixxx::FileInfo(m_xmlFilePath));
Copy link
Member Author

Choose a reason for hiding this comment

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

Two notes on this:

  • It would be nice if someone could verify that this still works properly on Windows/Linux (though I'd be very surprised if there were any issues given that the browse feature obtains access tokens in the same manner).
  • We should probably also do this for the Serato/Traktor/... integrations

@fwcd fwcd changed the title ITunesXMLImporter: Obtain FileAccess before accessing iTunes XML iTunes: Obtain FileAccess before accessing iTunes XML Mar 27, 2024
@daschuer
Copy link
Member

The error message looks confusing for this case. Can you adjust it as well?
It is issued here, where we not even go a root item:

QMessageBox::warning(

@fwcd fwcd force-pushed the itunes-xml-access-token-2.4 branch from fdd3b08 to 92030cf Compare April 30, 2024 15:43
@fwcd fwcd requested a review from daschuer May 5, 2024 14:44
Copy link
Member

@daschuer daschuer left a comment

Choose a reason for hiding this comment

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

LGTM, thank you.

Can you file an issue for investigating the problem with other third party libraries?

@daschuer daschuer merged commit c0fbcea into mixxxdj:2.4 May 6, 2024
14 checks passed
@fwcd fwcd deleted the itunes-xml-access-token-2.4 branch July 23, 2024 10:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants