Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
RadarrV4/V5 Support
Sonarr V4 Support
Large update to packages/dependencies
  • Loading branch information
Migz93 committed Jan 11, 2024
1 parent 7d1b9ac commit e2d0522
Show file tree
Hide file tree
Showing 25 changed files with 1,512 additions and 169 deletions.
14 changes: 7 additions & 7 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,21 +18,21 @@ jobs:
steps:
# checkout
- name: checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
fetch-depth: 0

# setup go
- name: go
uses: actions/setup-go@v1
uses: actions/setup-go@v5
with:
go-version: 1.14
go-version: 1.21.5
- run: go version
- run: go env

# cache
- name: cache
uses: actions/cache@v1
uses: actions/cache@v3
with:
path: vendor
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
Expand All @@ -53,7 +53,7 @@ jobs:
# get tag name
- name: tag_name
if: startsWith(github.ref, 'refs/tags/')
uses: olegtarasov/get-tag@v2
uses: olegtarasov/get-tag@v2.1.2
with:
tagRegex: "v?(.+)"

Expand All @@ -68,13 +68,13 @@ jobs:
# artifacts
- name: artifact_linux
uses: actions/upload-artifact@v2-preview
uses: actions/upload-artifact@v4
with:
name: build_linux
path: dist/*linux*

- name: artifact_darwin
uses: actions/upload-artifact@v2-preview
uses: actions/upload-artifact@v4
with:
name: build_darwin
path: dist/*darwin*
10 changes: 7 additions & 3 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,12 @@ jobs:
name: lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: 1.21.5
cache: false
- name: golangci-lint
uses: golangci/golangci-lint-action@v1
uses: golangci/golangci-lint-action@v3
with:
version: v1.27
version: latest
12 changes: 6 additions & 6 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ builds:
- amd64
ldflags:
- -s -w
- -X "github.com/l3uddz/wantarr/build.Version={{ .Version }}"
- -X "github.com/l3uddz/wantarr/build.GitCommit={{ .ShortCommit }}"
- -X "github.com/l3uddz/wantarr/build.Timestamp={{ .Timestamp }}"
- -X "github.com/migz93/wantarr/build.Version={{ .Version }}"
- -X "github.com/migz93/wantarr/build.GitCommit={{ .ShortCommit }}"
- -X "github.com/migz93/wantarr/build.Timestamp={{ .Timestamp }}"
flags:
- -trimpath

Expand All @@ -31,9 +31,9 @@ builds:
- -linkmode external
- -extldflags -static
- -s -w
- -X "github.com/l3uddz/wantarr/build.Version={{ .Version }}"
- -X "github.com/l3uddz/wantarr/build.GitCommit={{ .ShortCommit }}"
- -X "github.com/l3uddz/wantarr/build.Timestamp={{ .Timestamp }}"
- -X "github.com/migz93/wantarr/build.Version={{ .Version }}"
- -X "github.com/migz93/wantarr/build.GitCommit={{ .ShortCommit }}"
- -X "github.com/migz93/wantarr/build.Timestamp={{ .Timestamp }}"
flags:
- -trimpath
- -tags=netgo
Expand Down
10 changes: 5 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ ${BUILD_PATH}/${CMD}: ${GO_FILES} go.sum
CGO_ENABLED=1 go build \
-mod vendor \
-trimpath \
-ldflags "-s -w -X github.com/l3uddz/wantarr/build.Version=${VERSION} -X github.com/l3uddz/wantarr/build.GitCommit=${GIT_COMMIT} -X github.com/l3uddz/wantarr/build.Timestamp=${TIMESTAMP}" \
-ldflags "-s -w -X github.com/migz93/wantarr/build.Version=${VERSION} -X github.com/migz93/wantarr/build.GitCommit=${GIT_COMMIT} -X github.com/migz93/wantarr/build.Timestamp=${TIMESTAMP}" \
-o ${BUILD_PATH}/${CMD} \
.

Expand All @@ -84,9 +84,9 @@ publish: fetch ## Generate a release, and publish
-e VERSION="${GIT_TAG_NAME}" \
-e GIT_COMMIT="${GIT_COMMIT}" \
-e TIMESTAMP="${TIMESTAMP}" \
-v `pwd`:/go/src/github.com/l3uddz/wantarr \
-v `pwd`:/go/src/github.com/migz93/wantarr \
-v /var/run/docker.sock:/var/run/docker.sock \
-w /go/src/github.com/l3uddz/wantarr \
-w /go/src/github.com/migz93/wantarr \
neilotoole/xcgo:latest goreleaser --rm-dist

.PHONY: snapshot
Expand All @@ -95,9 +95,9 @@ snapshot: fetch ## Generate a snapshot release
-e VERSION="${VERSION}" \
-e GIT_COMMIT="${GIT_COMMIT}" \
-e TIMESTAMP="${TIMESTAMP}" \
-v `pwd`:/go/src/github.com/l3uddz/wantarr \
-v `pwd`:/go/src/github.com/migz93/wantarr \
-v /var/run/docker.sock:/var/run/docker.sock \
-w /go/src/github.com/l3uddz/wantarr \
-w /go/src/github.com/migz93/wantarr \
neilotoole/xcgo:latest goreleaser --snapshot --skip-validate --skip-publish --rm-dist

.PHONY: help
Expand Down
27 changes: 26 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,38 @@ pvr:
- `wantarr missing radarr -v -m 20`
- `wantarr cutoff radarr4k -v -m 20`

## Help
```
Available Commands:
cutoff Search for cutoff unmet media files
help Help about any command
missing Search for missing media files

Flags:
-h, --help help for missing
-m, --max-search int Exit when this many items have been searched.
-q, --queue-size int Exit when queue size reached.
-r, --refresh-cache Refresh the locally stored cache.
-s, --search-size int How many items to search at once. (default 10)

Global Flags:
-c, --config string Config file (default "config.yaml")
--config-dir string Config folder (default "C:\\Users\\migue\\AppData\\Local\\Temp\\go-build1345219734\\b001\\exe")
-d, --database string Database file (default "vault.db")
-l, --log string Log file (default "activity.log")
-v, --verbose count Verbose level
```
## Notes
Supported Sonarr Version(s):
- 3
- 4
Supported Radarr Version(s):
- 2
- 3
- 3
- 4 (Untested)
- 5
10 changes: 5 additions & 5 deletions cmd/cutoff.go
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package cmd

import (
"github.com/l3uddz/wantarr/database"
pvrObj "github.com/l3uddz/wantarr/pvr"
"time"

"github.com/migz93/wantarr/database"
pvrObj "github.com/migz93/wantarr/pvr"
"github.com/sirupsen/logrus"
"github.com/spf13/cobra"
"github.com/tommysolsen/capitalise"
"time"
)

var cutoffCmd = &cobra.Command{
Expand Down Expand Up @@ -35,7 +35,7 @@ var cutoffCmd = &cobra.Command{
// retrieve cutoff records from pvr and stash in database
existingItemsCount := database.GetItemsCount(lowerPvrName, "cutoff")
if flagRefreshCache || existingItemsCount < 1 {
log.Infof("Retrieving cutoff unmet media from %s: %q", capitalise.First(pvrConfig.Type), pvrName)
log.Infof("Retrieving cutoff unmet media from %s: %q", (pvrConfig.Type), pvrName)

cutoffRecords, err := pvr.GetWantedCutoff()
if err != nil {
Expand Down
10 changes: 5 additions & 5 deletions cmd/missing.go
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package cmd

import (
"github.com/l3uddz/wantarr/database"
pvrObj "github.com/l3uddz/wantarr/pvr"
"time"

"github.com/migz93/wantarr/database"
pvrObj "github.com/migz93/wantarr/pvr"
"github.com/sirupsen/logrus"
"github.com/spf13/cobra"
"github.com/tommysolsen/capitalise"
"time"
)

var missingCmd = &cobra.Command{
Expand Down Expand Up @@ -35,7 +35,7 @@ var missingCmd = &cobra.Command{
// retrieve missing records from pvr and stash in database
existingItemsCount := database.GetItemsCount(lowerPvrName, "missing")
if flagRefreshCache || existingItemsCount < 1 {
log.Infof("Retrieving missing media from %s: %q", capitalise.First(pvrConfig.Type), pvrName)
log.Infof("Retrieving missing media from %s: %q", (pvrConfig.Type), pvrName)

missingRecords, err := pvr.GetWantedMissing()
if err != nil {
Expand Down
23 changes: 12 additions & 11 deletions cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,22 @@ package cmd

import (
"fmt"
"github.com/l3uddz/wantarr/build"
"github.com/l3uddz/wantarr/config"
"github.com/l3uddz/wantarr/database"
"github.com/l3uddz/wantarr/logger"
pvrObj "github.com/l3uddz/wantarr/pvr"
"github.com/l3uddz/wantarr/utils/paths"
stringutils "github.com/l3uddz/wantarr/utils/strings"
"github.com/pkg/errors"
"github.com/sirupsen/logrus"
"github.com/spf13/cobra"
"go.uber.org/atomic"
"os"
"path/filepath"
"strings"
"time"

"github.com/migz93/wantarr/build"
"github.com/migz93/wantarr/config"
"github.com/migz93/wantarr/database"
"github.com/migz93/wantarr/logger"
pvrObj "github.com/migz93/wantarr/pvr"
"github.com/migz93/wantarr/utils/paths"
stringutils "github.com/migz93/wantarr/utils/strings"
"github.com/pkg/errors"
"github.com/sirupsen/logrus"
"github.com/spf13/cobra"
"go.uber.org/atomic"
)

var (
Expand Down
4 changes: 2 additions & 2 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import (
"github.com/json-iterator/go"
"os"

"github.com/l3uddz/wantarr/logger"
stringutils "github.com/l3uddz/wantarr/utils/strings"
"github.com/migz93/wantarr/logger"
stringutils "github.com/migz93/wantarr/utils/strings"

"github.com/pkg/errors"
"github.com/spf13/viper"
Expand Down
4 changes: 2 additions & 2 deletions database/db.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package database
import (
"github.com/jinzhu/gorm"
_ "github.com/jinzhu/gorm/dialects/sqlite"
"github.com/l3uddz/wantarr/logger"
stringutils "github.com/l3uddz/wantarr/utils/strings"
"github.com/migz93/wantarr/logger"
stringutils "github.com/migz93/wantarr/utils/strings"
)

var (
Expand Down
2 changes: 1 addition & 1 deletion database/delete.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package database

import (
"github.com/l3uddz/wantarr/pvr"
"github.com/migz93/wantarr/pvr"
"github.com/pkg/errors"
)

Expand Down
2 changes: 1 addition & 1 deletion database/set.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package database

import (
"github.com/l3uddz/wantarr/pvr"
"github.com/migz93/wantarr/pvr"
"github.com/pkg/errors"
)

Expand Down
28 changes: 12 additions & 16 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,35 +1,31 @@
module github.com/l3uddz/wantarr
module github.com/migz93/wantarr

go 1.13

require (
github.com/fsnotify/fsnotify v1.4.9 // indirect
github.com/imroc/req v0.3.0
github.com/jinzhu/gorm v1.9.15
github.com/google/pprof v0.0.0-20231229205709-960ae82b1e42 // indirect
github.com/imroc/req v0.3.2
github.com/jinzhu/gorm v1.9.16
github.com/jpillora/backoff v1.0.0
github.com/json-iterator/go v1.1.10
github.com/json-iterator/go v1.1.12
github.com/mattn/go-colorable v0.1.7 // indirect
github.com/mattn/go-sqlite3 v2.0.3+incompatible // indirect
github.com/mgutz/ansi v0.0.0-20200706080929-d51e80ef957d // indirect
github.com/mitchellh/mapstructure v1.3.3 // indirect
github.com/natefinch/lumberjack v2.0.0+incompatible
github.com/onsi/ginkgo v1.11.0 // indirect
github.com/onsi/gomega v1.8.1 // indirect
github.com/pelletier/go-toml v1.8.0 // indirect
github.com/onsi/ginkgo/v2 v2.13.2 // indirect
github.com/pkg/errors v0.9.1
github.com/sirupsen/logrus v1.6.0
github.com/sirupsen/logrus v1.9.3
github.com/spf13/afero v1.3.2 // indirect
github.com/spf13/cast v1.3.1 // indirect
github.com/spf13/cobra v1.0.0
github.com/spf13/cobra v1.8.0
github.com/spf13/jwalterweatherman v1.1.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/spf13/viper v1.7.0
github.com/tommysolsen/capitalise v0.0.0-20171110170156-1df6e863d8ab
github.com/x-cray/logrus-prefixed-formatter v0.5.2
go.uber.org/atomic v1.6.0
golang.org/x/crypto v0.0.0-20200728195943-123391ffb6de // indirect
golang.org/x/sys v0.0.0-20200728102440-3e129f6d46b1 // indirect
golang.org/x/text v0.3.3 // indirect
go.uber.org/atomic v1.11.0
golang.org/x/crypto v0.17.0 // indirect
golang.org/x/sys v0.16.0 // indirect
golang.org/x/tools v0.16.1 // indirect
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 // indirect
gopkg.in/ini.v1 v1.57.0 // indirect
gopkg.in/natefinch/lumberjack.v2 v2.0.0 // indirect
Expand Down
Loading

0 comments on commit e2d0522

Please sign in to comment.