refactor: remove Spanish folder naming convention, keep English only

Remove all 'Mi Carpeta - ' references from backend and frontend.
Only 'My Folder - {username}' is now recognized as the home folder
naming convention.
This commit is contained in:
Dionisio
2026-02-13 22:33:27 +01:00
parent 05135529ce
commit 5771d82b21
3 changed files with 11 additions and 19 deletions
@@ -97,14 +97,13 @@ impl FolderHandler {
/// Checks if a folder name matches the user home-folder convention.
fn is_user_home_folder(folder_name: &str) -> bool {
folder_name.starts_with("My Folder - ") || folder_name.starts_with("Mi Carpeta - ")
folder_name.starts_with("My Folder - ")
}
/// Checks if a folder belongs to the given user.
fn folder_belongs_to_user(folder_name: &str, username: &str) -> bool {
let expected_en = format!("My Folder - {}", username);
let expected_es = format!("Mi Carpeta - {}", username);
folder_name == expected_en || folder_name == expected_es
let expected = format!("My Folder - {}", username);
folder_name == expected
}
/// Lists folders, optionally filtered by parent ID
+7 -14
View File
@@ -754,10 +754,8 @@ async function loadFiles(options = {}) {
return false;
}
// Skip other users' folders when at root (both naming conventions)
if (!app.currentPath &&
(folder.name.startsWith('My Folder - ') || folder.name.startsWith('Mi Carpeta - ')) &&
!folder.name.includes(username)) {
// Skip other users' folders when at root
if (!app.currentPath && folder.name.startsWith('My Folder - ') && !folder.name.includes(username)) {
return false;
}
@@ -1837,9 +1835,7 @@ async function findUserHomeFolder(username) {
console.log(`Found ${folderList.length} folders at root`);
// Look for a folder with a name pattern that matches the user's home folder
// Match both naming conventions (English and Spanish)
const homeFolderPatternEn = `My Folder - ${username}`;
const homeFolderPatternEs = `Mi Carpeta - ${username}`;
const homeFolderPattern = `My Folder - ${username}`;
// Filter first to remove system folders and other users' folders
const visibleFolders = folderList.filter(folder => {
@@ -1848,19 +1844,16 @@ async function findUserHomeFolder(username) {
return false;
}
// Skip other users' home folders (both naming conventions)
if ((folder.name.startsWith('Mi Carpeta - ') || folder.name.startsWith('My Folder - '))
&& !folder.name.includes(username)) {
// Skip other users' home folders
if (folder.name.startsWith('My Folder - ') && !folder.name.includes(username)) {
return false;
}
return true;
});
// Find the user's home folder from filtered list (try both patterns)
let homeFolder = visibleFolders.find(folder =>
folder.name === homeFolderPatternEn || folder.name === homeFolderPatternEs
);
// Find the user's home folder from filtered list
let homeFolder = visibleFolders.find(folder => folder.name === homeFolderPattern);
if (homeFolder) {
console.log(`Found user's home folder: ${homeFolder.name} (${homeFolder.id})`);
+1 -1
View File
@@ -394,7 +394,7 @@ const ui = {
if (isUserHomeFolder) {
// If the current folder is the user's home folder, label it as "Home"
homeItem.textContent = getTranslatedText('breadcrumb.home', 'Home');
} else if (folderName && folderName.startsWith('Mi Carpeta')) {
} else if (folderName && folderName.startsWith('My Folder')) {
// If viewing a root folder but not the user's home folder, use its full name
homeItem.textContent = folderName;
} else {