ThePornDatabase / namer

Renames adult video files so that the plex/jellyfin plugins and stash script will match without user input. Runs server or command mode.
https://theporndb.net
182 stars 29 forks source link

copies files from watch_dir to work_dir then does nothing (running on docker) #196

Closed DSew20 closed 1 year ago

DSew20 commented 1 year ago

Hello,

I've set up namer on docker, using the docker_compose. I'm passing the 4 folders as per the compose file below. Namer moved the files from 'watch' to 'work', but then seems to have stopped. I've added the porndb_token, added uid / gid as per the compose file.

I have also enabled the web-server (web = True), but not sure how to access this to view if working.

Any ideas how to move forward with this?

DOCKER COMPOSE:

version: "3"
services:
  namer:
    container_name: namer
    image: ghcr.io/theporndatabase/namer:latest
    environment:
      - PUID=1001
      - PGID=1000
      - TZ=Europe/London
      - NAMER_CONFIG=/config/namer.cfg
    volumes:
      #- /apps/namer/:/config <- this will store the namer.cfg file copied by you from the git repo ( namer/namer.cfg.default )
      - /srv/dev-disk-by-uuid-xxxxxxxxxxxx/Config/namer:/config

      - /media:/data #<- this will have the four folders namer needs to work, referenced in the namer.cfg file you create.

      - /srv/dev-disk-by-uuid-xxxxxxxxxxxx/downloads:/data/watch_dir
      - /srv/dev-disk-by-uuid-xxxxxxxxxxxx/_work:/data/work_dir
      - /srv/dev-disk-by-uuid-xxxxxxxxxxxx/_failed:/data/failed_dir
      - /srv/dev-disk-by-uuid-xxxxxxxxxxxx/z_:/data/dest_dir

    restart: always

The config is thus:

new_relative_path_name={full_site}/{full_site} - {date} - {name} [WEBDL-{resolution}].{ext}

# directory where new downloads go.
watch_dir = data/watch_dir

# temporary directory where work is done.
# a log file shows attempted matches and match closeness.
work_dir = data/work_dir

# Should processing fail the file or directory is moved here.
# retries occur every 12 hours.   Files can be manually moved to watch-dir
# to force reprocessing.
failed_dir = data/failed_dir

# dir where finalized files get written.
dest_dir = data/dest_dir
DSew20 commented 1 year ago

To update. It appears if I add new files to "watch_dir" they get picked-up, moved and processed.

So, the large number of files previously moved seem to have been orphaned - so moved but not processed.

How can I het namer to process the files it previously moved? Or, will this happen after a while by itself?

Thanks

RealPeteSys commented 1 year ago

Review your config file. Two major factors that dictate which files get processed:

min_file_size = 100 target_extensions = mp4,mkv,avi,mov,flv

Do the files have a file extension listed in the config? Do the files equal or exceed the file size defined in the config?

DSew20 commented 1 year ago

Thank you.

The files are all of these types (mostly mp4), and are all > 300md. Settings below.

So this is odd.

My bigger concern is the new files I have added are getting corrupted. They no longer play after processing. I wonder if the metadata / images being added are corrupting the files? I have tried one with the metadata / images turned off and was ok. Will try some others. This is a bigger issue if others get corrupted.

min_file_size = 300
target_extensions = mp4,mkv,avi,mov,flv
RealPeteSys commented 1 year ago

Does the issue only occur with a specific number of files? Is the issue repeatable?

Which version of namer do you have installed? I noticed that 1.13.3 released recently. If you're on this version, you might want to try and downgrade to 1.13.2 to test.

DSew20 commented 1 year ago

Hello. I have downgraded to 1.13.2 and run some tests.

The issue with the files getting corrupted is still there. These are my tests:

I copy the original file to the dest_dir , the file plays fine.

Copy the same file to watch_dir with enabled_poster: True and enabled_tagging: True. The file is processed and moves to dest_dir but the file doesn't play.

Copy the same file to watch_dir with enabled_poster: False and enabled_tagging: False. The file is processed and moves to dest_dir but the file doesn't play.

The only error I get is:

❌ ERROR | error generating phash: generating sprite screenshot: error running ffmpeg command <-v error -y -ss 128.512 -i /data/work_dir/XXXXXXXXXXXX -frames:v 1 -vf scale=160:-2 -c:v bmp -f rawvideo ->: exit status 69

I assume this is the issue? How to test this?

Also - any suggestions on how to access the web-server from outside a Docker container? This would help with testing.

RealPeteSys commented 1 year ago

What worked for me is as follows. I'm sure others have different/better ways of navigating to the web server.

Check to see if the port you specified in your docker-compose.yml file match that of your namer.cfg port entry.

Default namer.cfg settings:

# port to run on port = 6980

# target host host = 0.0.0.0

Snippet of the resulting .yml file:

.
.
.
    volumes:
      - ./config:/config
      - ./media:/data
    ports:
      - "6980:6980"
    restart: always

I changed host IP to localhost in the config.

DSew20 commented 1 year ago

Thank you. It was just the Ports: 6980:6980 needed adding to the compose. It wasn't in the template and I'm new to docker so didn't pick this up.

So, I am on v 1.13.2 and can see the web-server / gui. Thank you.

I now need to sort out the two problems:

1 - processed files do not play (see issue #197 ) 2 - how to pick up and process the orphaned files in work_dir (but only want to do this when the above issue is fixed)

4c0d3r commented 1 year ago

If you killed the app part way through processing this can happen. Simply moving all the files back is sufficient, please seek support in the discord channel