Closed mvanbaak closed 1 month ago
I think the best way to solve this is to just check that the path is not already in the database in a pending process state. I'll add that in a PR
I think the best way to solve this is to just check that the path is not already in the database in a pending process state. I'll add that in a PR
That would indeed be the best option I guess. As long as it does reset the timer though ;)
Yep, it should still reset the timer since it will just return the existing event
Feel free to check out pr-46
once this finishes
Feel free to check out
pr-46
once this finishes
I dont use docker. But I can check later today.
Feel free to check out
pr-46
once this finishes
I can confirm that it now sends only 1 refresh:
2024-09-27T08:46:30.183013Z INFO autopulse: 💫 autopulse starting up...
2024-09-27T08:46:30.186775Z INFO actix_server::builder: starting 12 workers
2024-09-27T08:46:30.186790Z INFO actix_server::server: Tokio runtime found; starting in existing Tokio runtime
2024-09-27T08:46:30.186798Z INFO actix_server::server: starting service: "actix-web-service-0.0.0.0:2875", workers: 12, listening on: 0.0.0.0:2875
2024-09-27T08:46:37.667117Z DEBUG autopulse::routes::triggers: added 1 file from manual trigger
2024-09-27T08:46:37.667204Z INFO actix_web::middleware::logger: 192.168.10.50 "GET /triggers/manual?path=%2fmnt%2fmvanbaaknas%2fSeries%2fPeda%c3%a7o+de+Mim+%282024%29+%5bimdb-tt27505298%5d%2fSeason+01 HTTP/1.1" 200 429 "-" "curl/8.7.1" 0.008685
2024-09-27T08:46:50.701050Z DEBUG autopulse::routes::triggers: added 1 file from manual trigger
2024-09-27T08:46:50.701148Z INFO actix_web::middleware::logger: 192.168.10.50 "GET /triggers/manual?path=%2fmnt%2fmvanbaaknas%2fSeries%2fPeda%c3%a7o+de+Mim+%282024%29+%5bimdb-tt27505298%5d%2fSeason+01 HTTP/1.1" 200 429 "-" "curl/8.7.1" 0.000375
2024-09-27T08:47:20.030644Z DEBUG autopulse::routes::triggers: added 1 file from manual trigger
2024-09-27T08:47:20.030714Z INFO actix_web::middleware::logger: 192.168.10.50 "GET /triggers/manual?path=%2fmnt%2fmvanbaaknas%2fSeries%2fPeda%c3%a7o+de+Mim+%282024%29+%5bimdb-tt27505298%5d%2fSeason+01 HTTP/1.1" 200 429 "-" "curl/8.7.1" 0.000290
2024-09-27T08:47:32.948891Z DEBUG autopulse::routes::triggers: added 1 file from manual trigger
2024-09-27T08:47:32.948959Z INFO actix_web::middleware::logger: 192.168.10.50 "GET /triggers/manual?path=%2fmnt%2fmvanbaaknas%2fSeries%2fPeda%c3%a7o+de+Mim+%282024%29+%5bimdb-tt27505298%5d%2fSeason+01 HTTP/1.1" 200 429 "-" "curl/8.7.1" 0.000280
2024-09-27T08:48:03.330211Z INFO autopulse::service::runner: sent 1 file to targets
@mvanbaak Sorry to ping you on a fixed issue, but I was wondering, how did you configure Bazarr to trigger notifications to Autopulse? (i.e http://192.168.10.240:2875/triggers/manual?path=%2fmnt%2fmvanbaaknas%2fSeries%2fPeda%c3%a7o+de+Mim+%282024%29+%5bimdb-tt27505298%5d%2fSeason+01
)
You used Bazarr Notifications (with apprise), right? (I don't see any other native way)
The closest I got was using the Form notification type with the following URL:
form://admin:password@autopulse_host:2875/triggers/my_bazarr?:title&:type&:version&:message&method=get&attach-as=path
But it seems attach-as
doesn't work as I hoped, as path
is always missing ("Query deserialize error: missing field path
").
Tried also with JSON type, but same issue, no file attached, no way to extract the path.
Looking at the default payloads in Bazarr notifications, it seems to pretty much always be some plain text (i.e "MyMovie : English subtitles manually downloaded from embeddedsubtitles with a score of 100.0%."), Thus I don't really see how to extract the file path, any tips would be much appreciated!
You used Bazarr Notifications (with apprise), right? (I don't see any other native way)
No, I use Custom Post-Processing
which is under Settings -> Subtitles
. I use http
there to send a http request :)
The closest I got was using the Form notification type with the following URL:
form://admin:password@autopulse_host:2875/triggers/my_bazarr?:title&:type&:version&:message&method=get&attach-as=path
But it seems
attach-as
doesn't work as I hoped, aspath
is always missing ("Query deserialize error: missing fieldpath
"). Tried also with JSON type, but same issue, no file attached, no way to extract the path.Looking at the default payloads in Bazarr notifications, it seems to pretty much always be some plain text (i.e "MyMovie : English subtitles manually downloaded from embeddedsubtitles with a score of 100.0%."), Thus I don't really see how to extract the file path, any tips would be much appreciated!
Much easier!! I didn't know about this setting, thanks for your help
Description of the bug
So my current setup is:
The manual url bazarr uses:
http://192.168.10.240:2875/triggers/manual?path=%2fmnt%2fmvanbaaknas%2fSeries%2fPeda%c3%a7o+de+Mim+%282024%29+%5bimdb-tt27505298%5d%2fSeason+01'
Logs of autopulse registering the triggers:
All triggers are like 1 or 2 minutes from each other. The trigger timers thing works ok as autopulse worker only sends the files to the targets after X minutes after the last trigger for a directory/file.
BUT ... autopulse sends multiple refresh requests for the same directory to plex. While I would expect it to do only 1 per directory:
logs from the nginx that is running as reverse proxy of my plex instance:
with autoscan this results in only 1 HTTP call to the refresh endpoint with that directory.
Steps To Reproduce
Contact the autopulse daemon with the same path several times, each within the timeout period from the other. For example, run the following command 2 or more times in a couple of seconds and watch the outgoing http calls to plex. Expected: only one per directory Actual: every trigger results in a http request to plex, even if the directory/file is the same
Additional Information
Running autopulse 1.0.1 with the following configuration: