From 9953932d14548185e0269e7e5f20f8ad922a0633 Mon Sep 17 00:00:00 2001 From: dm82m Date: Sat, 9 Aug 2025 17:57:55 +0200 Subject: [PATCH 1/3] 2018: adding option to clear codecs folder on addon start --- plex/config.json | 1 + plex/rootfs/etc/cont-init.d/21-folders.sh | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/plex/config.json b/plex/config.json index 952519842..1e2d5b8d6 100644 --- a/plex/config.json +++ b/plex/config.json @@ -173,6 +173,7 @@ "localdisks": "str?", "networkdisks": "str?", "skip_permissions_check": "bool?", + "clear_codecs_folder": "bool?", "smbv1": "bool?" }, "slug": "plex_nas", diff --git a/plex/rootfs/etc/cont-init.d/21-folders.sh b/plex/rootfs/etc/cont-init.d/21-folders.sh index cf80ef586..07ec6d70a 100755 --- a/plex/rootfs/etc/cont-init.d/21-folders.sh +++ b/plex/rootfs/etc/cont-init.d/21-folders.sh @@ -28,3 +28,8 @@ if ! bashio::config.true "skip_permissions_check" && [ "${PUID:-0}" != "0" ] && chown -R "$PUID:$PGID" /share/plex chmod -R 777 /share/plex fi + +# Clear Codecs folder if checked +if ! bashio::config.true "clear_codecs_folder"; then + rm -rf /share/plex/Plex\ Media\ Server/Codecs +fi From af36ad85745b5f46a4f31b26198c9b5d09afb74d Mon Sep 17 00:00:00 2001 From: Alexandre <44178713+alexbelgium@users.noreply.github.com> Date: Sun, 10 Aug 2025 00:33:16 +0200 Subject: [PATCH 2/3] Update 21-folders.sh --- plex/rootfs/etc/cont-init.d/21-folders.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/plex/rootfs/etc/cont-init.d/21-folders.sh b/plex/rootfs/etc/cont-init.d/21-folders.sh index 07ec6d70a..20f2a1636 100755 --- a/plex/rootfs/etc/cont-init.d/21-folders.sh +++ b/plex/rootfs/etc/cont-init.d/21-folders.sh @@ -25,11 +25,13 @@ fi # Adapt permissions if needed if ! bashio::config.true "skip_permissions_check" && [ "${PUID:-0}" != "0" ] && [ "${PGID:-0}" != "0" ]; then + echo "... setting permissions" chown -R "$PUID:$PGID" /share/plex chmod -R 777 /share/plex fi # Clear Codecs folder if checked -if ! bashio::config.true "clear_codecs_folder"; then - rm -rf /share/plex/Plex\ Media\ Server/Codecs +if bashio::config.true "clear_codecs_folder" && [[ -d "/share/plex/Plex Media Server/Codecs" ]]; then + echo "... deleting codecs folder" + rm -r "/share/plex/Plex Media Server/Codecs" fi From 78cb3db98bb93ab39e18f6c5be112564ef8f7d3c Mon Sep 17 00:00:00 2001 From: Alexandre <44178713+alexbelgium@users.noreply.github.com> Date: Sun, 10 Aug 2025 00:33:43 +0200 Subject: [PATCH 3/3] Update config.json --- plex/config.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plex/config.json b/plex/config.json index 1e2d5b8d6..92e20ed89 100644 --- a/plex/config.json +++ b/plex/config.json @@ -180,7 +180,7 @@ "udev": true, "url": "https://github.com/alexbelgium/hassio-addons/tree/master/plex", "usb": true, - "version": "1.42.1.10054-f333bdaa8-ls277", + "version": "1.42.1.10054-f333bdaa8-ls277-2", "video": true, "webui": "[PROTO:ssl]://[HOST]:[PORT:32400]/web" }