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

Allow absolute path mismatch when getting virtual folder info #11520

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

gnattu
Copy link
Member

@gnattu gnattu commented May 9, 2024

We have historically required the path stored in the database to exactly match the actual path on the filesystem to retrieve virtual folder information, dating back to the Emby era. However, this approach can cause issues when symbolic links are involved, as the link path may differ from the actual pointed path. To address this, allow matching based solely on the folder name when absolute path checking fails, mitigating such problems.

I have no idea why this works previously for 10.8 as @joshuaboniface said. The mismatching path should never worked as the code is from emby.

Changes

  • allow matching based solely on the folder name when absolute path checking fails for GetVirtualFolders

Issues

Fixes jellyfin/jellyfin-web#4945 Although I don't understand why it worked for 10.8

We have historically required the path stored in the database to exactly match the actual path on the filesystem to retrieve virtual folder information, dating back to the Emby era. However, this approach can cause issues when symbolic links are involved, as the link path may differ from the actual pointed path. To address this, allow matching based solely on the folder name when absolute path checking fails, mitigating such problems.

Signed-off-by: gnattu <gnattuoc@me.com>
@Shadowghost Shadowghost added this to In progress in Release 10.9.z via automation May 11, 2024
@@ -1184,6 +1184,12 @@ private VirtualFolderInfo GetVirtualFolderInfo(string dir, List<BaseItem> allCol
};

var libraryFolder = allCollectionFolders.FirstOrDefault(i => string.Equals(i.Path, dir, StringComparison.OrdinalIgnoreCase));
if (libraryFolder is null && allowAbsolutePathMismatch)
{
_logger.LogWarning("Absolute path does not match any virtual folder, guessing from folder name");
Copy link
Member

Choose a reason for hiding this comment

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

Does it show somewhere in the log which path this is warning about?

@jellyfin-bot
Copy link
Contributor

This pull request has merge conflicts. Please resolve the conflicts so the PR can be successfully reviewed and merged.

@jellyfin-bot jellyfin-bot added merge conflict Merge conflicts should be resolved before a merge and removed merge conflict Merge conflicts should be resolved before a merge labels May 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Release 10.9.z
  
In progress
Development

Successfully merging this pull request may close these issues.

Edit Library can't save
4 participants