Closed microniko closed 5 months ago
I've noticed that the podcasts remaining after the purge are listed in the left-hand area when I select "podcasts" from the drop-down list (corresponds to the folder where the podcasts are stored). (I restored the snapshot of the VM hosting Airsonic)
@microniko
The first issue regarding podcast episodes still appearing in the list despite being marked as deleted is because, currently, the system only supports a soft delete for podcast episodes. This means they are marked as deleted but not completely removed from the database. However, this can be improved by implementing a hard delete as part of the clean database process, which would allow for complete removal of these episodes.
The second issue, where some podcasts are deleted during the database cleanup, is likely due to the relationship between 'channel' and 'media_file' being set to cascade delete. It seems that if the 'present' flag for media files associated with a channel is set to false, they get removed in the clean database process. This is probably why some podcasts are unintentionally deleted.
Can I delete podcast episodes that are marked as deleted in the database without any side effects ?
At present, the functionality to delete podcast episodes that are marked as deleted from the database without any side effects does not exist in the system.
@kagemomiji, thanks for your replies.
1. Issue with Podcast Episodes Remaining in the List After Deletion:
The first issue regarding podcast episodes still appearing in the list despite being marked as deleted is because, currently, the system only supports a soft delete for podcast episodes. This means they are marked as deleted but not completely removed from the database. However, this can be improved by implementing a hard delete as part of the clean database process, which would allow for complete removal of these episodes.
Can I delete podcast episodes that are marked as deleted in the database without any side effects ?
At present, the functionality to delete podcast episodes that are marked as deleted from the database without any side effects does not exist in the system.
Ok, I understand that there is noting in Airsonic to do this. But, can I do it directly in the db via Mariadb prompt ? Could this eventually cause a problem in the database ? Something like :
delete from podcast_episode where status="deleted";
2. Podcast Episodes Getting Deleted During Database Cleanup:
The second issue, where some podcasts are deleted during the database cleanup, is likely due to the relationship between 'channel' and 'media_file' being set to cascade delete. It seems that if the 'present' flag for media files associated with a channel is set to false, they get removed in the clean database process. This is probably why some podcasts are unintentionally deleted.
I don't understand if this is a bug or a feature ;-) and if there's anything I can do to avoid it?
@microniko
Ok, I understand that there is noting in Airsonic to do this. But, can I do it directly in the db via Mariadb prompt ? Could this eventually cause a problem in the database ? Something like : delete from podcast_episode where status="deleted";
It can delete without any particular side effects or problems.
I don't understand if this is a bug or a feature ;-) and if there's anything I can do to avoid it?
Before edge-11.1.3-SNAPSHOT.20240124120602 release, there was a bug where the present
flag of media_file
would unintentionally become false if the library scan timed out. This issue could be related to that.
The specific story is as follows:
The scan times out -> Some of the media_files related to Podcasts become 'present = false' -> During database cleanup, media_files with 'present=false' are deleted, and the Podcasts are also deleted due to 'cascade delete'.
Therefore, as a solution, please update to the latest edge-release and ensure that the scan is fully completed. If you are experiencing timeouts, refer to this document and extend the scan timeout duration.
I upgraded Airsonic 11.1.3-SNAPSHOT.20240118010212 to 11.1.3-SNAPSHOT.20240128135559 then I ran a full-scan :
janv. 28 17:20:39 assurancetourix java[50441]: 2024-01-28 17:20:39.051 INFO --- o.a.p.s.MediaScannerService : Scanned media library with 12500 entries.
janv. 28 17:20:39 assurancetourix java[50441]: 2024-01-28 17:20:39.594 INFO --- o.a.p.s.MediaScannerService : Scanned media library with 12750 entries.
janv. 28 17:20:42 assurancetourix java[50441]: 2024-01-28 17:20:42.384 INFO --- o.a.p.s.MediaScannerService : Scanned media library with 13000 entries.
janv. 28 17:20:42 assurancetourix java[50441]: 2024-01-28 17:20:42.390 INFO --- o.a.p.s.MediaScannerService : Scanned media library with 13011 entries.
janv. 28 17:20:42 assurancetourix java[50441]: 2024-01-28 17:20:42.390 INFO --- o.a.p.s.MediaScannerService : Persisting albums
janv. 28 17:20:42 assurancetourix java[50441]: 2024-01-28 17:20:42.396 INFO --- o.a.p.s.MediaScannerService : Persisting artists
janv. 28 17:20:42 assurancetourix java[50441]: 2024-01-28 17:20:42.401 INFO --- o.a.p.s.MediaScannerService : Persisting genres
janv. 28 17:20:43 assurancetourix java[50441]: 2024-01-28 17:20:43.129 INFO --- o.a.p.s.MediaScannerService : Updating genres
janv. 28 17:20:43 assurancetourix java[50441]: 2024-01-28 17:20:43.129 INFO --- o.a.p.s.MediaScannerService : Marking non-present albums.
janv. 28 17:20:43 assurancetourix java[50441]: 2024-01-28 17:20:43.130 INFO --- o.a.p.s.MediaScannerService : Marking non-present artists.
janv. 28 17:20:43 assurancetourix java[50441]: 2024-01-28 17:20:43.135 INFO --- o.a.p.s.MediaScannerService : Artist persistence complete
janv. 28 17:20:43 assurancetourix java[50441]: 2024-01-28 17:20:43.136 INFO --- o.a.p.s.MediaScannerService : Album persistence complete
janv. 28 17:20:43 assurancetourix java[50441]: 2024-01-28 17:20:43.151 INFO --- o.a.p.s.MediaScannerService : Genre persistence successfully complete: true
janv. 28 17:20:43 assurancetourix java[50441]: 2024-01-28 17:20:43.152 INFO --- o.a.p.s.MediaScannerService : Completed media library scan.
janv. 28 17:20:43 assurancetourix java[50441]: 2024-01-28 17:20:43.154 INFO --- o.a.p.s.MediaScannerService : Media library scan took 336s
janv. 28 17:20:43 assurancetourix java[50441]: 2024-01-28 17:20:43.154 INFO --- o.a.p.s.MediaScannerService : Media library scan completed.
janv. 28 17:20:43 assurancetourix java[50441]: 2024-01-28 17:20:43.154 INFO --- o.a.p.service.PlaylistService : Starting playlist import.
janv. 28 17:20:43 assurancetourix java[50441]: 2024-01-28 17:20:43.154 INFO --- o.a.p.service.PlaylistService : Completed playlist import.
Then I click on Clean-up database but nothing seems happened - nothing in log… I don't loose my podcast and this is a good new :+1:
I consider this bug resolved by #337. If there are any issues, please Reopen it and I will address them.
What happened?
2 problems with podcasts, I don't know if they related. 1st : Many podcasts episodes are still in the list even though they have been deleted. The status is deleted. 2nd : when I do a Clean-up database some podcast are deleted :-(
Do you have an idea ? Can I delete podcast episodes that are marked as deleted in the database without any side effects ?
Steps to reproduce
2 examples :
Before Clean-up database :
An example :
After clean-up:
Version
11.1.x (Edge)
Version Detail
11.1.3-SNAPSHOT.20231222134307
Operating System
GNU/Linux Debian
Java Version
Apache Tomcat/9.0.80, java 17.0.9, Linux (295,6 MB / 339,0 MB)
Database
MariaDB 8.x
DB Detail
No response
Configuration paramter
Proxy Server
No response
client detail
No response
language
French
Relevant log output