Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ Get the installer from the [Releases page](https://github.com/thonyydev/Download

The installer isn't code-signed yet, so Windows SmartScreen may warn you when you run it. Each release lists a SHA-256 hash you can check before installing.

**Updates** arrive on their own from this project's GitHub Releases and are checked against a signature before installing. With the window open, the app asks first. In the system tray, it installs them and opens again. Your history and settings are kept. You can turn this off in Settings, then install new versions by hand.
**Updates** arrive on their own from this project's GitHub Releases and are checked against a signature before installing. With the window open, the app asks first. In the system tray, it installs them and opens again. Your history and settings are kept. To look right away, use **Check for updates** in Settings. You can also turn automatic updates off there.

**To uninstall,** use Windows Settings. Your organized files are never touched. Settings and history stay in `%APPDATA%\com.thonyy.download-organizer` unless you remove them.

Expand All @@ -58,7 +58,7 @@ The installer isn't code-signed yet, so Windows SmartScreen may warn you when yo

## Privacy

Download Organizer has no account, telemetry or cloud service. Its only network use is checking GitHub for updates at startup and every 6 hours, which shares your IP address with GitHub and sends no file data. Turning off automatic updates in Settings stops it. Its local database stores file paths, sizes, dates and content hashes so that it can show your history and undo safely. When reporting a problem, remove personal file names and paths, and don't attach the database.
Download Organizer has no account, telemetry or cloud service. Its only network use is checking GitHub for updates at startup and every 6 hours, or when you check for updates yourself, which shares your IP address with GitHub and sends no file data. Turning off automatic updates in Settings stops the automatic checks. Its local database stores file paths, sizes, dates and content hashes so that it can show your history and undo safely. When reporting a problem, remove personal file names and paths, and don't attach the database.

## Feedback & Suggestions

Expand Down
9 changes: 7 additions & 2 deletions i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@
"Saved startup": "Saved startup",
"Startup, notifications and updates": "Startup, notifications and updates",
"Update automatically": "Update automatically",
"Looks for new versions on GitHub every 6 hours. When off, the app doesn't use the internet": "Looks for new versions on GitHub every 6 hours. When off, the app doesn't use the internet",
"Looks for new versions on GitHub every 6 hours. When off, the app only goes online when you check for updates": "Looks for new versions on GitHub every 6 hours. When off, the app only goes online when you check for updates",
"Saved updates": "Saved updates",
"Preferences applied on save": "Preferences applied on save",
"Start with Windows": "Start with Windows",
Expand Down Expand Up @@ -541,5 +541,10 @@
"With several folders, each file in the preview shows its source folder. Files that are only in the cloud, such as OneDrive online-only files, are left alone and never downloaded.": "With several folders, each file in the preview shows its source folder. Files that are only in the cloud, such as OneDrive online-only files, are left alone and never downloaded.",
"What's new in version": "What's new in version",
"Choose my folders": "Choose my folders",
"Got it": "Got it"
"Got it": "Got it",
"Check for updates": "Check for updates",
"Checking for updates…": "Checking for updates…",
"You have the latest version": "You have the latest version",
"Couldn't check for updates": "Couldn't check for updates",
"Check your connection and try again.": "Check your connection and try again."
}
9 changes: 7 additions & 2 deletions i18n/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@
"Saved startup": "Inicio guardado",
"Startup, notifications and updates": "Inicio, notificaciones y actualizaciones",
"Update automatically": "Actualizar automáticamente",
"Looks for new versions on GitHub every 6 hours. When off, the app doesn't use the internet": "Busca nuevas versiones en GitHub cada 6 horas. Desactivado, la aplicación no accede a internet",
"Looks for new versions on GitHub every 6 hours. When off, the app only goes online when you check for updates": "Busca nuevas versiones en GitHub cada 6 horas. Si está desactivado, la aplicación solo se conecta a internet cuando buscas actualizaciones",
"Saved updates": "Actualizaciones guardadas",
"Preferences applied on save": "Preferencias aplicadas al guardar",
"Start with Windows": "Iniciar con Windows",
Expand Down Expand Up @@ -541,5 +541,10 @@
"With several folders, each file in the preview shows its source folder. Files that are only in the cloud, such as OneDrive online-only files, are left alone and never downloaded.": "Con varias carpetas, cada archivo de la vista previa muestra su carpeta de origen. Los archivos que solo están en la nube, como los archivos solo en línea de OneDrive, se quedan donde están y nunca se descargan.",
"What's new in version": "Novedades de la versión",
"Choose my folders": "Elegir mis carpetas",
"Got it": "Entendido"
"Got it": "Entendido",
"Check for updates": "Buscar actualizaciones",
"Checking for updates…": "Buscando actualizaciones…",
"You have the latest version": "Tienes la versión más reciente",
"Couldn't check for updates": "No se pudieron buscar actualizaciones",
"Check your connection and try again.": "Revisa tu conexión e inténtalo de nuevo."
}
9 changes: 7 additions & 2 deletions i18n/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@
"Saved startup": "Démarrage enregistré",
"Startup, notifications and updates": "Démarrage, notifications et mises à jour",
"Update automatically": "Mettre à jour automatiquement",
"Looks for new versions on GitHub every 6 hours. When off, the app doesn't use the internet": "Recherche de nouvelles versions sur GitHub toutes les 6 heures. Désactivé, l'application n'accède pas à Internet",
"Looks for new versions on GitHub every 6 hours. When off, the app only goes online when you check for updates": "Recherche de nouvelles versions sur GitHub toutes les 6 heures. Désactivé, l'application ne se connecte à internet que lorsque vous recherchez des mises à jour",
"Saved updates": "Mises à jour enregistrées",
"Preferences applied on save": "Préférences appliquées à l'enregistrement",
"Start with Windows": "Démarrer avec Windows",
Expand Down Expand Up @@ -541,5 +541,10 @@
"With several folders, each file in the preview shows its source folder. Files that are only in the cloud, such as OneDrive online-only files, are left alone and never downloaded.": "Avec plusieurs dossiers, chaque fichier de l'aperçu indique son dossier source. Les fichiers qui sont uniquement dans le cloud, comme les fichiers en ligne uniquement de OneDrive, restent où ils sont et ne sont jamais téléchargés.",
"What's new in version": "Nouveautés de la version",
"Choose my folders": "Choisir mes dossiers",
"Got it": "Compris"
"Got it": "Compris",
"Check for updates": "Rechercher des mises à jour",
"Checking for updates…": "Recherche de mises à jour…",
"You have the latest version": "Vous avez la version la plus récente",
"Couldn't check for updates": "Impossible de rechercher des mises à jour",
"Check your connection and try again.": "Vérifiez votre connexion et réessayez."
}
9 changes: 7 additions & 2 deletions i18n/it.json
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@
"Saved startup": "Avvio salvato",
"Startup, notifications and updates": "Avvio, notifiche e aggiornamenti",
"Update automatically": "Aggiorna automaticamente",
"Looks for new versions on GitHub every 6 hours. When off, the app doesn't use the internet": "Cerca nuove versioni su GitHub ogni 6 ore. Se disattivato, l'app non accede a Internet",
"Looks for new versions on GitHub every 6 hours. When off, the app only goes online when you check for updates": "Cerca nuove versioni su GitHub ogni 6 ore. Se disattivato, l'app si collega a internet solo quando cerchi aggiornamenti",
"Saved updates": "Aggiornamenti salvati",
"Preferences applied on save": "Preferenze applicate al salvataggio",
"Start with Windows": "Avvia con Windows",
Expand Down Expand Up @@ -541,5 +541,10 @@
"With several folders, each file in the preview shows its source folder. Files that are only in the cloud, such as OneDrive online-only files, are left alone and never downloaded.": "Con più cartelle, ogni file nell'anteprima mostra la sua cartella di origine. I file che sono solo nel cloud, come i file solo online di OneDrive, restano dove sono e non vengono mai scaricati.",
"What's new in version": "Novità della versione",
"Choose my folders": "Scegli le mie cartelle",
"Got it": "Ho capito"
"Got it": "Ho capito",
"Check for updates": "Cerca aggiornamenti",
"Checking for updates…": "Ricerca aggiornamenti…",
"You have the latest version": "Hai la versione più recente",
"Couldn't check for updates": "Impossibile cercare aggiornamenti",
"Check your connection and try again.": "Controlla la connessione e riprova."
}
9 changes: 7 additions & 2 deletions i18n/pt-BR.json
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@
"Saved startup": "Inicialização salva",
"Startup, notifications and updates": "Inicialização, notificações e atualizações",
"Update automatically": "Atualizar automaticamente",
"Looks for new versions on GitHub every 6 hours. When off, the app doesn't use the internet": "Procura novas versões no GitHub a cada 6 horas. Desligado, o aplicativo não acessa a internet",
"Looks for new versions on GitHub every 6 hours. When off, the app only goes online when you check for updates": "Procura novas versões no GitHub a cada 6 horas. Desligado, o aplicativo só acessa a internet quando você verifica se há atualizações",
"Saved updates": "Atualizações salvas",
"Preferences applied on save": "Preferências aplicadas ao salvar",
"Start with Windows": "Iniciar com o Windows",
Expand Down Expand Up @@ -541,5 +541,10 @@
"With several folders, each file in the preview shows its source folder. Files that are only in the cloud, such as OneDrive online-only files, are left alone and never downloaded.": "Com várias pastas, cada arquivo na prévia mostra a pasta de origem. Arquivos que estão só na nuvem, como os arquivos somente online do OneDrive, ficam onde estão e nunca são baixados.",
"What's new in version": "Novidades da versão",
"Choose my folders": "Escolher minhas pastas",
"Got it": "Entendi"
"Got it": "Entendi",
"Check for updates": "Verificar atualizações",
"Checking for updates…": "Verificando atualizações…",
"You have the latest version": "Você está na versão mais recente",
"Couldn't check for updates": "Não foi possível verificar atualizações",
"Check your connection and try again.": "Confira sua conexão e tente de novo."
}
91 changes: 60 additions & 31 deletions src-tauri/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -189,43 +189,55 @@ fn install_pending_update(app: &AppHandle) -> Result<()> {
Ok(())
}

