Skip to content

Commit

Permalink
revert: "fix: fix up media folder and user selectors"
Browse files Browse the repository at this point in the history
This commit partially reverts commit 0d765de.

The updated sync media folder logic was flawed, and fixing it will produce spaghetti so instead I'll revert the changes and trust the users to not make mistakes. 📿
  • Loading branch information
revam committed Sep 25, 2024
1 parent 2da817f commit 7f48195
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions Shokofin/Configuration/configController.js
Original file line number Diff line number Diff line change
Expand Up @@ -614,15 +614,9 @@ async function syncMediaFolderSettings(form) {
config.VFS_LiveInCache = form.querySelector("#VFS_LiveInCache").checked;
config.VFS_AttachRoot = form.querySelector("#VFS_AttachRoot").checked;
if (mediaFolderConfig) {
// We need to update the config for all libraries that use this media folder, because
// otherwise we will experience edge cases where the media folder is used in multiple
// libraries potentially with and without the VFS enabled.
const libraryIDs = config.MediaFolders.filter(m => m.MediaFolderId === mediaFolderId).map(m => m.LibraryId);
for (const libraryId of libraryIDs) {
for (const c of config.MediaFolders.filter(m => m.LibraryId === libraryId)) {
c.IsVirtualFileSystemEnabled = form.querySelector("#MediaFolderVirtualFileSystem").checked;
c.LibraryFilteringMode = form.querySelector("#MediaFolderLibraryFilteringMode").value;
}
for (const c of config.MediaFolders.filter(m => m.LibraryId === libraryId)) {
c.IsVirtualFileSystemEnabled = form.querySelector("#MediaFolderVirtualFileSystem").checked;
c.LibraryFilteringMode = form.querySelector("#MediaFolderLibraryFilteringMode").value;
}
}
else {
Expand Down

0 comments on commit 7f48195

Please sign in to comment.