# yt-dlp and media playback — YouTube downloader with MPV integration.
{
  config,
  lib,
  pkgs,
  ...
}:
with lib; let
  cfg = config.profiles.media.ytDlp;
in {
  options.profiles.media.ytDlp.enable = mkEnableOption "enable yt-dlp and media playback";

  config = mkIf cfg.enable {
    home.packages = with pkgs; [
      plexamp
      webcord
    ];

    programs.mpv = {
      enable = true;
      bindings = {
        WHEEL_UP = "seek 10";
        WHEEL_DOWN = "seek -10";
      };
      config = {
        profile = "gpu-hq";
        ytdl-format = "bestvideo+bestaudio";
      };
    };
  };
}
