nwithan8 / plex-prerolls

Schedule Plex Pre-Roll listings
28 stars 0 forks source link

Issue with potential path to prerolls #4

Closed ThatTallGuy21 closed 1 month ago

ThatTallGuy21 commented 1 month ago

I'm using your docker container in UNRAID and have been having issues (I believe) with the path to my pre-rolls for several hours now. Here's a snippet from the log. Your help would be greatly appreciated. Please let me know what I am doing wrong! :)

Cron schedule: * * * * *
Dry run flag: 
Scheduling cron job
Applying cron job
Starting cron
2024-06-03 21:49:01,349 - [INFO]: Starting Plex Prerolls...
2024-06-03 21:49:01,349 - [INFO]: Parsing schedules...
2024-06-03 21:49:01,365 - [INFO]: Found 2 valid schedules
2024-06-03 21:49:01,365 - [INFO]: 
Valid Schedule Count:
Always - 1
- Always (1970-01-01 00:00:00 - 9999-12-31 23:59:59)

Weekly - 0

Monthly - 0

Date Ranges - 1
- Spring (2024-03-20 00:00:00 - 2024-06-20 23:59:59)

2024-06-03 21:49:01,366 - [INFO]: Connecting to Plex server at http://192.168.87.26:32400
2024-06-03 21:49:01,374 - [INFO]: No pre-roll paths to update

I have tried following the 'read-me' and even the example you provide. For reference, all of my prerolls are in their own subdirectories (ex: general, christmas, sping, etc.). I can watch them all in Plex under my Preroll library with the path /data/media/other video/plex preroll collection/

Starting with my template in UNRAID.. Config Path = /mnt/user/appdata/plex_prerolls/config/ Container Path: /config

Log Path = /mnt/user/appdata/plex_prerolls/logs/ Container Path: /logs

Files Path = /mnt/user/data/media/other video/plex preroll collection/ Container Path: /files

In the config file; a snippet of my always, date range, and advanced sections.

# Always include these pre-rolls
always:
  enabled: true
  path_globs:
    - "/general/*.mp4" # Optional, use globbing to match local paths
  random_count: 5 # Optional, randomly select X many videos from the list rather than all of them
  weight: 1 # Optional, how much to emphasize these pre-rolls over others (higher = more likely to play)

# Schedule prerolls by date and time frames
date_range:
  enabled: true
  ranges:
# New Years Pre-rolls
    - name: "New Years" # Optional name for logging purposes
      start_date: xxxx-12-31 # Every year on December 26th
      end_date: xxxx-01-07 # Every year on January 10th
      path_globs:
        - "new years/*.mp4" # Optional, use globbing to match local paths
      random_count: 5 # Optional, randomly select X many videos from the list rather than all of them
      weight: 3 # Optional, add these paths to the list twice (make up greater percentage of prerolls - more likely to be selected)
      disable_always: true # Optional, if present and true, disable the always prerolls when this schedule is active
# Advanced globbing section
advanced:
  path_globbing:
    enabled: true # If true, use globbing to match paths
    root_path: /mnt/user/data/media/other video/plex preroll collection/ # The root folder to use for globbing
    plex_path: /data/media/other video/plex preroll collection/ # The path to use for the Plex server
ThatTallGuy21 commented 1 month ago

Just saw, what appears to maybe be a related merge for a new feature back in February that allowed me to approach things the above way.. Maybe it's not working?

https://github.com/nwithan8/plex-prerolls/pull/3

nwithan8 commented 1 month ago

root_path: /mnt/user/data/media/other video/plex preroll collection/ # The root folder to use for globbing

Files Path = /mnt/user/data/media/other video/plex preroll collection/ Container Path: /files

From inside the container, the files are available at /files, so you need root_path: /files.

If you are using the Unraid version of this container, the "Files Path" path is mapped to /files by default; you should set root_path to /files and plex_path to the same directory as seen by Plex.

The leading backslash for the path glob in your "always" configuration is probably also interfering:

path_globs:

  • "/general/*.mp4" # Optional, use globbing to match local paths
ThatTallGuy21 commented 1 month ago

Got it working! THANK YOU! In a minor unrelated note. Your read-me calls out "random_count" while your example uses "count". The correct one for me ended up being "count" as it was the only one of the two that actually chose a subset of prerolls from the subdirectory based on the count I defined.

ThatTallGuy21 commented 1 month ago

See my previous comment. Issue ended up being a path issue on my part.