jellyfin-plugin-webhooks
jellyfin-plugin-webhooks copied to clipboard
Possibility to delay ItemAdded event untill metadata is updated
Would it be possible to have some kind of way to only fire up ItemAdded when the metadata is fully updated? I use .nfo files so most of the time this is within 2 seconds of it being added, but it always misses it.
The official Jellyfin webhook plugin does it something like this (from their code)
// Metadata not refreshed yet and under retry limit.
if (item.ProviderIds.Keys.Count == 0 && container.RetryCount < MaxRetries)
{
_logger.LogDebug("Requeue {ItemName}, no provider ids", item.Name);
container.RetryCount++;
_itemProcessQueue.AddOrUpdate(key, container, (_, _) => container);
continue;
}
_logger.LogDebug("Notifying for {ItemName}", item.Name);
I know I could also watch for ItemUpdated and work with something of a cache myself, but I feel like I unnecessary spam my webhook receiver with ItemUpdated events.
Thank you!
Sorry I don't have time to test these scenarios for now, but gladly accept a PR if any.
I don't have a lot of C knowledge but I will try