Archangel

Members
  • Posts

    10
  • Joined

  • Last visited

Posts posted by Archangel

  1. 1 minute ago, mgutt said:

    Did you really copy the whole script? The "fi" is important as it is the end of the new "if else"-part:

     

    image.thumb.png.41667e6a9308b5afdab4f65c919a9cc6.png

    As I mentioned before my edit, I don't need the script to check if I have video files in my videos folder, I know they're there so I removed that part of the script, so the fi is not necessary for the edited version I'm running.  Appreciate the reply.

    • Thanks 1
  2. 23 hours ago, interwebtech said:


    Error moved but still persists

     

    Script location: /tmp/user.scripts/tmpScripts/Plex_Preloader/script
    Note that closing this window will abort the execution of this script
    2022-10-07 10:16:22 Available RAM: 30G
    2022-10-07 10:16:22 Amount of videos that can be preloaded: 482 (each video occupies 61M)
    2022-10-07 10:16:22 /tmp/user.scripts/tmpScripts/Plex_Preloader/script: line 106: syntax error near unexpected token `head'
    2022-10-07 10:16:22 /tmp/user.scripts/tmpScripts/Plex_Preloader/script: line 106: ` seconds=$(time ( head -c "$preload_head_size" "$file" >/dev/null ) 2>&1 )'

     

    Can confirm, I'm also having this same error.

  3. 24 minutes ago, DJ-BrianC said:

    It doesn't work. You can see by all my previous posts which have never been addressed. The script needs some serious work before it can be released to the general public.

    Works fine for me and has for 7 months now.  Just because you can't figure out what YOU'RE doing wrong, doesn't mean it doesn't work.  Don't be obtuse.  The author is NOT your personal IT support.  Figure out your own issues like everyone else.

    • Like 1
  4. 1 minute ago, badbadntgood said:

    Thank you for the updated version to prevent the pipe errors.

    Unfortunately i'm now getting an error message saying that my paths are not being used by docker.

    video_paths=(
        "/mnt/user/data/media/movies"
        "/mnt/user/data/media/tv"
    )

    My paths in docker are set as /mnt/user/data/media typically but even changing to exclude the movies and tv subfolder and doing /mnt/user/data/media I get the same error message. Should I just remove the below section?

    # check if paths are used in docker containers
    if docker info > /dev/null 2>&1; then
      # get docker mounts of all running containers
      # shellcheck disable=SC2016
      docker_mounts=$(docker ps -q | xargs docker container inspect -f '{{$id := .Id}}{{range .Mounts}}{{if .Source}}{{printf $id}}:{{.Source}}{{println}}{{end}}{{end}}' | grep -v -e "^$")
      for path in "${video_paths[@]}"; do
        if [[ $docker_mounts != *"$path"* ]]; then
          /usr/local/emhttp/webGui/scripts/notify -i alert -s "Plex Preloader failed!" -d "$path is not used by a docker container!"
          exit 1
        fi
      done
    fi

    image.thumb.png.bafbbb3a64a6c5489bd231a6703d8da5.png

    I too am getting this error message despite using the exact same path in my dockers.  I've commented out the entire section you posted above with #'s and it's working fine again.  

     

    I greatly appreciate the script that the OP created, however, I'm not sure the docker check is necessary as everyone coming here likely IS running Plex/Jellyfin/Emby/etc. to utilize this script and has a grasp of what it's meant to do and how it works.  It seems a bit overkill and hand-holdy if we're manually inputting our paths to media in the first place, aware of what the paths should be to access our media within Dockers.  Maybe just a:

    "#This script is only meant to be used if you're using a docker that accesses your media at the specified paths."

     

    Would suffice instead of complicating the script.