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

User webhooks #478

Closed
tcurdt opened this issue Sep 2, 2020 · 14 comments
Closed

User webhooks #478

tcurdt opened this issue Sep 2, 2020 · 14 comments

Comments

@tcurdt
Copy link
Contributor

tcurdt commented Sep 2, 2020

As mentioned in #18 it would be nice to allow user to configure webhooks to pass events to other system like e.g. Zapier.
The following events come to mind:

  1. play with attributes artist, album, track, played time, total time, cover url
  2. scrobble (played 90%) with attributes artist, album, track, played time, total time, cover url
  3. pause with attributes artist, album, track, played time, total time, cover url
  4. added to starred with attributes artist, album, track, total time, cover url
  5. removed from starred with attributes artist, album, track, total time, cover url
  6. added to playlist with attributes TBD
  7. remove from playlist with attributes TBD

ATM I am mostly interested in 1., 2. and 3.

@MoralCode
Copy link
Contributor

there don't seem to be any existing go libraries for sending webhooks. i might play around with trying to make one based on https://freek.dev/1383-sending-and-receiving-webhooks-in-laravel-apps.

@deluan
Copy link
Member

deluan commented Apr 10, 2021

@MoralCode I don't see a need for a library to send webhooks... They are usually an HTTP GET/POST, and GoLang's http client is straightforward and simple enough. Maybe I'm missing your point?

@MoralCode
Copy link
Contributor

MoralCode commented Apr 11, 2021

I was mostly thinking of a library just as a way to make implementing webhooks easy and simple for applications like Navidrome. To me it seems like the hardest part of implementing webhooks is the setup process of collecting the settings from the user and storing them.

I was thinking a library could be useful for simplifying this storage of webhook configurations so an app like Navidrome would just need to pass in the settings from the user and an internal key/identifier for representing that particular webhook-able "event". Whenever the app decides is appropriate for the webhook to be called, it could just be a one-liner to the effect of webhooks.trigger('webhook-event-id-here') with optional parameters for passing in headers and a body according to whatever format Navidrome chooses to implement. Essentially the library would primarily handle the storage and lookup of stored webhook configuration(s) for the event (such as the URL and HTTP method to use).

@MoralCode
Copy link
Contributor

MoralCode commented Apr 11, 2021

I have something basic thrown together at https://github.com/MoralCode/go-event-webhooks and am starting to see how simple the actual sending of a webhook is. My plan now is to start looking into how user settings are stored and retrieved to see where/how webhooks could be integrated into navidrome

@MoralCode
Copy link
Contributor

@tcurdt is there a particular service (you mentioned Zapier) that you are interested in sending these webhooks to at first? just added MoralCode/go-event-webhooks#6 tas a TO-DO item for the webhook library I am making for this and am curious if any particular service should be prioritized

@tcurdt
Copy link
Contributor Author

tcurdt commented Apr 18, 2021

@MoralCode I used Zapier just as one of the common examples. I'd probably send them to n8n or nodered instead. Or even write my own service.

@deluan
Copy link
Member

deluan commented Apr 18, 2021

I think another good example is IFTTT

@MoralCode
Copy link
Contributor

awesome! I added those as ideas to the issue I mentioned within the library.

@tcurdt
Copy link
Contributor Author

tcurdt commented Sep 29, 2021

Seems there is overlap with #246

@github-actions
Copy link

github-actions bot commented Mar 7, 2023

This issue has been automatically marked as stale because it has not had recent activity. The resources of the Navidrome team are limited, and so we are asking for your help.
If this is a bug and you can still reproduce this error on the master branch, please reply with all of the information you have about it in order to keep the issue open.
If this is a feature request, and you feel that it is still relevant and valuable, please tell us why.
This issue will automatically be closed in the near future if no further activity occurs. Thank you for all your contributions.

@github-actions github-actions bot added the stale label Mar 7, 2023
@tcurdt
Copy link
Contributor Author

tcurdt commented Mar 7, 2023

It would still be "nice to have" but I think we could close this issue by just having the last.fm scrobbler URL be configurable.
It's not yet, is it?

https://github.com/navidrome/navidrome/blob/master/conf/configuration.go#L103

@deluan
Copy link
Member

deluan commented Mar 7, 2023

#2229 will handle 1 and 2. 3 is not currently possible as the clients do not send this info to the server. The other will be eventually implemented

@github-actions github-actions bot removed the stale label Mar 8, 2023
@github-actions
Copy link

github-actions bot commented Sep 5, 2023

This issue has been automatically marked as stale because it has not had recent activity. The resources of the Navidrome team are limited, and so we are asking for your help.
If this is a bug and you can still reproduce this error on the master branch, please reply with all of the information you have about it in order to keep the issue open.
If this is a feature request, and you feel that it is still relevant and valuable, please tell us why.
This issue will automatically be closed in the near future if no further activity occurs. Thank you for all your contributions.

@github-actions github-actions bot added the stale label Sep 5, 2023
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Oct 5, 2023
Copy link

github-actions bot commented Feb 3, 2024

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 3, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants