[PR #2161] [MERGED] feat: delete podcast upon last unsubscription #2119

Closed
opened 2026-02-26 03:33:19 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/koel/koel/pull/2161
Author: @phanan
Created: 10/28/2025
Status: Merged
Merged: 10/28/2025
Merged by: @phanan

Base: masterHead: del-podcast


📝 Commits (1)

  • bb8dcac feat: delete podcast upon last unsubscription

📊 Changes

7 files changed (+120 additions, -2 deletions)

View changed files

app/Events/UserUnsubscribedFromPodcast.php (+13 -0)
app/Listeners/DeletePodcastIfNoSubscribers.php (+21 -0)
📝 app/Listeners/WriteScanLog.php (+1 -1)
📝 app/Providers/EventServiceProvider.php (+6 -0)
📝 app/Services/PodcastService.php (+8 -1)
📝 tests/Integration/Services/PodcastServiceTest.php (+20 -0)
tests/Unit/Listeners/DeletePodcastIfNoSubscribersTest.php (+51 -0)

📄 Description

Description

Dispatch an event to delete a podcast if it doesn't have any subscribers.

Motivation

In the past, unsubscribing a user simply "detached" them from a podcast, when the podcast itself remained in the database. The reason was two-fold:

  • A podcast can be subscribed to by multiple users in the system.
  • To save resources, as podcast operations can be resource-sensitive.

However, for installations that have only one user, this approach has been creating confusion: the single user expects the podcast data to be removed and is surprised to see it's not.

Screenshots (if applicable)

Checklist

  • I've tested my changes thoroughly and added tests where applicable
  • I've updated relevant documentation (if any)
  • My code follows the project's conventions

🔄 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/koel/koel/pull/2161 **Author:** [@phanan](https://github.com/phanan) **Created:** 10/28/2025 **Status:** ✅ Merged **Merged:** 10/28/2025 **Merged by:** [@phanan](https://github.com/phanan) **Base:** `master` ← **Head:** `del-podcast` --- ### 📝 Commits (1) - [`bb8dcac`](https://github.com/koel/koel/commit/bb8dcacab6c399221ac3adbe47ee123296bc35a9) feat: delete podcast upon last unsubscription ### 📊 Changes **7 files changed** (+120 additions, -2 deletions) <details> <summary>View changed files</summary> ➕ `app/Events/UserUnsubscribedFromPodcast.php` (+13 -0) ➕ `app/Listeners/DeletePodcastIfNoSubscribers.php` (+21 -0) 📝 `app/Listeners/WriteScanLog.php` (+1 -1) 📝 `app/Providers/EventServiceProvider.php` (+6 -0) 📝 `app/Services/PodcastService.php` (+8 -1) 📝 `tests/Integration/Services/PodcastServiceTest.php` (+20 -0) ➕ `tests/Unit/Listeners/DeletePodcastIfNoSubscribersTest.php` (+51 -0) </details> ### 📄 Description <!-- Thank you for contributing to Koel! Please provide a clear description of your changes below. --> ## Description Dispatch an event to delete a podcast if it doesn't have any subscribers. ## Motivation In the past, unsubscribing a user simply "detached" them from a podcast, when the podcast itself remained in the database. The reason was two-fold: - A podcast can be subscribed to by multiple users in the system. - To save resources, as podcast operations can be resource-sensitive. However, for installations that have only one user, this approach has been creating confusion: the single user expects the podcast data to be removed and is surprised to see it's not. ## Screenshots (if applicable) ## Checklist - [x] I've tested my changes thoroughly and added tests where applicable - [x] I've updated relevant documentation (if any) - [x] My code follows the project's conventions --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-26 03:33:19 +03: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
starred/koel-koel#2119
No description provided.