Coder Social home page Coder Social logo

aetaric / checkrr Goto Github PK

View Code? Open in Web Editor NEW
195.0 5.0 8.0 1.8 MB

Checkrr Scans your library files for corrupt media and replace the files via sonarr and radarr

License: MIT License

Go 78.38% Dockerfile 0.21% HTML 0.49% JavaScript 20.92%
radarr-api sonarr-api audio audio-processing ffprobe media video video-processing

checkrr's People

Contributors

aetaric avatar dependabot[bot] avatar hugo-vrijswijk avatar shanehughes1990 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

checkrr's Issues

checkrr not doing anything

hey guys i am sure i messed up something, but for the life of me i cant figure it out. checkrr runs, but never updates. I have a docker box that also runs my sonarr and radarr

i created the docker container as follows

docker create --name checkrr --restart unless-stopped -p 8585:8585 -e PUID=1026 -e PGID=100 -e TZ='America/New_York' -v /etc/localtime:/etc/localtime:ro -v /DOCKER/CHECKRR/checkrr.yaml:/etc/checkrr.yaml -v /DOCKER/CHECKRR/checkrr.db:/checkrr.db -v /mnt/MEDIA/TV:/tv -v /mnt/MEDIA/ANIME:/anime -v /mnt/MEDIA/MOVIES/:/movies aetaric/checkrr:latest

i downloaded the example file and just created what i needed REMOVED API keys

checkrr: checkpath: - "/movies" - "/tv" - "/anime" database: ./checkrr.db debug: true csvfile: ./badfiles.csv logfile: ./checkrr.log logjson: false cron: "@daily" ignorehidden: true ignorepaths: ignoreexts: - .txt - .nfo - .nzb - .url arr: radarr: process: true service: radarr # should be one of: sonarr radarr lidarr address: docker01 apikey: "REMOVED" baseurl: / port: 7878 mappings: # maps directories between docker and arr services "/movies": "movies" # what radarr sees: what checkrr sees sonarr: process: true service: sonarr address: docker01 apikey: "REMOVED" baseurl: / port: 8989 mappings: "/tv": "/tv" anime: process: true service: sonarr address: docker01 apikey: "REMOVED" baseurl: / port: 8989 mappings: "/anime": "/anime" notifications: pushover: apitoken: "REMOVED" recipient: "" notificationtypes: - reacquire - unknowndetected - startrun - endrun stats: # These will slow down the runtime substantually, but... DATA webserver: port: 8585 baseurl: "/" trustedproxies: - 127.0.0.1

Checkrr runs i see the gui, but nothing happens

image

ignoreExt directive seems to be ignored (Ubuntu 20.04, checkrr 1.2.0)

The directive to ignore file extensions doesn't seem to work. Listed extensions are still scanned, and show up in the file count and log.

Ignoring hidden files works as expected: a file like .test does not add to the count of files checked and does not appear in the logs at all.

Config file:

checkpath:
- "/home/username/testrr"
lidarraddress: ""
lidarrapikey: ""
lidarrbaseurl: /
lidarrport: 8686
processlidarr: false
processradarr: false
processsonarr: false
radarraddress: ""
radarrapikey: ""
radarrbaseurl: /
radarrport: 7878
removeunknownfiles: false
sonarraddress: 127.0.0.1
sonarrapikey: ""
sonarrbaseurl: /
sonarrport: 8989
database: /var/lib/checkrr/checkrr.db
csvfile: /var/lib/checkrr/badfiles.csv
ignoreHidden: true
ignoreexts:
  - .txt
  - .nfo
  - .DS_Store
  - .csv

Contents of test directory

drwxrwxr-x  2 username username    4096 Oct 28 10:37  ./
drwxr-xr-x 20 username username    4096 Oct 28 09:52  ../
-rw-r--r--  1 username username 8657959 Oct 28 10:03 "test.mp3"
-rw-rw-r--  1 username username       7 Oct 28 10:33  .DS_Store
-rw-rw-r--  1 username username       4 Oct 28 10:37  .test
-rw-rw-r--  1 username username       7 Oct 28 10:00  test.csv
-rw-rw-r--  1 username username       9 Oct 28 09:49  test.txt
-rw-rw-r--  1 username username       5 Oct 28 10:07  .text

Output of checkrr check

