Closed mk89pwnz closed 5 months ago
Hi @mk89pwnz,
Delete tv show and season folder if empty Is it possible to make script do that?
You are not the first to ask if MUMC can delete folders. The short answer is, it cannot. The longer answer is there are a couple reasons why.
Sonarr > Settings > Media Management > "at the top select" Show Advanced > Folders > Select - Delete Empty Folders
would it be able to add lib rescan after deleting the media?
Help me out with more details on what you are looking for here. Sounds like you want the Emby/Jellyfin server to perform a library scan after the script has run. I will try to explain why I am a little confused.
MUMC does not directly delete anything. The script sends a DELETE request for each media item to the Emby/Jellyfin server. The server decides if the DELETE request is possible (i.e. someone could be watching the media item). If the request is possible the server deletes it. If it is not possible the sever responds back to the script with an error. Because MUMC is requesting for the server to delete the media item, the server is aware the file has been deleted before it responds to MUMC that it has been deleted.
The sever updates the library database once it deletes the media item. I know this happens because if the script is immediately run again it does not try to delete the same media items twice, because the server no longer thinks they exist.
With that said, I don't understand what a library refresh would accomplish?
Let me know if I am misunderstanding your request for the library refresh.
@mk89pwnz My mistake! I did not mean to lock this conversation.
My problem is that even after deleting the files via script I still see those shows or movies in emby, they only disappear if I delete left folders manually.
This seems like the normal Emby/Jellyfin behavior when viewing from the server. My server does the same. When viewing from a client there should be an option to "hide watched content". Watched movies and tv series' with no remaining watched episodes will not be shown after the option is set on each client.
If this is something that you feel needs to be fixed; the best way is to post either to the Emby/Jellyfin github repos or on their forums and request to have "empty" media folders deleted on the server side. Another option is to ask them to add and API end point that allows deleting "empty" media (series, season, movie, album, etc...) folders.
@mk89pwnz I was wrong. You were right. Your feature request is 100% possible. Turns out Emby (and I am assuming Jellyfin) treats folders basically the same way it treats media items.
With that said, if you are still looking for a way to delete season and series folders, try out MUMC beta release v5.6.0_beta in the MUMC_dev branch which will query for empty season and series folders. If any are found, they will be deleted. Let me know how this works for you.
You can either add delete_empty_folders
to mumc_config.yaml
under advanced_settings
:
advanced_settings:
...
delete_empty_folders:
episode:
season: true
series: true
...
Or run MUMC once, which will automatically add delete_empty_folders
to mumc_config.yaml
. Then open mumc_config.yaml
in a text editor and set season: true
and series: true
.
Is it possible to make script do that? I tryed it ant it left them empty so emby still thinks those tv shows are there, also would it be able to add lib rescan after deleting the media?