Skip to content

Commit 7e0b6c6

Browse files
authored
Merge pull request #584 from Unpackerr/unstable
fixes
2 parents 544b566 + cbab10c commit 7e0b6c6

File tree

16 files changed

+61
-34
lines changed

16 files changed

+61
-34
lines changed

.golangci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ linters:
1616
- funcorder # also lame.
1717
- noinlineerr # I like inline errors.
1818
- wsl_v5 # this one sucks compared to wsl, and lacks configurability.
19+
- gomoddirectives # we need to use our own iso9660 package until we fix the issue with the original package.
1920

2021
settings:
2122
depguard:

examples/docker-compose.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ services:
8181
- UN_LIDARR_0_DELETE_DELAY=5m
8282
- UN_LIDARR_0_DELETE_ORIG=false
8383
- UN_LIDARR_0_SYNCTHING=false
84+
- UN_LIDARR_0_SPLIT_FLAC=false
8485
## Readarr Settings
8586
- UN_READARR_0_URL=http://readarr:8787
8687
- UN_READARR_0_API_KEY=0123456789abcdef0123456789abcdef
@@ -137,4 +138,4 @@ services:
137138
- UN_CMDHOOK_0_EXCLUDE_1=lidarr
138139
- UN_CMDHOOK_0_TIMEOUT=10s
139140

140-
## => Content Auto Generated, 14 FEB 2026 03:44 UTC
141+
## => Content Auto Generated, 18 FEB 2026 06:53 UTC

examples/unpackerr.conf.example

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,9 @@ passwords = []
181181
# delete_orig = false
182182
## If you use Syncthing, setting this to true will make unpackerr wait for syncs to finish.
183183
# syncthing = false
184+
## When enabled, FLAC files with embedded CUE sheets are split into
185+
## individual track files.
186+
# split_flac = false
184187

185188
#[[readarr]]
186189
# url = "http://127.0.0.1:8787"
@@ -315,4 +318,4 @@ passwords = []
315318
## You can adjust how long to wait for the command to run.
316319
# timeout = "10s"
317320

318-
## => Content Auto Generated, 16 FEB 2026 17:44 UTC
321+
## => Content Auto Generated, 18 FEB 2026 06:53 UTC

go.mod

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@ module github.com/Unpackerr/unpackerr
22

33
go 1.26.0
44

