ratanakvlun / deluge-labelplus

81 stars 32 forks source link

Race condition when applying autolabel based on vanilla label? #22

Open deepfriedmind opened 7 years ago

deepfriedmind commented 7 years ago

First of all, thanks for a great plugin!

I use Deluge with Sonarr. When Sonarr grabs a release and sends it to Deluge, it automatically applies a label (using the vanilla label plugin). In LabelPlus I have set up a label (sonarr) using an Autolabel action of [Label] [is] [ignore-case] [sonarr] to decide where the files get moved to after completion.

This has been working fine for a while now, but I just got a new NAS and re-did my setup. Now it seems that there's a slight delay before the vanilla label is applied or something, because LabelPlus immediately adds the wrong label (since it thinks there is no vanilla label).

Does my explanation make sense? Do you have any ideas about what could be done? Is there an order of evaluation that could be changed or something like that? Could it make a difference if I edited labelplus.conf and changed the order of the labels in the JSON structure? My best idea right now is to create a really complicated regex pattern that would take long enough to evaluate for the vanilla label to have been set :)

gggirlgeek commented 7 years ago

I wonder if your new setup is giving you magnets instead of .torrent files? If so I have noticed that Deluge will not apply any vanilla labels or LabelPlus lables automatically.

Either way, what you can do is "Apply" your LabelPlus Auto Label again (under the label's Options, Auto Label tab.) This sometimes gets Deluge to catch stuff it missed for me. It's a step that shouldn't be necessary but might help for now.

deepfriedmind commented 7 years ago

I'm not receiving magnets and the vanilla label from Sonarr does get applied, it just seems that it happens with an ever-so-slight delay so that LabelPlus's auto-labeling has already been applied.