PS: There's Discord spam in the log, though I see no Discord directives in --help

            _|                               _|
   _|_|_|   _|_|_|       _|_|       _|_|_|   _|  _|     _|  _|_|   _|  _|_|
 _|         _|    _|   _|_|_|_|   _|         _|_|       _|_|       _|_|
 _|         _|    _|   _|         _|         _|  _|     _|         _|
   _|_|_|   _|    _|     _|_|_|     _|_|_|   _|    _|   _|         _|
Using config file: /etc/checkrr.yaml
WARN[0000] Sonarr integration not enabled. Files will not be fixed. (if you expected a no-op, this is fine)  startup=true
WARN[0000] Radarr integration not enabled. Files will not be fixed. (if you expected a no-op, this is fine)  startup=true
WARN[0000] Lidarr integration not enabled. Files will not be fixed. (if you expected a no-op, this is fine)  startup=true
INFO[0000] /home/username/testrr/test.mp3  FFProbe=true Format="MP2/3 (MPEG audio layer 2/3)" Type=Audio
INFO[0000] File "/home/username/testrr/test.csv" is not a recongized file type  FFProbe=false Type=Unknown
ERRO[0000] Could not notify Discord
INFO[0000] Couldn't find a target for file "/home/username/testrr/test.csv". File is unknown.  Unknown File=true
INFO[0000] File "/home/username/testrr/test.txt" is not a recongized file type  FFProbe=false Type=Unknown
ERRO[0000] Could not notify Discord
INFO[0000] Couldn't find a target for file "/home/username/testrr/test.txt". File is unknown.  Unknown File=true
+----------------------+-------------+
| Files Checked        |           3 |
| Hash Matches         |           0 |
| Hashes Mismatched    |           0 |
| Submitted to Sonarr  |           0 |
| Submitted to Radarr  |           0 |
| Submitted to Lidarr  |           0 |
| Video Files          |           0 |
| Audio Files          |           1 |
| Text or Other Files  |           0 |
| Unknown Files        |           2 |
| Unknown File Deletes |           0 |
| Elapsed Time         | 48.802153ms |
+----------------------+-------------+

Contents of badfiles.csv

/home/username/testrr/test.csv,unknown
/home/username/testrr/test.txt,unknown

remove: removeunknownfiles

This flag is a bit too dangerous at this point. It was one thing when the code complexity was minimal in 1.x but as of 3.x the code complexity is only increasing.

ts, m2ts video files reported as "unknown"

ts and m2ts are less common containers, but are still legit video files. checkrr skips them as "unknown," though.

I know you are using middleware like ffprobe so this may just be how it is.

Can't start container since 3.1.0

Unraid 6.11.5

2023-01-22T15:36:29.912062710Z �[32m�[0m
2023-01-22T15:36:29.912101863Z �[32m            _|                               _|�[0m
2023-01-22T15:36:29.912112023Z �[32m   _|_|_|   _|_|_|       _|_|       _|_|_|   _|  _|     _|  _|_|   _|  _|_|�[0m
2023-01-22T15:36:29.912118425Z �[32m _|         _|    _|   _|_|_|_|   _|         _|_|       _|_|       _|_|�[0m
2023-01-22T15:36:29.912123574Z �[32m _|         _|    _|   _|         _|         _|  _|     _|         _|�[0m
2023-01-22T15:36:29.912128423Z �[32m   _|_|_|   _|    _|     _|_|_|     _|_|_|   _|    _|   _|         _|�[0m
2023-01-22T15:36:29.912133272Z Checkrr version 3.1.0
2023-01-22T15:36:29.912137941Z  Commit: 07fce6dc21047d27d3556ecce687df174b968c7a
2023-01-22T15:36:29.912142780Z  Built On: 2023-01-22T03:46:21Z
2023-01-22T15:36:29.912147459Z  Built By: goreleaser
2023-01-22T15:36:29.912393992Z time="2023-01-22T15:36:29Z" level=info msg="Using config file: /etc/checkrr.yaml"
2023-01-22T15:36:29.920840185Z panic: runtime error: invalid memory address or nil pointer dereference
2023-01-22T15:36:29.920849633Z [signal SIGSEGV: segmentation violation code=0x1 addr=0x160 pc=0x840f38]
2023-01-22T15:36:29.920853190Z 
2023-01-22T15:36:29.920856396Z goroutine 1 [running]:
2023-01-22T15:36:29.920859532Z github.com/spf13/viper.(*Viper).AllKeys(0x0)
2023-01-22T15:36:29.920862748Z 	/Users/aetaric/go/pkg/mod/github.com/spf13/[email protected]/viper.go:1969 +0x98
2023-01-22T15:36:29.920876233Z github.com/aetaric/checkrr/check.(*Checkrr).connectServices(0xc000164000)
2023-01-22T15:36:29.920903524Z 	/Users/aetaric/src/checkrr/check/checkrr.go:182 +0x91
2023-01-22T15:36:29.920911980Z github.com/aetaric/checkrr/check.(*Checkrr).Run(0xc000164000)
2023-01-22T15:36:29.920920466Z 	/Users/aetaric/src/checkrr/check/checkrr.go:61 +0x1f2
2023-01-22T15:36:29.920929042Z main.main()
2023-01-22T15:36:29.920936667Z 	/Users/aetaric/src/checkrr/main.go:155 +0xc32

Discord Notification Categories

Limit discord notification spam.

Probably use a string slice in the config.

Likely options:
reacquire
unknowndetected
unknowndeleted

checkrr.db is a directory

When using Docker Compose do I need to create a blank checkrr.db file? When running the container I get this in the logs repeatedly with no other progress:

Using config file: /etc/checkrr.yaml
2022/10/18 17:13:24 open checkrr.db: is a directory

[BUG] 3.1.3 release does not include frontend changes

Describe the bug
I think something went wrong with the last 3.1.3 release, because the frontend seems to be an older version. Maybe something went wrong with publishing and it took an older built version that was still on disk?

To Reproduce
Steps to reproduce the behavior:

  1. Open latest checkrr release and open the frontend (and console.log errors)
  2. Build latest release locally and observe the differences

Expected behavior

Latest release should include latest frontend changes too

Screenshots

3.1.3 Release: image
Built locally: image

Desktop (please complete the following information):

  • OS: Linux and macOS
  • Browser: Chrome and firefox latest
  • checkrr Version: 3.1.3

[Feature Request] Support Multiple Sonarr/Radarr/Lidarr instances

Many people, myself included, have multiple instances of sonarr/radarr set up for various purposes, like separate 4k and anime libraries. While the tool seems great, the inability to 'link' a folder path to an '-arr' instance makes it a bit more cumbersome to use. Yes, I could run 3 instances of the tool (one for normal libraries, one for 4k libraries, and one for anime libraries), but it'd be far more convenient if we could initialize multiple connections, and assign file paths to specific -arr instances.

The config could look something along the lines of:

checkrr:
  checkpath: 
     sonarr:
      - "./media/my_shows" 
      - "./media/requested_shows"
     sonarr-4k:
      - "./media/4kshows" 
     sonarr-anime:
      - "./media/anime"
    - "./media/not_connected_to_arr_app"

sonarr:
  process: false
  address: 127.0.0.1
  apikey: ""
  baseurl: /
  port: 8989
sonarr-4k:
  process: false
  address: 127.0.0.1
  apikey: ""
  baseurl: /
  port: 8990
sonarr-anime:
  process: false
  address: 127.0.0.1
  apikey: ""
  baseurl: /
  port: 8991


Gotify missing from notifications.go

Using the Docker Image I'm able to check files but I'm not getting any notifications on gotify and the log file just stays empty

docker log:
image

docker-compose:

version: '3'

networks:
  internal_communication:
    external: true

services:
  checkrr:
    container_name: checkrr
    image: aetaric/checkrr:latest
    restart: unless-stopped
    networks:
      - internal_communication
    ports:
      - 8585:8585
    volumes:
      - /PATH/checkrr/checkrr.yaml:/etc/checkrr.yaml
      - /PATH/checkrr/checkrr.db:/checkrr.db
      - /PATH/checkrr/checkrr.log:/checkrr.log
      - /PATH/data/media:/data

checkerr.yaml

checkrr:
  checkpath:
    - "/data/anime/"
    - "/data/movies/"
    - "/data/music/"
    - "/data/tv/"
    - "/data/xxx/"
  database: ./checkrr.db
  debug: true
  csvfile: "./badfiles.csv"
  logfile: "./checkrr.log"
  logjson: false
  cron: "@daily"
  ignorehidden: true
arr:
  radarr:
    process: true
    service: radarr # should be one of: sonarr radarr lidarr
    address: radarr
    apikey: "APIKEY"
    baseurl: /
    port: 7878
    mappings: # maps directories between docker and arr services
      "/data/media/movies/": "/data/movies/" # what radarr sees: what checkrr sees
  sonarr:
    process: true
    service: sonarr
    address: sonarr
    apikey: "APIKEY"
    baseurl: /
    port: 8989
    mappings:
      "/data/media/tv/": "/data/tv/"
  sonarr_anime:
    process: true
    service: sonarr
    address: sonarr_anime
    apikey: "APIKEY"
    baseurl: /
    port: 8990
    mappings:
      "/data/media/anime/": "/data/anime/"
notifications:
  gotify:
    url: "http://IP:PORT/"
    authtoken: "TOKEN"
    notificationtypes:
      - reacquire
      - unknowndetected
      - startrun
      - endrun
webserver:
  port: 8585
  baseurl: "/"
  trustedproxies:
    - 127.0.0.1

Adjust file checking logic

Sorry if this is already possible, but I didn't see a way to do this.

Checkrr is trying to reacquire many releases for me because of non-video files that it is marking as bad.

I have tried excluding them by file extension, but some of them don't have extensions.

Is there an option in the config file to only check video files, and ignore everything else? If not, could it be added?

Thanks!

issues with influxdb2

Running checkrr 3.0 in docker. The scheduled time to run comes and goes and nothing happens. Well, almost - looking at the docker logs in portainer, checkrr is idle and servicing web GET requests as normal. But just when it's scheduled to kick off again, the following occurs:

[GIN] 2023/01/14 - 03:59:56 | 200 |     122.738µs |    192.168.1.35 | GET      "/api/stats/historical"
[GIN] 2023/01/14 - 03:59:57 | 200 |    1.108937ms |    192.168.1.35 | GET      "/api/files/bad"
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x60 pc=0x7a7c7b]
goroutine 734 [running]:
github.com/aetaric/checkrr/features.(*Stats).FromConfig(_, {{0x9ebf70, 0x1}, {0x0, 0x0, 0x0}, {0x1019360, 0x13bed20}, {0x0, 0x0, ...}, ...})
	/Users/aetaric/src/checkrr/features/stats.go:63 +0x4bb
github.com/aetaric/checkrr/check.(*Checkrr).Run(0xc000822300)
	/Users/aetaric/src/checkrr/check/checkrr.go:54 +0x20c
github.com/robfig/cron/v3.(*Cron).startJob.func1()
	/Users/aetaric/go/pkg/mod/github.com/robfig/cron/[email protected]/cron.go:312 +0x6a
created by github.com/robfig/cron/v3.(*Cron).startJob
	/Users/aetaric/go/pkg/mod/github.com/robfig/cron/[email protected]/cron.go:310 +0xad

checkrr/features/stats.go:63 is:

org, _ := s.influxdb1.OrganizationsAPI().FindOrganizationByName(context.Background(), influx.GetString("org"))

Which might be a bit strange since this line is within the "if config.Sub("influxdb2") != nil" block - influxdb2, not influxdb1.

My checkrr.yaml has the following:

stats: # These will slow down the runtime substantually, but... DATA
influxdb2:
url: "http://192.168.1.111:8086/"
token: "<removed but normally a valid token generated in influxdb2"
org: "sanityfromtheinside"
bucket: "checkrr"

This error occurs even if org: is left as the default in the example (org: "default").
The token, org and bucket values are valid and correct.

After the stack trace is displayed, checkrr continues (or may be restarting automatically) but doesn't ever start a scan.
Running InfluxDB v2.6.1 on ubuntu 20.04 with checkrr 3.0.0.

More Issues with Influxdb2

I am running Checkrr 3.1.1. When clicking the run now button in the UI, I receive the following error in the container log:

[GIN] 2023/01/23 - 21:26:40 | 200 |      21.581µs |   192.168.240.1 | POST     "/api/run"
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x10 pc=0x91b8ae]

goroutine 57 [running]:
github.com/influxdata/influxdb-client-go/v2/api.(*bucketsAPI).CreateBucketWithName(0xc000802180?, {0x14f8990?, 0xc00003a040?}, 0xc0002666a0?, {0xc0002666b0?, 0x3?}, {0x0?, 0x40e1eb?, 0x110?})
        /Users/aetaric/go/pkg/mod/github.com/influxdata/influxdb-client-go/[email protected]/api/buckets.go:154 +0x2e
github.com/aetaric/checkrr/features.(*Stats).FromConfig(_, {{0xdf5e90, 0x1}, {0x0, 0x0, 0x0}, {0x14fc920, 0x1abb318}, {0x0, 0x0, ...}, ...})
        /Users/aetaric/src/checkrr/features/stats.go:63 +0x5a8
github.com/aetaric/checkrr/check.(*Checkrr).Run(0xc000142600)
        /Users/aetaric/src/checkrr/check/checkrr.go:57 +0x1e5
created by github.com/aetaric/checkrr/webserver.runCheckrr
        /Users/aetaric/src/checkrr/webserver/webserver.go:194 +0x6a

This looks very similar to #39

My Settings are as follows

stats: # These will slow down the runtime substantually, but... DATA
  influxdb2:
    url: "http://influxdb:8086/"
    token: "VALID API TOKEN"
    org: "MyOrg"
    bucket: "checkrr"
webserver:
  port: 8585
  baseurl: "/"
  trustedproxies:
    - 127.0.0.1
    - 192.168.246.126

Running Influxdb 2.6.1 & Checkrr 3.1.1
Using Docker Hub Container - Latest

Please let me know if I could provide you with any additional information!

[Feature] Add ignorepath support

Radarr/Sonarr/Lidarr allow deleted files to be moved to a user specified filepath before copying any files from a newer download. If that filepath happens to be in the existing "checkpath" configuration, checkrr will scan them unnecessarily. Adding a configuration option to ignore certain filepaths would eliminate the unnecessary file checks.

[Feature] trigger next scan manually in WebUI

On a new install with the default cron: "@daily" setting, the user needs to wait up to 24h for the first scan to run. It would be useful for the user to be able to trigger the next scan manually.

Suggestion: support skipping scanning of certain file extensions

This is a great utility, thank you for releasing it.

In my tests I noticed that the scanner will add .ini files to the list of bad files. It might be nice if there was a way to skip scanning of specific file types. In a mixed OS environment there are various legit non-media files that may end up scattered around the media directories, and they clutter the list of bad files.

[Feature] Ignore folders with specified name

Is your feature request related to a problem? Please describe.
I don't know if I am missing something during the config of this app but I have looked at instructions on here. I am using a Synology DSM NAS and have this running through docker. All Synology folders have a '@eadir' folder where "ea" stands for "extended attributes". Those @eaDir-directories would contain files corresponding to those you'll see in the "normal" directory tree and contain the file 'SYNOINDEX_MEDIA_INFO'. I have tried using the ignorepaths list but the folder (and files in it) are still shown in the bad files list resulting in a very long list (considering media is in seperate folders by name).

Describe the solution you'd like
If possible, an option like 'ignorefolders' list that will have Checkrr skip the folder if the name matches one on the list i.e '@eadir' folders (regardless of location) will be skipped.

An option to skip by filename would also be a great feature i.e SYNOINDEX_MEDIA_INFO

Scheduler

Add functionality for checkrr to always be running, but not executing its checks until a specified cron time has been met from the config.

[Feature] Log file output/rotation

The config example has a logfile directive, but it doesn't seem to be wired up. It'd be useful to support logging to files (perhaps one for the web server and one for scan actions) with rotation support instead of just to stdout.

--checkPath command line option is not respected

Running the following

./checkrr check --database checkrr.db --checkPath /media/Crap/

Causes no output, but putting

checkPath: /media/Crap/

In config, it does successfully check. Would be nice if the command line options worked for testing. Although long term I probably will switch to having everything in config anyway.

[Feature] show next scan time / schedule info

With a new install using the default cron: "@daily" setting, it's not clear when the first scan will actually occur. It would be useful to show the user in the WebUI what the schedule is set to and when the next scan will run.

[Feature] Add date column to the bad files table

Is your feature request related to a problem? Please describe.
No problem

Describe the solution you'd like
Column in the bad files table for the date it was added to the list so we can see new files being added and ignore corrected ones.

Describe alternatives you've considered
No alternative

Additional context
None

WebGUI doesn't scale to larger (width) screens

Hi,

Just installed and running this and notice that the default WebGUI doesn't scale to utilise a larger screens full width.
i.e. on my 2560 x 1440 screen it looks like its only running 1024x768 resolution.
Due to this all the bad file ' path' names are shorted and unable to see the full name of the file (end up just seeing the upper directory name).

"fatal error: runtime: out of memory" when scanning a directory with many files (1.1.0 on Ubuntu 20.04)

After writing this I tried 1.1.1 and the issue is fixed! So, this can probably be resolved.


On doing checkrr check checkrr immediatly exits with "fatal error: runtime: out of memory". I was able to determine that this happens when checkrr tries to scan a folder where I have tons of video files.

The folder in question contains 547 video files, plus 8 folders each of which has a few video files.

checkrr did great scanning a directory that had over 1000 folders, each of them having a handful of subfolders and files.

I doubt it matters but the files were all mounted via smb sharing.

I THINK I am using v 1.1.0 because the release notes mention CSV output, which I have... And I started playing with it before the 1.1.1 release was available But, I don't see a --version command in checkrr so I can't be sure. I'll file that as an enhancement idea.

My config file is below and the complete error output is attached. Let me know if I can provide anything else.

checkpath:
- "/mnt/media/movies/"
lidarraddress: ""
lidarrapikey: ""
lidarrbaseurl: /
lidarrport: 8686
processlidarr: false
processradarr: false
processsonarr: false
radarraddress: ""
radarrapikey: ""
radarrbaseurl: /
radarrport: 7878
removeunknownfiles: false
sonarraddress: 127.0.0.1
sonarrapikey: ""
sonarrbaseurl: /
sonarrport: 8989
database: /var/lib/checkrr/checkrr.db
csvfile: /var/lib/checkrr/badfiles.csv

checkrr_kaboom.txt

Telegram Bot not working

Expected behavior

get a notification via telegram to the user set on username, when I start a run.

Actual behavior

I'm not getting any notifications. ever.

Information about the Issue

my docker-compose.yaml

  checkrr:
    container_name: checkrr
    image: aetaric/checkrr:latest
    volumes:
      - ${USERDIR}/docker/checkrr/config/checkrr.yaml:/etc/checkrr.yaml
      - ${USERDIR}/docker/checkrr/config/checkrr.db:/checkrr.db
      - /media/wdblue/movies:/media/movies
      - /media/wdblue/tvmedia/tv
    ports:
      - 8585:8585
    environment:
      - PUID= ${PUID}
      - PGID= ${PGID}
      - TZ=${TZ}

this is my checkrr.yaml:

notifications:
  telegram:
    token: "bot_token"
    username: "@my_username"
    notificationtypes:
      - reacquire
      - unknowndetected
      - startrun
      - endrun

I dont see anything in checkrr.log names telegram

the token is working on sonarr and radarr, also testing with curl

Steps to reproduce the behavior

[BUG] address for *arr service doesn't work

Describe the bug
In a docker network you can reference a service, such as sonarr with just http://sonarr:7878, but checkrr doesn't seem to work with this.

To Reproduce
Steps to reproduce the behavior:

  1. Have checkrr, sonarr and radarr in a docker network
  2. Set address to sonarr

Expected behavior
It should connect to sonarr/radarr

Logs

time="2023-04-26T10:24:57+01:00" level=info msg="api.Get(v3/system/status): httpClient.Do(req): Get \"http://<nil>:7878/api/v3/system/status\": dial tcp: lookup <nil>: no such host" Radarr "radarr" Connected=false Startup=true
time="2023-04-26T10:24:57+01:00" level=info msg="api.Get(v3/system/status): httpClient.Do(req): Get \"http://<nil>:8989/api/v3/system/status\": dial tcp: lookup <nil>: no such host" Sonarr "sonarr" Connected=false Startup=true

Desktop (please complete the following information):

  • OS: unRAID 6.11.5 (aetaric app)
  • Browser: Firefox 111.0
  • checkrr Version: 3.1.2

sonarr/radarr not being triggered - case sensitivity?

I can't seem to get radarr or sonarr to do anything after a checkrr run.
webui_output

I set up a test environment where there's one corrupt movie file and one corrupt tv file.
Paths are

- /media/videos/Movies_test/The Conversation (1974)/The Conversation (1974) Bluray-1080p.mkv
- /media/videos/TV_test/Border Security - Australia's Front Line/Season 02/Border Security - Australia'\''s Front Line (2004) - S02E01 - Spanish Surfer Above the Law USA No Way [SDTV].avi

Sonarr runs in docker:

  • sonarr's media management root folder is /data/tv

Radarr runs directly:

  • radarr's media management root folder is /media/videos/Movies

checkrr.yaml (pruned to pertinent info here):

checkrr:
  checkpath:
    - "/media/videos/Movies_test/"
    - "/media/videos/TV_test/"
arr:
  radarr:
    process: true
    service: radarr
    address: 192.168.1.20
    apikey: "123123123123123123123"
    baseurl: /
    port: 7878
    mappings:
      "/media/videos/Movies/": "/media/videos/Movies_test/"
  sonarr:
    process: true
    service: sonarr
    address: 192.168.1.20
    apikey: "123123123123123123123"
    baseurl: /
    port: 8989
    mappings:
      "/data/tv/": "/media/videos/TV_test/"

command run:
./checkrr -c ./checkrr.yaml --run-once --debug

checkrr.log

I think there's a case sensitivity issue as shown in the log files but not sure. Checkrr seems to be "lower casing" paths.

[BUG] Ingored file extensions are case sensitive

Describe the bug
ignoreexts are case sensitive. It would make sense to make them case insensitive.

To Reproduce
Steps to reproduce the behavior:

  1. Add .cue file into library
  2. Add .CUE file into library
  3. Add ".cue" to the ignoreexts list.
  4. Run Checkrr and observe that the file with .CUE extension is not getting ingored.

Expected behavior
Both .cue and .CUE file should be ignored.

Desktop (please complete the following information):

  • checkrr Version: Docker container with latest tag

Docker Compose

My media library has a similar journey as yours and I would like to add checkrr to my Docker Compose file that runs all my services. Is it possible to get a Docker Compose example for checkrr to make this easier to add in for people?

FR: option to disable notifications

When not wanting to use discord, it errors on a blank config, which I thought would be enough to disable.
`INFO[0000] Using config file: ./checkrr.yaml
INFO[0000] Sonarr integration not enabled. Files will not be fixed. (if you expected a no-op, this is fine) Sonarr Connected=false Startup=true
INFO[0000] Radarr integration not enabled. Files will not be fixed. (if you expected a no-op, this is fine) Radarr Connected=false Startup=true
INFO[0000] Lidarr integration not enabled. Files will not be fixed. (if you expected a no-op, this is fine) Lidarr Connected=false Startup=true
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x758fe9]

goroutine 1 [running]:
github.com/aetaric/checkrr/check.(*Checkrr).connectNotifications(0xc000004280?)
/opt/radarrplugins/checkrr/check/checkrr.go:205 +0x89
github.com/aetaric/checkrr/check.(*Checkrr).Run(0xc000004280)
/opt/radarrplugins/checkrr/check/checkrr.go:60 +0x277
main.main()
/opt/radarrplugins/checkrr/main.go:86 +0x574
`

[Feature Request] Support postgres

Hi i like to request postgres support, having the database as a separate instance and being postgres is much more manageable and faster than a sqlite db.

Multiple media paths to scan

Is there a way to configure multiple media paths to scan so that checkrr will run them sequentially? Can I just add them all to the Docker Compose file?

I have my media stored like this:

/media/Movies
/media/TV_Shows

but I have some other folders in there that shouldn't be scanned like:

/media/Downloads

Request: docker image for 3.1.1

It doesn't appear that the docker image aetaric/checkrr:latest has been updated to 3.1.1 yet. aetaric/checkrr:3.1.0 doesn't work so I'm assuming aetaric/checkrr:3.1.1 doesn't either.

[BUG] Issue with subdirectory in baseurl

Describe the bug
webserver from yaml file, this is json with yamlencoding (terraform)

"webserver" : {
  "port" : 8585,
  "baseurl" : "/checkrr"
},

My Ingress for this service checkrr.example.com/checkrr is essentially what it resolves too.

domain_match_pattern = "Host(`checkrr.${var.cloudflare_config.zone_name}`) && PathPrefix(`/checkrr`)"

The static site itself doesn't even load just 404, but the api responses don't have the directory delimiter "checkrr/api" between the baseurl and api routes, if you change baseurl to /checkrr/ the api works static site does not.

The issue atleast for the api is on line 84 webserver.go router.Group(w.BaseURL + "api") = /checkrrapi NOT /checkrr/api

To Reproduce
Steps to reproduce the behavior:

  1. Change baseurl to /checkrr
  2. go to http://localhost:8585/checkrrapi/files/bad
  3. You will see the api response

Expected behavior
I want subdirectories for my services so I would want the UI & api both to work when changing the baseurl from the default /

Screenshots
image

Desktop (please complete the following information):

  • OS: windows
  • Browser: chrome
Checkrr version 3.1.4
 Commit: 1daa66a29265db10eb86081e5423af7cf16515a3
 Built On: 2023-07-27T00:47:01Z
 Built By: goreleaser

Additional context
Havent worked with static.Serve from gincontrib at all, but I build golang api's regularly for work (done gin countless times). I would be willing to do a PR for this issue (I'm sure Ill figure out the static site given enough time)

DNS in docker image not working with checkrr

{"Radarr \"radarr\" Connected":false,"Startup":true,"level":"info","msg":"api.Get(v3/system/status): httpClient.Do(req): Get \"http://\u003cnil\u003e:7878/api/v3/system/status\": dial tcp: lookup \u003cnil\u003e: no such host","time":"2023-01-24T21:08:09Z"}

No matter if i try
address: radarr
address: "radarr"
address: http://radarr
address: "http://radarr"

Checkrr throws the no such host error. If i use the internal docker ip it works fine.
exec into the container i can ping the container radarr fine. If i recall correctly, there is some go bind module (might be the wrong terminology) that needs to be included, so the app can use the dns properly. Our mate David Newhall might remember what it was, i believe we had the issue with Notifiarr as well at one point.

Edit: Output with the internal container ip of radarr
{"Radarr \"radarr\" Connected":true,"Startup":true,"level":"info","msg":"Radarr Connected.","time":"2023-01-24T21:15:31Z"}
In config:
address: "10.1.0.20"

Checkrr 3.0.0 doesn't start properly

Here is my docker-compose.yml

---
version: "3.8"

# https://github.com/aetaric/checkrr

services:
  checkrr:
    image: aetaric/checkrr:latest
    container_name: checkrr
    environment:
      PUID: ${PUID}
      PGID: ${PGID}
    volumes:
      - './config:/config'
      - '/data/plex:/media'
    ports:
      - '8585:8585'
    restart: unless-stopped

networks:
  default:
    external:
      name: web

This is the output from docker logs:

Checkrr version 3.0.0
 Commit: 3e489f8bf1aff30fa24feb6597e3cca098c30143
 Built On: 2023-01-09T01:10:05Z
 Built By: goreleaser
time="2023-01-13T15:12:20Z" level=info msg="err: While parsing config: yaml: control characters are not allowed"
time="2023-01-13T15:12:20Z" level=fatal msg="Database file path missing or unset, please check your config file." startup=true

When looking in the config directory it appears that checkrr.db and checkrr.yaml are both created as directories.

drwxr-xr-x 2 root     root     4.0K Jan 12 15:05 checkrr.db
drwxr-xr-x 2 root     root     4.0K Jan 12 15:05 checkrr.yaml

Docker version info is here:

docker --version
Docker version 20.10.21, build baeda1f

I've run yamllint against this configuration and it returns all clear. I'm guessing I missed something in the setup process but I'm not sure what it is. Any help would be appreciated

Remove deleted files from Bad files list

During first run checkrr detected 400+ unknown flies, and added to bad files list in UI.
After reviewing I decided to delete them manually.
I was expecting these file will be removed from the UI after the next checkrr run.
Currently need to manually select all rows for deletion.

bug/feature: mappings for *arr paths in docker context

A user running the checkrr docker container will never match paths with the arr services because checkrr likely has a different path mapping for the files than the arr services do.

This 100% effects windows users running checkrr in docker and is a mixed impact for *nix users running in docker as they can workaround this by matching the paths inside the container with the host system.

checkrr should have a mapping option to allow users to provide it with path replacements when contacting arr services.

ignoreext fails to properly ignore the file extention

Using the example config file makes checkrr report every .bif file as a bad file (whcich could be an improvement to add .bif to ignoreexts in the yaml, as I think the greater part of users have .bif files autogenerated for video files in plex, emby etc).
But the issue here is, that if I add .bif to the ignoreexts section in the config, they are still found by checkrr and treated as a bad file(ignore faulty indent. the yaml is valid).

my config:
ignoreexts:
- .txt
- .nfo
- .nzb
- .url
- .bif
radarr: ....

I've deleted the database and re created the docker between tests.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.