Add media handling and download flow

This expands list/search sessions, adds media downloads with yt-dlp, and saves images/videos to the vault with optional titled finishes for cleaner browsing.
This commit is contained in:
TheGeneralist 2026-02-15 19:03:35 +01:00
parent 08d5e8aa5e
commit 99d436a37a
Signed by: thegeneralist01
SSH key fingerprint: SHA256:pp9qddbCNmVNoSjevdvQvM5z0DHN7LTa8qBMbcMq/R4
2 changed files with 1205 additions and 35 deletions

View file

@ -43,7 +43,12 @@
data_dir = "/var/lib/readlater-bot";
retry_interval_seconds = 30;
};
mergedSettings = defaultSettings // cfg.settings;
mergedSettings =
defaultSettings
// cfg.settings
// lib.optionalAttrs (cfg.mediaDir != null) {
media_dir = cfg.mediaDir;
};
settingsFile = tomlFormat.generate "readlater-bot.toml" mergedSettings;
runtimeConfig = "/run/readlater-bot/config.toml";
useRuntimeConfig = cfg.configFile == null;
@ -82,6 +87,11 @@
default = "readlater-bot";
description = "Group for the bot service.";
};
mediaDir = lib.mkOption {
type = lib.types.nullOr lib.types.str;
default = null;
description = "Directory for storing media downloads (images/videos).";
};
};
config = lib.mkIf cfg.enable {
@ -118,6 +128,7 @@
path = [
pkgs.git
pkgs.openssh
pkgs.yt-dlp
];
preStart = lib.optionalString useRuntimeConfig ''
umask 0077