aetaric / checkrr

Checkrr Scans your library files for corrupt media and replace the files via sonarr and radarr
MIT License
206 stars 10 forks source link

sonarr/radarr not being triggered - case sensitivity? #49

Closed douginoz closed 1 year ago

douginoz commented 1 year ago

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:

Radarr runs directly:

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.

aetaric commented 1 year ago

Hey, so looking at this. It looks like you've set the key in the config for Radarr to lowercase:

DEBU[0000] Radarr Path Maps: %vmap[/media/videos/movies/:/media/videos/Movies_test/] DEBU[0000] Key: /media/videos/movies/

and based on your screenshot, sonarr works, otherwise the "service" field wouldn't say "sonarr". That comes from finding the file in sonarr as you can see in the code here

douginoz commented 1 year ago

Not sure I understand what you mean. I included my checkrr.yaml in my post above and all my paths are in mixed case. Yet the log files shows them in lowercase. I haven't entered anything in my config as lowercase like shown in the log file.

Specifically, I entered it as

mappings: "/media/videos/Movies/": "/media/videos/Movies_test/"

the log (and your comment) shows "\media\video\movies".

aetaric commented 1 year ago

Right, but the sonarr, radarr, and lidarr code all use the same method of pulling in that part of the config. There's not even a call to strings.ToLower() in the entire code base.

douginoz commented 1 year ago

I don't know what to do about it. My paths are mixed cases and I've entered them exactly correctly in all configs. Yet the log displays them in lowercase. There's nothing in my radarr, sonarr, docker, or checkrr.yaml that has any paths in all lowercase.

douginoz commented 1 year ago

So either the code is inadvertently converting strings to lowercase or the logging function is. Somewhere along the way the path strings are being converted to lowercase! L

It should be easy to duplicate. Just create a file path in mixed case, add it to your checkrr.yaml, run it with debug and check the resulting log file.

aetaric commented 1 year ago
DEBU[0048] Sonarr Path Maps: %vmap[/tv:test/Tv]         
INFO[0048] Sonarr Connected.                             Sonarr "sonarr" Connected=true Startup=true
DEBU[0048] Radarr Path Maps: %vmap[/movies:test/Movies] 
INFO[0048] Radarr Connected.                             Radarr "radarr" Connected=true Startup=true
checkrr:
  checkpath: 
    - test/Tv
    - test/Movies
    - test/music
  database: checkrr.db
  ignorehidden: true
  ignoreexts:
    - 'nfo'
    - '.(null)'
    - 'DS_Store'
    - '_DS_Store'
    - '.srt'
    - '.sfv'
    - '.ass'
  csvfile: "./badfiles.csv"
  cron: "* * * * *"
arr:
  sonarr:
    process: true
    address: 127.0.0.1
    service: sonarr
    apikey: "fd6e899449ca44fbaa95611a68d0ce94"
    baseurl: /
    port: 8989
    mappings:
      "/tv": "test/Tv"
  radarr:
    process: true
    address: 127.0.0.1
    service: radarr
    apikey: "9ff24194abcb45e4ad97f0ce0f70dda2"
    baseurl: /
    port: 7878
    mappings:
      "/movies": "test/Movies"
webserver:
  port: 8585
  baseurl: "/"

image

I'm not seeing the behavior you are seeing.

douginoz commented 1 year ago

I'll play around with it later. One thing I see is that you're using docker. I assume so anyway since your path is data/tv rather than /data/tv. (Sorry I don't have your exact path in front of me but it's missing the leading slash so that tells me it's likely in a docker container).

I'll create the exact same paths at my end that you used and try them inside and out of docker. Somethings changing the case. It's a process of elimination to find what is doing it.