Skip to content

Commit

Permalink
v9.8
Browse files Browse the repository at this point in the history
- DietPi-Software | ReadyMedia: Re-create config file with ours, if it does not exist yet, and merge code around the sadly enforced file logging
- DietPi-Software | Raspotify: Remove obsolete workaround
- DietPi-Software | Update fallback URLs
  • Loading branch information
MichaIng committed Sep 21, 2024
1 parent 115045a commit d9ae4ab
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 21 deletions.
6 changes: 3 additions & 3 deletions .conf/dps_39/minidlna.conf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# WARNING: After changing this option, you need to restart the service
# via: "systemctl restart minidlna"
# Note: After changing this option, you need to restart the service
# via: "systemctl restart minidlna"

# Media paths
media_dir=A,/mnt/dietpi_userdata/Music
Expand All @@ -11,7 +11,7 @@ db_dir=/mnt/dietpi_userdata/.MiniDLNA_Cache

# Must be one of "off", "fatal", "error", "warn", "info" or "debug".
# "off" turns of logging entirely, "fatal" is the highest level of importance.
# Access logs via: "journalctl -u minidlna", on Bullseye in /var/log/minidlna.
# Access logs via: "journalctl -u minidlna" and /var/log/minidlna.
log_level=warn

# Use a different container as the root of the directory tree presented to
Expand Down
28 changes: 10 additions & 18 deletions dietpi/dietpi-software
Original file line number Diff line number Diff line change
Expand Up @@ -5149,19 +5149,20 @@ _EOF_

if To_Install 39 minidlna # ReadyMedia
then
# Config
[[ -f '/etc/minidlna.conf' ]] || dps_index=$software_id Download_Install 'minidlna.conf' /etc/minidlna.conf

G_AGI minidlna
G_EXEC systemctl stop minidlna

# Remove obsolete service files
# Remove obsolete service file
Remove_SysV minidlna 1
[[ -f '/lib/systemd/system/minidlna.service' ]] && G_EXEC rm /lib/systemd/system/minidlna.service
[[ -d '/var/log/minidlna' ]] && G_EXEC rm -R /var/log/minidlna

# User: Make "dietpi" the primary group to enable cross-access to media files
Create_User -g dietpi -G minidlna -d /var/lib/minidlna minidlna

# Service
cat << _EOF_ > /etc/systemd/system/minidlna.service
# Service: Debian patch enforces file logging, overriding "-S": https://github.com/MichaIng/DietPi/issues/4745
cat << '_EOF_' > /etc/systemd/system/minidlna.service
[Unit]
Description=ReadyMedia (DietPi)
Documentation=man:minidlnad(1) man:minidlna.conf(5)
Expand All @@ -5170,18 +5171,12 @@ After=network-online.target remote-fs.target

[Service]
User=minidlna
ExecStart=$(command -v minidlnad) -S -R -f /etc/minidlna.conf -P /dev/null
LogsDirectory=minidlna
ExecStart=/usr/sbin/minidlnad -S -R -f /etc/minidlna.conf -P /dev/null

[Install]
WantedBy=multi-user.target
_EOF_
# Debian patched forced file logging inside, overriding "-S": https://github.com/MichaIng/DietPi/issues/4745
G_CONFIG_INJECT 'LogsDirectory=' 'LogsDirectory=minidlna' /etc/systemd/system/minidlna.service 'User='

# Config
G_BACKUP_FP /etc/minidlna.conf
dps_index=$software_id Download_Install 'minidlna.conf' /etc/minidlna.conf

# Cache
G_EXEC mkdir -p /mnt/dietpi_userdata/.MiniDLNA_Cache
G_EXEC chown -R minidlna:root /mnt/dietpi_userdata/.MiniDLNA_Cache
Expand Down Expand Up @@ -6313,7 +6308,7 @@ _EOF_
*) local arch='x64';;
esac

local fallback_url="https://github.com/Kareadita/Kavita/releases/download/v0.8.3/kavita-linux-$arch.tar.gz"
local fallback_url="https://github.com/Kareadita/Kavita/releases/download/v0.8.3.2/kavita-linux-$arch.tar.gz"
Download_Install "$(curl -sSfL 'https://api.github.com/repos/Kareadita/Kavita/releases/latest' | mawk -F\" "/^ *\"browser_download_url\": \".*\/kavita-linux-$arch\.tar\.gz\"$/{print \$4}")"
G_EXEC chmod +x Kavita/Kavita

Expand Down Expand Up @@ -9545,7 +9540,7 @@ _EOF_
esac

url=$(curl -sSfL 'https://api.github.com/repos/Radarr/Radarr/releases/latest' | mawk -F\" "/^ *\"browser_download_url\": \".*linux-core-$arch\.tar\.gz\"$/{print \$4}")
local fallback_url="https://github.com/Radarr/Radarr/releases/download/v5.9.1.9070/Radarr.master.5.9.1.9070.linux-core-$arch.tar.gz"
local fallback_url="https://github.com/Radarr/Radarr/releases/download/v5.10.4.9218/Radarr.master.5.10.4.9218.linux-core-$arch.tar.gz"
fi

Download_Install "$url"
Expand Down Expand Up @@ -10846,9 +10841,6 @@ _EOF_

# APT package
G_AGI raspotify

# Temporary workaround for: https://github.com/dtcooper/raspotify/pull/674
G_CONFIG_INJECT 'LIBRESPOT_AUTOPLAY=' 'LIBRESPOT_AUTOPLAY=on' /etc/raspotify/conf
fi

# Stop service
Expand Down

0 comments on commit d9ae4ab

Please sign in to comment.