5+
//nolint:gomoddirectives // we need to use our own iso9660 package until we fix the issue with the original package.
6+
replace github.com/kdomanski/iso9660 => github.com/Unpackerr/iso9660 v0.0.1
7+
58
require (
69
code.cloudfoundry.org/bytefmt v0.64.0
710
github.com/BurntSushi/toml v1.6.0
@@ -21,7 +24,7 @@ require (
2124
golift.io/rotatorr v0.0.0-20260217050959-f6ac6fc7b38e
2225
golift.io/starr v1.3.0
2326
golift.io/version v0.0.2
24-
golift.io/xtractr v0.3.1-0.20260218045420-698696d97b1b
27+
golift.io/xtractr v0.3.1-0.20260218060125-b814a941badb
2528
gopkg.in/yaml.v3 v3.0.1
2629
)
2730

go.sum

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ github.com/BurntSushi/toml v1.6.0 h1:dRaEfpa2VI55EwlIW72hMRHdWouJeRF7TPYhI+AUQjk
44
github.com/BurntSushi/toml v1.6.0/go.mod h1:ukJfTF/6rtPPRCnwkur4qwRxa8vTRFBF0uk2lLoLwho=
55
github.com/Masterminds/semver/v3 v3.4.0 h1:Zog+i5UMtVoCU8oKka5P7i9q9HgrJeGzI9SA1Xbatp0=
66
github.com/Masterminds/semver/v3 v3.4.0/go.mod h1:4V+yj/TJE1HU9XfppCwVMZq3I84lprf4nC11bSS5beM=
7+
github.com/Unpackerr/iso9660 v0.0.1 h1:T1sigj6u9eBuoVeeJyMRdSHi83czj5EDU7vCQUhDv7g=
8+
github.com/Unpackerr/iso9660 v0.0.1/go.mod h1:OxUSupHsO9ceI8lBLPJKWBTphLemjrCQY8LPXM7qSzU=
79
github.com/andybalholm/brotli v1.2.0 h1:ukwgCxwYrmACq68yiUqwIWnGY0cTPox/M94sVwToPjQ=
810
github.com/andybalholm/brotli v1.2.0/go.mod h1:rzTDkvFWvIrjDXZHkuS16NPggd91W3kUSvPlQ1pLaKY=
911
github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA=
@@ -83,8 +85,6 @@ github.com/icza/mighty v0.0.0-20180919140131-cfd07d671de6 h1:8UsGZ2rr2ksmEru6lTo
8385
github.com/icza/mighty v0.0.0-20180919140131-cfd07d671de6/go.mod h1:xQig96I1VNBDIWGCdTt54nHt6EeI639SmHycLYL7FkA=
8486
github.com/julienschmidt/httprouter v1.3.0 h1:U0609e9tgbseu3rBINet9P48AI/D3oJs4dN7jwJOQ1U=
8587
github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM=
86-
github.com/kdomanski/iso9660 v0.4.0 h1:BPKKdcINz3m0MdjIMwS0wx1nofsOjxOq8TOr45WGHFg=
87-
github.com/kdomanski/iso9660 v0.4.0/go.mod h1:OxUSupHsO9ceI8lBLPJKWBTphLemjrCQY8LPXM7qSzU=
8888
github.com/klauspost/compress v1.18.4 h1:RPhnKRAQ4Fh8zU2FY/6ZFDwTVTxgJ/EMydqSTzE9a2c=
8989
github.com/klauspost/compress v1.18.4/go.mod h1:R0h/fSBs8DE4ENlcrlib3PsXS61voFxhIs2DeRhCvJ4=
9090
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
@@ -254,8 +254,8 @@ golift.io/udf v0.0.1 h1:kEcJVzqqR+IEWGMuPjuVPT9DzXRDukEgsizKAKn1LF8=
254254
golift.io/udf v0.0.1/go.mod h1:ndK7AlWOh+u+nW9tNsQR95dfHsfASG5Y3dMyzVqmPjw=
255255
golift.io/version v0.0.2 h1:i0gXRuSDHKs4O0sVDUg4+vNIuOxYoXhaxspftu2FRTE=
256256
golift.io/version v0.0.2/go.mod h1:76aHNz8/Pm7CbuxIsDi97jABL5Zui3f2uZxDm4vB6hU=
257-
golift.io/xtractr v0.3.1-0.20260218045420-698696d97b1b h1:83TiUL0F/TGz6Tr2I3SGco/mED+j0eKQGSique/yI1w=
258-
golift.io/xtractr v0.3.1-0.20260218045420-698696d97b1b/go.mod h1:iL6zP/zYuXYfFhuE7cB8e+dtOo9aS0DFHX/feoxuXl4=
257+
golift.io/xtractr v0.3.1-0.20260218060125-b814a941badb h1:03V2/jDBm5QJTAFB6NxF0esrOJ85u6Vo0DIzQUk069Q=
258+
golift.io/xtractr v0.3.1-0.20260218060125-b814a941badb/go.mod h1:+eMxkIVQjwJENgn9XCSqmsPGuzWOPvn3Ez5YSRM2Dgw=
259259
google.golang.org/protobuf v1.36.11 h1:fV6ZwhNocDyBLK0dj+fg8ektcVegBBuEolpbTQyBNVE=
260260
google.golang.org/protobuf v1.36.11/go.mod h1:HTf+CrKn2C3g5S8VImy6tdcUvCska2kB7j23XfzDpco=
261261
gopkg.in/Knetic/govaluate.v3 v3.0.0/go.mod h1:csKLBORsPbafmSCGTEh3U7Ozmsuq8ZSIlKk1bcqph0E=

init/config/compose.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ func (h *Header) makeComposeDefined(prefix string, defs Defs, order []section, b
9090
var buf bytes.Buffer
9191

9292
for _, section := range order {
93-
newHeader := createDefinedSection(defs[section], h)
93+
newHeader := createDefinedSection(defs[section], h, section)
9494
// Make a brand new section and print it.
9595
buf.WriteString(newHeader.makeCompose(prefix, bare))
9696
}

init/config/config.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ func (h *Header) makeDefinedSection(defs Defs, order []section, showValue bool)
108108
var buf bytes.Buffer
109109

110110
for _, section := range order {
111-
newHeader := createDefinedSection(defs[section], h)
111+
newHeader := createDefinedSection(defs[section], h, section)
112112
// Make a brand new section and pass it back in.
113113
// Only defined sections can comment the header.
114114
buf.WriteString(newHeader.makeSection(section, !defs[section].Comment, showValue))

init/config/definitions.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -517,6 +517,15 @@ sections:
517517
recommend: *BOOLEAN
518518
short: Setting this to true makes unpackerr wait for syncthing to finish.
519519
desc: If you use Syncthing, setting this to true will make unpackerr wait for syncs to finish.
520+
- name: split_flac
521+
envvar: SPLIT_FLAC
522+
default: false
523+
recommend: *BOOLEAN
524+
apps: [lidarr]
525+
short: Split FLAC cue sheets into separate tracks.
526+
desc: |
527+
When enabled, FLAC files with embedded CUE sheets are split into
528+
individual track files.
520529
521530
# Global folder configuration.
522531
folders:

init/config/docusaurus.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ func (h *Header) makeDefinedDocs(prefix string, defs Defs, order []section) stri
148148
var buf bytes.Buffer
149149

150150
for _, section := range order {
151-
buf.WriteString(createDefinedSection(defs[section], h).makeDocs(prefix, section))
151+
buf.WriteString(createDefinedSection(defs[section], h, section).makeDocs(prefix, section))
152152
}
153153

154154
return buf.String()

init/config/main.go

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import (
1111
"net/http"
1212
"os"
1313
"path/filepath"
14+
"slices"
1415
"strings"
1516
"time"
1617

@@ -68,6 +69,7 @@ type Param struct {
6869
Desc string `yaml:"desc"`
6970
Kind string `yaml:"kind"` // "", list, conlist
7071
Recommend []Option `yaml:"recommend"`
72+
Apps []string `yaml:"apps"` // If set, param only appears for these starr app names (e.g. lidarr).
7173
}
7274

7375
type Def struct {
@@ -165,12 +167,20 @@ func openFile(fileName string) (io.ReadCloser, error) {
165167
return resp.Body, nil
166168
}
167169

168-
func createDefinedSection(def *Def, section *Header) *Header {
170+
func createDefinedSection(def *Def, section *Header, sectionName section) *Header {
171+
params := make([]*Param, 0, len(section.Params))
172+
// Filter params to only those that apply to this app (empty Apps = all apps).
173+
for _, p := range section.Params {
174+
if len(p.Apps) == 0 || slices.Contains(p.Apps, string(sectionName)) {
175+
params = append(params, p)
176+
}
177+
}
178+
169179
newSection := &Header{
170180
Text: def.Text,
171181
Prefix: def.Prefix,
172182
Title: def.Title,
173-
Params: section.Params,
183+
Params: params,
174184
Kind: section.Kind,
175185
}
176186

0 commit comments

Comments
 (0)