more music stuff

This commit is contained in:
Anish Lakhwara 2025-09-16 10:47:50 -07:00
parent cfdd468453
commit 266c981cd4
2 changed files with 5 additions and 1 deletions

View file

@ -5,6 +5,8 @@
serviceConfig.Type = "oneshot"; serviceConfig.Type = "oneshot";
path = [ path = [
pkgs.coreutils pkgs.coreutils
pkgs.openssh
pkgs.gawk
pkgs.rsync pkgs.rsync
pkgs.beets pkgs.beets
]; ];
@ -13,7 +15,7 @@
User = "anish"; User = "anish";
}; };
}; };
systemd.timers.get-music-timer = { systemd.timers.get-music-sync = {
wantedBy = [ "timers.target" ]; wantedBy = [ "timers.target" ];
partOf = [ "get-music-sync.service" ]; partOf = [ "get-music-sync.service" ];
timerConfig.OnCalendar = [ "hourly" ]; timerConfig.OnCalendar = [ "hourly" ];

View file

@ -45,6 +45,8 @@ while IFS= read -r album; do
# Import to beets # Import to beets
echo "$(date): Importing $album to beets..." >>"$LOG_FILE" echo "$(date): Importing $album to beets..." >>"$LOG_FILE"
# Set umask to allow group read/write access
umask 002
if beet -p fetchart import -m -l /home/anish/music.log -q -g "$LOCAL_PATH/$album"; then if beet -p fetchart import -m -l /home/anish/music.log -q -g "$LOCAL_PATH/$album"; then
echo "$(date): Successfully imported $album to beets" >>"$LOG_FILE" echo "$(date): Successfully imported $album to beets" >>"$LOG_FILE"
else else