chore: commit pre beets

This commit is contained in:
Jan-Ole Hübner 2025-06-08 15:19:51 +02:00
parent 1c5a3ba8e8
commit 40d9d75228
4 changed files with 55 additions and 59 deletions

View file

@ -1,30 +1,30 @@
if ! typeset -f ytr >/dev/null; then
export PATH="$PATH:$HOME/.local/bin:$HOME/bin"
export PATH="$PATH:$HOME/.local/bin:$HOME/bin"
# ── 2. Load .env files from ~/.environment.d/ ───────────────────
# Automatically export all variables defined while sourcing .env files
setopt allexport
for file in ~/.environment.d/*.env(.N); do
source "$file"
done
unset file
unsetopt allexport
# ── 2. Load .env files from ~/.environment.d/ ───────────────────
# Automatically export all variables defined while sourcing .env files
setopt allexport
for file in ~/.environment.d/*.env(.N); do
source "$file"
done
unset file
unsetopt allexport
# Load a function that allows us to import other function definitions from
# the ZSH_FUNC_PATH without providing their exact location
source "$DOTFILES_DIR/.zsh_functions/autosource.sh"
# Load a function that allows us to import other function definitions from
# the ZSH_FUNC_PATH without providing their exact location
source "$DOTFILES_DIR/.zsh_functions/autosource.sh"
# Load the rest of the zsh configs in ~/.zshrc.d/
setopt allexport
for file in ~/.zshrc.d/*.zsh(.N); do
source "$file"
done
# Load the rest of the zsh configs in ~/.zshrc.d/
setopt allexport
for file in ~/.zshrc.d/*.zsh(.N); do
source "$file"
done
source ~/.zsh_functions/youtube.zsh
source ~/.zsh_functions/youtube.zsh
fi
mdl () {
@ -58,7 +58,7 @@ cd "$mount_point/$path_on_nas"
echo "SMB share mounted successfully."
if [[ "$*" == *"tidal.com"* ]]; then
echo "TIDAL DETECTED"
tidal-dl -l $*
uvx tidal-dl -l $*
else
echo "Using qobuz-dl via uvx at: $(which uvx)"
echo "QOBUZ URL: $*"
@ -69,43 +69,43 @@ echo "Unmounting SMB share..."
sleep 1
/sbin/umount -f "$mount_point"
cd $cwd
if declare -f jelly_rescan > /dev/null; then
echo "Waiting $jelly_wait secs before triggering automatic library scan..."
sleep $jelly_wait
jelly_rescan
echo "done"
fi
#if declare -f jelly_rescan > /dev/null; then
# echo "Waiting $jelly_wait secs before triggering automatic library scan..."
# sleep $jelly_wait
# jelly_rescan
# echo "done"
#fi
}
d () {
local url="${1:-$(pbpaste)}"
local used_clipboard=0
local url="${1:-$(pbpaste)}"
local used_clipboard=0
if [[ -z "$url" ]]; then
echo "No URL provided and clipboard is empty."
return 1
fi
if [[ -z "$url" ]]; then
echo "No URL provided and clipboard is empty."
return 1
fi
# Check if URL came from clipboard
if [[ -z "$1" ]]; then
echo "started via clipboard"
used_clipboard=1
fi
# Check if URL came from clipboard
if [[ -z "$1" ]]; then
echo "started via clipboard"
used_clipboard=1
fi
case "$url" in
(*youtube*|*youtu.be*)
echo "Detected YouTube URL: $url"
ytr "$url"
;;
(*qobuz*)
echo "Detected Qobuz URL: $url"
mdl "$url"
if [[ $used_clipboard -eq 1 ]]; then
osascript -e "display dialog \"Done with Qobuz: $url\" buttons {\"OK\"}"
fi
;;
(*)
echo "Unknown URL: $url"
;;
esac
case "$url" in
(*youtube*|*youtu.be*)
echo "Detected YouTube URL: $url"
ytr "$url"
;;
(*qobuz*)
echo "Detected Qobuz URL: $url"
mdl "$url"
if [[ $used_clipboard -eq 1 ]]; then
osascript -e "display dialog \"Done with Qobuz: $url\" buttons {\"OK\"}"
fi
;;
(*)
echo "Unknown URL: $url"
;;
esac
}