Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug(plex): not refreshing subtitles for directory #184

Open
Shasoosh opened this issue Mar 1, 2025 · 13 comments · May be fixed by #189
Open

bug(plex): not refreshing subtitles for directory #184

Shasoosh opened this issue Mar 1, 2025 · 13 comments · May be fixed by #189

Comments

@Shasoosh
Copy link

Shasoosh commented Mar 1, 2025

Hey,

I'm debugging an issue and could use some help.

The situation: Bazarr detects a new subtitle for a movie and triggers AutoPulse via a Python script. Here's the gist of that script:

curl -u 'admin:password' 'http://192.168.1.10:2875/triggers/manual?path={encoded_string}'

However, Plex doesn't detect the new subtitle when playing the movie. If I manually refresh the metadata via Plex, either by selecting "Refresh Metadata" for the movie or "Refresh All Metadata", the issue gets resolved.

The UI displays the following:

Image

Clicking "Retry" in the UI generates the following logs, but the subtitles still aren't recognized:

My config.yaml:

 app:
  log_level: trace

 opts:
   check_path: true # Check if the path exists, assuming the path is available to the container
   max_retries: 5 # Exponential backoff when a target fails

 triggers:
   manual:
     type: manual

 targets:

   plex:
     type: plex
     url: http://192.168.1.10:32400
     token: APZ_XXXXXXXXXXXXXXXXX

autopulse: (logs are on trace)

2025-03-01T23:25:07.068010126+02:00 DEBUG autopulse_server::routes::triggers: added 1 file from manual trigger
2025-03-01T23:25:07.068086992+02:00  INFO actix_web::middleware::logger: 172.20.0.1 "GET /triggers/manual?path=%2FMedia%2FVideos%2FMovies%2FShasoosh%2FThe+Prestige+%282006%29 HTTP/1.1" 200 466 "-" "node" 0.031922    
2025-03-01T23:26:07.133460968+02:00 DEBUG autopulse_service::settings::targets::plex: scanned file '/Media/Videos/Movies/Shasoosh/The Prestige (2006)'
2025-03-01T23:26:07.141973039+02:00  INFO autopulse_service::runner: sent 1 file to targets

Plex Media Server

