[PR #120] [MERGED] [cli] clean-cache tells the truth when there is no cache #125

Closed
opened 2026-10-13 19:47:38 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Glitchy-Sheep/boosty-downloader/pull/120
Author: @Glitchy-Sheep
Created: 8/8/2026
Status: ✅ Merged
Merged: 8/8/2026
Merged by: @Glitchy-Sheep

Base: main ← Head: fix/clean-cache-honest-message


📝 Commits (1)

  • d1133fd fix: 🐛 clean-cache tells the truth when there is no cache

📊 Changes

2 files changed (+19 additions, -0 deletions)

View changed files

📝 CHANGELOG.md (+1 -0)
📝 boosty_downloader/src/cli/commands/clean_cache.py (+18 -0)

📄 Description

Summary

clean-cache reported "cleaned successfully" for authors that never had a cache - a typo in the username looked like a successful clean. Now the command says what actually happened.

Problem

  • Opening the cache creates its database, so cleaning a nonexistent cache fabricated an empty one and reported success
  • Removing the cache recreated an empty database right away, so a repeated clean was "successful" forever
  • The user could not tell a typo from a real clean

Fix

  • A missing cache file is answered before touching the database: "No cache found for - nothing to clean"
  • After a real clean the leftover empty database is removed, so a repeated clean also says there is nothing to do
  • The author folder is removed only when empty - downloaded posts stay in place

Before / After

Before: clean-cache -u glitchy-sheep (typo, no such cache) -> "Cache for glitchy-sheep has been cleaned successfully".

After: the same command -> "No cache found for glitchy-sheep - nothing to clean".

Tests

  • Checked live in all three scenarios: nonexistent name, existing cache (file really disappears), repeated clean
  • Downloaded posts survive the clean: the folder is kept when it holds anything

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Glitchy-Sheep/boosty-downloader/pull/120 **Author:** [@Glitchy-Sheep](https://github.com/Glitchy-Sheep) **Created:** 8/8/2026 **Status:** ✅ Merged **Merged:** 8/8/2026 **Merged by:** [@Glitchy-Sheep](https://github.com/Glitchy-Sheep) **Base:** `main` ← **Head:** `fix/clean-cache-honest-message` --- ### 📝 Commits (1) - [`d1133fd`](https://github.com/Glitchy-Sheep/boosty-downloader/commit/d1133fd2c2320a5ab220bada7956e78b75624f22) fix: :bug: clean-cache tells the truth when there is no cache ### 📊 Changes **2 files changed** (+19 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `CHANGELOG.md` (+1 -0) 📝 `boosty_downloader/src/cli/commands/clean_cache.py` (+18 -0) </details> ### 📄 Description ## Summary `clean-cache` reported "cleaned successfully" for authors that never had a cache - a typo in the username looked like a successful clean. Now the command says what actually happened. ## Problem - Opening the cache creates its database, so cleaning a nonexistent cache fabricated an empty one and reported success - Removing the cache recreated an empty database right away, so a repeated clean was "successful" forever - The user could not tell a typo from a real clean ## Fix - A missing cache file is answered before touching the database: "No cache found for <name> - nothing to clean" - After a real clean the leftover empty database is removed, so a repeated clean also says there is nothing to do - The author folder is removed only when empty - downloaded posts stay in place ## Before / After **Before:** `clean-cache -u glitchy-sheep` (typo, no such cache) -> "Cache for glitchy-sheep has been cleaned successfully". **After:** the same command -> "No cache found for glitchy-sheep - nothing to clean". ## Tests - Checked live in all three scenarios: nonexistent name, existing cache (file really disappears), repeated clean - Downloaded posts survive the clean: the folder is kept when it holds anything --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-13 19:47:38 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Glitchy-Sheep/boosty-downloader#125
No description provided.