// Downloads and verifies a newer signed version. A visible window asks first; the tray has no draft to lose.
fn update_cycle(app: &AppHandle) -> Result<()> {
// Downloads and verifies a newer signed version, and returns the one ready to install.
// `asked` is a check the user started: it runs even with automatic updates off.
fn fetch_update(app: &AppHandle, asked: bool) -> Result<Option<String>> {
use tauri_plugin_updater::UpdaterExt;
let state = app.state::<AppState>();
// Turned off, the app makes no network request at all.
if !lock(&state)?.store.preferences()?.updates {
return Ok(());
// Turned off, the app makes no network request unless the user asks.
if !asked && !lock(&state)?.store.preferences()?.updates {
return Ok(None);
}
let pending = state
.update
.lock()
.map_err(|_| internal_state_error())?
.is_some();
if !pending {
let found = tauri::async_runtime::block_on(async {
let updater = app
.updater_builder()
.timeout(Duration::from_secs(300))
.build()?;
let Some(update) = updater.check().await? else {
return Ok(None);
};
let bytes = update.download(|_, _| {}, || {}).await?;
Ok::<_, tauri_plugin_updater::Error>(Some((update, bytes)))
})
.map_err(|e| e.to_string())?;
if found.is_none() {
return Ok(());
}
// Saving holds this lock too, so turning updates off can't slip in between.
let runtime = lock(&state)?;
if !runtime.store.preferences()?.updates {
return Ok(());
}
*state.update.lock().map_err(|_| internal_state_error())? = found;
drop(runtime);
let _ = app.emit("organizer-changed", ());
.as_ref()
.map(|(update, _)| update.version.clone());
if pending.is_some() {
return Ok(pending);
}
let found = tauri::async_runtime::block_on(async {
let updater = app
.updater_builder()
.timeout(Duration::from_secs(300))
.build()?;
let Some(update) = updater.check().await? else {
return Ok(None);
};
let bytes = update.download(|_, _| {}, || {}).await?;
Ok::<_, tauri_plugin_updater::Error>(Some((update, bytes)))
})
.map_err(|e| e.to_string())?;
let Some(found) = found else {
return Ok(None);
};
// Saving holds this lock too, so turning updates off can't slip in between.
let runtime = lock(&state)?;
if !asked && !runtime.store.preferences()?.updates {
return Ok(None);
}
let version = found.0.version.clone();
*state.update.lock().map_err(|_| internal_state_error())? = Some(found);
drop(runtime);
let _ = app.emit("organizer-changed", ());
Ok(Some(version))
}

// A visible window asks first; the tray has no draft to lose.
fn update_cycle(app: &AppHandle) -> Result<()> {
if fetch_update(app, false)?.is_none() {
return Ok(());
}
let hidden = app
.get_webview_window("main")
Expand Down Expand Up @@ -748,7 +760,8 @@ async fn save_preferences(
&expected,
autostart::apply,
)?;
if !preferences.updates {
// Only when turned off now: a version the user checked for by hand stays ready while it's off.
if !preferences.updates && expected.updates {
*state.update.lock().map_err(|_| internal_state_error())? = None;
}
i18n::set_language(&preferences.language);
Expand All @@ -766,6 +779,21 @@ async fn save_preferences(
.await
}

#[tauri::command]
async fn check_update(app: AppHandle) -> Result<Option<String>> {
// Like the automatic checks, a dev build must never replace itself with a release.
if cfg!(debug_assertions) {
return Err("Development builds don't check for updates".into());
}
blocking(move || fetch_update(&app, true))
.await
.map_err(|error| {
// The details are technical and in English; the person gets the next step.
eprintln!("{error}");
t("Check your connection and try again.").into()
})
}

#[tauri::command]
async fn install_update(app: AppHandle) -> Result<()> {
blocking(move || install_pending_update(&app)).await
Expand Down Expand Up @@ -880,6 +908,7 @@ fn run_application() -> std::result::Result<(), startup::StartupError> {
organize,
undo_operation,
save_preferences,
check_update,
install_update,
retry_monitoring
])
Expand Down
1 change: 1 addition & 0 deletions src/App.css
Original file line number Diff line number Diff line change
Expand Up @@ -367,6 +367,7 @@ tbody tr:has(.file-disclosure[aria-expanded=true]) { background: var(--surface-s
/* Radix Presence owns exit/unmount and focus restoration through animationend. */
@keyframes dialog-close { to { opacity: 0; transform: translateY(4px) scale(.99); } }
.spin { animation: spin 1s linear infinite; }
.update-check { display: flex; align-items: center; flex-wrap: wrap; gap: var(--space-3); padding-top: var(--space-2); }
@keyframes spin { to { transform: rotate(360deg); } }
@media (max-width: 1100px) { :root { --content-gutter: 24px; }.overview-lists { gap: var(--space-6); grid-template-columns: minmax(0,1fr) minmax(0,1fr); }.settings-section { grid-template-columns: 150px minmax(0,1fr); gap: var(--space-4); } }
@media (max-width: 850px) { :root { --sidebar-width: 168px; --content-gutter: 16px; }.source-section { padding: var(--space-4); }.route { font-size: var(--text-title); }.overview-lists { grid-template-columns: 1fr; }.file-toolbar { flex-wrap: wrap; }.search-field { flex-basis: 100%; max-width: none; }.settings-section { grid-template-columns: 1fr; }.settings-section-heading p { max-width: none; }.rule-grid { column-gap: var(--space-4); }.file-summary { grid-template-columns: repeat(2,minmax(0,1fr)); }.history-header { flex-wrap: wrap; padding-bottom: var(--space-2); }.history-header > [data-slot=button] { margin-left: var(--space-8); } }
Expand Down
16 changes: 16 additions & 0 deletions src/components/settings.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,11 @@ import { Settings } from "@/components/settings";
import { samePreferences } from "@/lib/experience";
import type { Preferences } from "@/lib/api";
import { open } from "@tauri-apps/plugin-dialog";
import { invoke } from "@tauri-apps/api/core";
import { version } from "../../package.json";

vi.mock("@tauri-apps/plugin-dialog", () => ({ open: vi.fn() }));
vi.mock("@tauri-apps/api/core", () => ({ invoke: vi.fn(), isTauri: () => true }));
afterEach(() => { cleanup(); localStorage.clear(); });

const preferences: Preferences = { source: "/isolated/source", destination: "/isolated/destination", theme: "dark", language: "pt-BR", automatic: false, enabled_categories: [], notifications: true, updates: true, autostart: false, extra_sources: ["/isolated/desktop"], rules: [{ pattern: "*.stl", folder: "Modelos", keep: false }, { pattern: "*.obj", folder: "Malhas", keep: false }] };
Expand Down Expand Up @@ -106,3 +109,16 @@ it("adiciona e remove outras pastas de origem só no rascunho", async () => {
expect(draft().extra_sources).toEqual(["/isolated/temp"]);
expect(samePreferences(preferences, { ...preferences, extra_sources: [] })).toBe(false);
});

it("verifica atualizações quando pedido e diz o resultado", async () => {
vi.mocked(invoke).mockResolvedValueOnce(null).mockResolvedValueOnce("9.9.9").mockRejectedValueOnce("Confira sua conexão e tente de novo.");
renderSettings();
const check = () => fireEvent.click(screen.getByRole("button", { name: "Verificar atualizações" }));
check();
expect(await screen.findByText(`Você está na versão mais recente (${version})`)).toBeTruthy();
expect(invoke).toHaveBeenCalledWith("check_update");
check();
expect(await screen.findByText("Nova versão pronta para instalar: 9.9.9")).toBeTruthy();
check();
expect(await screen.findByText("Não foi possível verificar atualizações. Confira sua conexão e tente de novo.")).toBeTruthy();
});
Loading
Loading