feat(subs): add bazarr-bulk sync and timer
All checks were successful
Discord / discord commits (push) Has been skipped

This commit is contained in:
matt1432 2024-05-18 23:49:54 -04:00
parent 682db6c529
commit 638430a8e3
3 changed files with 24 additions and 22 deletions

View file

@ -2,20 +2,22 @@
config,
pkgs,
...
}: let
} @ inputs: let
inherit (config.vars) mainUser;
convertMkv = pkgs.callPackage ./convert.nix {inherit pkgs;};
exportSubs = pkgs.callPackage ./extract-subs {inherit pkgs;};
extractSubs = pkgs.callPackage ./extract-subs {inherit pkgs;};
sub-clean = pkgs.callPackage ./cleanup.nix {inherit pkgs;};
bazarr-bulk = pkgs.callPackage ./syncing.nix inputs;
in {
imports = [
./syncing.nix
# TODO:
# - Improve cleanup
# - Sync with bazarr-bulk
# - figure out bazarr postprocessing with subsync
environment.systemPackages = [
bazarr-bulk
];
systemd = {
services.manage-subs = {
serviceConfig = {
@ -26,8 +28,9 @@ in {
path = [
convertMkv
exportSubs
extractSubs
sub-clean
bazarr-bulk
];
script = ''
@ -40,15 +43,17 @@ in {
# Remove ads and stuff in subs
find /data/{anime,history,movies,tv} -name '*.srt' -exec sub-clean "{}" \;
# Bulk sync everything
bb movies sync
bb tv-shows sync
'';
};
/*
timers.sub-clean = {
timers.manage-subs = {
wantedBy = ["timers.target"];
partOf = ["manage-subs.service"];
timerConfig.OnCalendar = ["0:00:00"];
};
*/
};
}

View file

@ -6,13 +6,10 @@
...
}: let
bbPkg = bazarr-bulk.packages.${pkgs.system}.default;
in {
environment.systemPackages = [
(pkgs.writeShellApplication {
in
pkgs.writeShellApplication {
name = "bb";
text = ''
exec ${lib.getExe bbPkg} --config ${config.sops.secrets.bazarr-bulk.path} "$@"
'';
})
];
}

Binary file not shown.