Mar 01, 2025 21:26:07.131 [140189329759032] DEBUG - Request: [172.20.0.4:57442 (WAN)] GET /library/sections/4/refresh?path=%2FMedia%2FVideos%2FMovies%2FShasoosh (8 live) #1c9ed6 Signed-in Token (shasooshs) (Chrome)
Mar 01, 2025 21:26:07.131 [140189329759032] DEBUG - [Req#1c9ed6] Library Updater: Requested that section 4 be updated, force=0, subdir=/Media/Videos/Movies/Shasoosh iTunes=0
Mar 01, 2025 21:26:07.131 [140189329759032] DEBUG - [Req#1c9ed6] Library Updater: Queueing section 4
Mar 01, 2025 21:26:07.131 [140189484092216] DEBUG - Completed: [172.20.0.4:57442] 200 GET /library/sections/4/refresh?path=%2FMedia%2FVideos%2FMovies%2FShasoosh (8 live) #1c9ed6 0ms 195 bytes (pipelined: 1)
Mar 01, 2025 21:26:07.132 [140189470538552] DEBUG - Activity: registered new activity 468bf158-31dc-4ea4-9c98-69c6ce68eff6 - "Scanning"
Mar 01, 2025 21:26:07.132 [140189470538552] DEBUG - Scanning section 4
Mar 01, 2025 21:26:07.132 [140189470538552] DEBUG - Activity: updated activity 468bf158-31dc-4ea4-9c98-69c6ce68eff6 - completed 0.0% - Scanning סרטים
Mar 01, 2025 21:26:07.132 [140189470538552] DEBUG - Job was already killed, not killing again.
Mar 01, 2025 21:26:07.138 [140189470538552] DEBUG - Asked to cull library timeline before time 1740863167, we're starting with 94 items.
Mar 01, 2025 21:26:07.138 [140189470538552] DEBUG - Library timeline cull complete with 94 items left.
Mar 01, 2025 21:26:07.138 [140189470538552] DEBUG - Scanning סרטים using he-IL(Plex Movie) with 91 current media items and 1 section locations in the database.
Mar 01, 2025 21:26:07.138 [140189470538552] DEBUG - Performing a scan with 'Plex Movie' (language: he-IL virtual: 0).
Mar 01, 2025 21:26:07.138 [140189470538552] DEBUG -   * Scanning /Media/Videos/Movies/Shasoosh
Mar 01, 2025 21:26:07.139 [140189470538552] DEBUG - Scanner: Processing directory /Media/Videos/Movies/Shasoosh (parent: no)
Mar 01, 2025 21:26:07.144 [140189304023864] DEBUG - Request: [192.168.1.100:3125 (Subnet)] GET /media/providers (8 live) #1c9ed9 TLS GZIP Signed-in Token (shasooshs) (Chrome)
Mar 01, 2025 21:26:07.147 [140189329759032] DEBUG - Request: [192.168.1.100:3128 (Subnet)] GET /library/sections (9 live) #1c9ef9 TLS GZIP Signed-in Token (shasooshs) (Chrome)
Mar 01, 2025 21:26:07.147 [140189486201656] DEBUG - Completed: [192.168.1.100:3125] 200 GET /media/providers (9 live) #1c9ed9 TLS GZIP 3ms 4476 bytes (pipelined: 1)
Mar 01, 2025 21:26:07.148 [140189486201656] DEBUG - Completed: [192.168.1.100:3128] 200 GET /library/sections (9 live) #1c9ef9 TLS GZIP 1ms 1124 bytes (pipelined: 1)
Mar 01, 2025 21:26:07.169 [140189304023864] DEBUG - Request: [192.168.1.100:3130 (Subnet)] GET /library/sections (10 live) #1c9efb TLS GZIP Signed-in Token (shasooshs) (DESKTOP)
Mar 01, 2025 21:26:07.170 [140189484092216] DEBUG - Completed: [192.168.1.100:3130] 200 GET /library/sections (10 live) #1c9efb TLS GZIP 1ms 993 bytes (pipelined: 1)
Mar 01, 2025 21:26:07.187 [140189470538552] DEBUG - Skipping over directory '', as nothing has changed; removing 0 media items from map.
Mar 01, 2025 21:26:07.198 [140189470538552] DEBUG - Scanner: Processing directory /Media/Videos/Movies/Shasoosh/The Prestige (2006) (parent: yes)
Mar 01, 2025 21:26:07.199 [140189470538552] DEBUG - Skipping over directory 'The Prestige (2006)', as nothing has changed; removing 1 media items from map.
Mar 01, 2025 21:26:07.199 [140189470538552] DEBUG - Activity: updated activity 468bf158-31dc-4ea4-9c98-69c6ce68eff6 - completed 1.1% - Scanning סרטים
Mar 01, 2025 21:26:07.200 [140189470538552] DEBUG - Scanner: Processing directory /Media/Videos/Movies/Shasoosh/The Pursuit of Happyness (2006) (parent: yes)
Mar 01, 2025 21:26:07.200 [140189470538552] DEBUG - Skipping over directory 'The Pursuit of Happyness (2006)', as nothing has changed; removing 1 media items from map.

It looks like AutoPulse is performing a full scan rather than scanning a specific movie. Additionally, it's running a scan instead of a "Refresh Metadata," which is what actually resolves the missing subtitles issue. I haven’t found any errors in the logs, though I might be missing some Plex logs. However, after clicking "Retry" in the UI, the only file that was updated was Plex Media Server.log.

Any help would be greatly appreciated.

Edit:

I've tried editing my config.yaml to this

 targets:

   plex:
     type: plex
     url: http://192.168.1.10:32400
     token: APZ_XXXXXXXXXXXXXXXX
     refresh: true
     analyze: true

But it didn't help. Looks like Plex is only performing a Scan without refresh Meta Data.

@Shasoosh
Copy link
Author

Shasoosh commented Mar 4, 2025

A quick update - I installed autoscan-adapter and successfully triggered a metadata refresh for a specific title. Based on this FR, autopulse appears to use the same logic, but I don’t see the metadata refresh being triggered from autopulse. I'm still not sure if it's a bug in the autopulse logic or refresh: true in config.yaml is just being ignored.

@dan-online dan-online changed the title Subtitles are still not recognized even after a successful AutoPulse scan or retry bug(plex): not refreshing subtitles Mar 12, 2025
@dan-online dan-online changed the title bug(plex): not refreshing subtitles bug(plex): not refreshing subtitles for directory Mar 12, 2025
@dan-online
Copy link
Owner

Autopulse currently doesn't recursively update directories (with both plex & jellyfin), something I see autoscan-adapter does. I'll check this out and see if I can implement this

@Shasoosh
Copy link
Author

Thanks, @dan-online. Do you think the lack of recursive directory updates is related to the refresh metadata not being triggered at all, even when refresh: true is set?

@dan-online
Copy link
Owner

When the input is a directory, I skip the refresh/analyze since it wasn't recursive and couldn't find the relevant metadata to refresh

@dan-online dan-online linked a pull request Mar 12, 2025 that will close this issue
4 tasks
@dan-online
Copy link
Owner

Let me know if #189 under danonline/autopulse:pr-189 fixes your issues!

@Shasoosh
Copy link
Author

Thanks Dan. Is there an easy way to test this if I usually use docker compose?

@dan-online
Copy link
Owner

You should be able to just change the tag in your compose file

@Shasoosh
Copy link
Author

Thanks, Dan.

I tested the change, but unfortunately, it doesn’t seem to work.

Usually, when metadata is refreshed - whether through the autoscan-adapter or manually refreshing a movie in the Plex UI - the Plex logs update accordingly. Specifically:

Plex Media Scanner Matcher.log gets new entries.
Plex Media Server.log includes lines like:

[Req#c0d0d] Updating metadata item (save) (Anora) with ID 15683

However, Autopulse still isn’t triggering those updates.

@dan-online
Copy link
Owner

Hmm, could you provide some logs then with trace enabled

@Shasoosh
Copy link
Author

These are the only logs I get with trace enabled:

2025-03-13T11:27:58.226245823+02:00  INFO autopulse: 💫 autopulse v1.3.0 starting up...

2025-03-13T11:27:58.954270196+02:00  INFO actix_server::builder: starting 4 workers

2025-03-13T11:27:58.954299253+02:00  INFO autopulse: 🚀 listening on 0.0.0.0:2875

2025-03-13T11:28:08.001996703+02:00  INFO actix_web::middleware::logger: 127.0.0.1 "GET /stats HTTP/1.1" 200 89 "-" "Wget" 0.004634    

2025-03-13T11:28:45.703082825+02:00 DEBUG autopulse_server::routes::triggers: added 1 file from manual trigger

2025-03-13T11:28:45.703155927+02:00  INFO actix_web::middleware::logger: 172.20.0.1 "GET /triggers/manual?path=/Media/Videos/Movies/Shasoosh/Anora%20%282024%29 HTTP/1.1" 200 459 "-" "curl/8.5.0" 0.013801    

2025-03-13T11:28:46.073482485+02:00  INFO autopulse_service::runner: found 1 new file

2025-03-13T11:28:48.263176599+02:00  INFO actix_web::middleware::logger: 127.0.0.1 "GET /stats HTTP/1.1" 200 89 "-" "Wget" 0.001416    

@dan-online
Copy link
Owner

The default timer is about 60s so you'll need to wait that long before its sent to targets, then there should be some plex logs

@Shasoosh
Copy link
Author

You're right, Dan - I forgot about the timer. Everything looks good now, and I can see all the previously missing lines in the Plex logs.

The missing subtitles issue happens randomly, so I’ll wait and see if it can be reproduced.

Thanks!

@dan-online
Copy link
Owner

Sounds good, I'll merge this in a week regardless

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants