diff --git a/transmission/CHANGELOG.md b/transmission/CHANGELOG.md index 918fed3b92..6c3cb51dca 100644 --- a/transmission/CHANGELOG.md +++ b/transmission/CHANGELOG.md @@ -1,3 +1,6 @@ +## 4.1.3.1 (2026-09-12) +- Add `incomplete_dir_enabled` (default `true`): set to `false` to permanently disable the incomplete-downloads directory. Restarting the add-on always overwrote Transmission's own Web UI toggle for this back to enabled (#3059); this option is read on every restart instead, so it actually sticks +- Fix a latent bug in the same code: an install where `incomplete_dir` was entirely absent from options (rather than emptied) would create and use a directory literally named `null` ## 4.1.3 (2026-07-04) - Update to latest version from linuxserver/docker-transmission (changelog : https://github.com/linuxserver/docker-transmission/releases) diff --git a/transmission/README.md b/transmission/README.md index 3f0f2fe702..8793c094db 100644 --- a/transmission/README.md +++ b/transmission/README.md @@ -62,6 +62,7 @@ Configurations can be done through the app webUI, except for the following optio | `TZ` | str | | Timezone (e.g., `Europe/London`) | | `download_dir` | str | `/share/downloads` | Directory for completed downloads | | `incomplete_dir` | str | `/share/incomplete` | Directory for incomplete downloads | +| `incomplete_dir_enabled` | bool | `true` | Set to `false` to permanently disable the incomplete-downloads directory. Transmission's own Web UI toggle for this is overwritten on every add-on restart, so use this option instead | | `watch_dir` | str | | Directory to watch for torrent files | | `customUI` | list | `flood-for-transmission` | Web UI (standard/transmission-web-control/kettu/flood-for-transmission) | | `user` | str | | Web UI username | diff --git a/transmission/config.yaml b/transmission/config.yaml index 9cbb2cc274..3d0cdf95f6 100644 --- a/transmission/config.yaml +++ b/transmission/config.yaml @@ -87,6 +87,7 @@ options: customUI: flood-for-transmission download_dir: /share/downloads incomplete_dir: /share/incomplete + incomplete_dir_enabled: true panel_admin: false panel_icon: mdi:transmission-tower ports: @@ -114,6 +115,7 @@ schema: customUI: list(standard|transmission-web-control|kettu|flood-for-transmission) download_dir: str incomplete_dir: str? + incomplete_dir_enabled: bool? localdisks: str? networkdisks: str? pass: str? @@ -124,4 +126,4 @@ schema: slug: transmission_ls udev: true url: https://github.com/alexbelgium/hassio-addons -version: "4.1.3" +version: "4.1.3.1" diff --git a/transmission/rootfs/etc/cont-init.d/01-config.sh b/transmission/rootfs/etc/cont-init.d/01-config.sh index 74edc048d4..13398d57df 100755 --- a/transmission/rootfs/etc/cont-init.d/01-config.sh +++ b/transmission/rootfs/etc/cont-init.d/01-config.sh @@ -57,6 +57,15 @@ bashio::log.warning "If UI was changed, you need to clear browser cache for it t echo "Creating config" download_dir=$(bashio::config 'download_dir') incomplete_dir=$(bashio::config 'incomplete_dir') +# bashio::config prints the literal string "null" for an absent option (its +# own default-value argument cannot be an empty string: bash's ${2:-null} +# treats "" the same as unset). Without this, an option missing entirely +# (upgrade from before this key existed) would count as a 4-character dir and +# create one literally named "null" +[ "$incomplete_dir" = "null" ] && incomplete_dir="" +# Enabled unless explicitly false: an absent key reads as "null" in bashio and +# as "" in the standalone shim, which ignores bashio::config's default argument +incomplete_dir_enabled=$(bashio::config 'incomplete_dir_enabled') CONFIG=$(< $CONFIGDIR/settings.json) # Permissions @@ -64,8 +73,11 @@ echo "Updating permissions" mkdir -p "$download_dir" chown "$PUID:$PGID" "$download_dir" -# if incomplete dir > 2, to allow both null and '', set it as existing -if [ ${#incomplete_dir} -ge 2 ]; then +# The addon's own toggle wins on every restart, which is the point: Transmission's +# Web UI toggle is overwritten here regardless, so a permanent "off" has to come +# from an option this script reads, not from the Web UI (issue #3059). A dir +# shorter than 2 characters (empty, "/") is treated as unset either way. +if [ "$incomplete_dir_enabled" != "false" ] && [ ${#incomplete_dir} -ge 2 ]; then echo "Incomplete dir set: $incomplete_dir" CONFIG=$(bashio::jq "${CONFIG}" ".\"incomplete-dir-enabled\"=true") mkdir -p "$incomplete_dir"