Skip to content

Resolve symlinks when comparing recent files against last played file #3789

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

Merged
merged 2 commits into from
Nov 6, 2022

Conversation

svobs
Copy link
Contributor

@svobs svobs commented Jun 4, 2022


Description:
The last played file is checked against the recent files list so that it doesn't appear twice, but if one is a symlink, it can give a false negative and result in a duplicate listing. This seems to be a bigger problem for files in /tmp and /var, which Apple now links to /private/tmp and /private/var, so they can have different paths depending on which MacOS API they came from.

This fix adds resolvingSymlinksInPath() to both sides of the comparison, which is needed to normalize both paths. Apple treats /var and /tmp a bit strangely. See this discussion.

@svobs svobs force-pushed the recent-files-symlink-fix branch from 21e6c65 to e91b627 Compare July 25, 2022 07:23
@svobs svobs force-pushed the recent-files-symlink-fix branch from 2d6f854 to 5f1149f Compare November 4, 2022 02:59
@svobs svobs force-pushed the recent-files-symlink-fix branch from 5f1149f to 824ef95 Compare November 4, 2022 03:05
@uiryuu
Copy link
Member

uiryuu commented Nov 5, 2022

Pending one more approve then we can merge it!

Ah, my Swift newbie code! Thanks

Co-authored-by: Saagar Jha <saagar@saagarjha.com>
@uiryuu uiryuu merged commit 6079eec into iina:develop Nov 6, 2022
@uiryuu
Copy link
Member

uiryuu commented Nov 6, 2022

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Symlinks in recently opened files can cause duplicates in Welcome Window
3 participants