Files
Varaverk/Media/playback_aware_lidarr_discovery.sh
T
Gmer4Lfe e13f2fa14f feat: slskd reconnect guard in downloaders_reset, mass v2 sync
- downloaders_reset: connection check block before slskd API sections;
  triggers PUT /api/v0/server reconnect if disconnected, polls 60s,
  gates Stuck Searches and Dead Transfer Records on SLSKD_CONNECTED
- Sync all modified/new/deleted files from v2 refactor across Docker_Essentials,
  Media, Monitors, Partnership, Rsync, Tools, Transcodes, unRAID_Essentials,
  common.sh, master confs, and new Manual/README docs
2026-05-19 20:00:10 -04:00

106 lines
5.3 KiB
Bash

#!/bin/bash
# ==============================================================================================
# =========================== Playback-Aware Lidarr Discovery ==================================
# ==============================================================================================
#
# PURPOSE
# ─────────────────────────────────────────────────────────────────────────────
# Behavior-driven music discovery scoring prototype. Consumes
# Kernel/decision_engine.sh to score artist/album candidates for acquisition
# using family-aware and playback-weighted logic.
#
# WIP — not yet connected to a live data source or scheduled. Discovery logic
# is intentionally selective: higher strictness, stronger quality bias, lower
# tolerance for trend-chasing, longer behavioral memory than TV/movies.
#
# ==============================================================================================
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
ROOT_DIR="$(dirname "$(dirname "$SCRIPT_DIR")")"
source "$ROOT_DIR/load_config.sh"
source "$ROOT_DIR/Kernel/decision_engine.sh"
# ==============================================================================================
# ── CONFIG ────────────────────────────────────────────────────────────────────────────────────
# ==============================================================================================
DISCOVERY_THRESHOLD=70
# ==============================================================================================
# ── EXAMPLE CANDIDATE ─────────────────────────────────────────────────────────────────────────
# ==============================================================================================
#
# Real implementation would pull:
#
# Last.fm
# Trakt-style behavior history
# Lidarr metadata
# User weighting
# Genre affinity
# Temporal activity
#
# ==============================================================================================
ARTIST_NAME="Example Artist"
USER_SCORE=35
POPULARITY_SCORE=15
RECENCY_SCORE=10
QUALITY_SCORE=20
# ==============================================================================================
# ── SCORING ───────────────────────────────────────────────────────────────────────────────────
# ==============================================================================================
TOTAL_SCORE=$(score_candidate \
"$USER_SCORE" \
"$POPULARITY_SCORE" \
"$RECENCY_SCORE" \
"$QUALITY_SCORE"
)
# ==============================================================================================
# ── DECISION ──────────────────────────────────────────────────────────────────────────────────
# ==============================================================================================
DECISION=$(make_decision "$TOTAL_SCORE" "$DISCOVERY_THRESHOLD")
# ==============================================================================================
# ── OUTPUT ────────────────────────────────────────────────────────────────────────────────────
# ==============================================================================================
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
echo "🎵 Lidarr Discovery Candidate"
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
echo "Artist: $ARTIST_NAME"
echo "Score : $TOTAL_SCORE"
echo "Result: $DECISION"
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
# ==============================================================================================
# ── ACTION ────────────────────────────────────────────────────────────────────────────────────
# ==============================================================================================
#
# Real implementation would:
#
# Add artist to Lidarr
# Queue search
# Log decision
# Record scoring metadata
# Update history state
#
# ==============================================================================================
if [[ "$DECISION" == "ACCEPT" ]]; then
echo "Adding artist to Lidarr..."
# future:
# curl -X POST "$LIDARR_URL/api/v1/artist"
else
echo "Candidate rejected."
fi