-
Notifications
You must be signed in to change notification settings - Fork 163
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
Player hooks with data arguments #190
Comments
@aome510 i would like to hear from this. i am tired of the propietary spotify client. |
I've been quite busy lately, so I won't be able to implement this soon. However, will put this up in my TODO list and see look into ways to integrate the last.fm APIs, if any. |
well, this feature request is for hooks, which is alot simpler than implementing the last.fm API, since that can be handled by another program making the stack simpler. |
Plan to implement this next week or so. Does writing player events in a cache file work? You can write a script to watch for changes in that file every second or so, and port that to last.fm client. Lmk if I need to include any fields other than the event data (I plan to include the timestamp). |
honestly been using the propietary spotify client for a long while now, i'd much rather have librespot itself actually supporting this shit rather than me having to send last.fm api requests constantly |
Just saw this issue: jpochyla/psst#424. Look like |
Wow, okay!!!! I'll check tommorow!! I will be very happy if this is true. |
thank u |
Related librespot-org/librespot#913. That's one thing I miss from the official app and wish that |
|
Wait, this issue still remains. |
I do want to have some form of player hooks to be honest; my use case being to avoid constant D-Bus requests. |
Does writing player events into a file work? I'm not too familiar with the player hook concept and how to implement one. |
Player hooks is to launch a program with certain metadata (such as song, album, title) as arguments, on certain events (such as play, new song, pause, etc) |
Implemented in #244. Refer to https://github.com/aome510/spotify-player/blob/add-player-hook/docs/config.md#player-event-hook-command for how to use the command. |
why json? :( |
for consistency with CLI commands' output and because the app already supports exporting Spotify data in JSON format. |
Why not ususe JSON for big Spotify data? For example for simple data it should simply be it in plain text, and the arguments to be passed as the arguments themselves:
|
I can't use this feature; setting player_event_hook_command = "spotify_player-hook"
|
Please refer to the linked document to use a correct format. It should be Regarding why JSON but not plain text with arguments,
|
#!/bin/sh
echo "command: $1"
case "$1" in
Changed) echo "old_track_id: $3, new_track_id: $3" ;;
Playing) echo "track_id: $2, position_ms: $3, duration_ms: $4" ;;
Paused) echo "track_id: $2, position_ms: $3, duration_ms: $4" ;;
EndOfTrack) echo "track_id: $2" ;;
esac I hightly suggest to you to please use a arguement system, as it makes my life and others much easier when scripting for spotify-player. |
Ok, I'll think about it. |
Just a note that with the arguments approach, new user will be confused between the arguments, e.g is it |
Well? They need to read the docs to understand what the hooks do, their arguments and commands to begin with. |
Should be updated with #251. |
Is your feature request related to a problem? Please describe.
Recently, I have stopped using spotify-player simply because libreapot does not has support for external connections such as last.fm, and can not do notifications without Dbus.
Describe the solution you'd like
A hook system that launches a program with arguments set in the configuration for events such as pre, post, during (second interval) for sub-events for playing, pausing, skipping, etc..
I can use these to pass to notification or lastfm scrobller clients.
Describe alternatives you've considered
Using librespot or spotifyd directly, I believe librespot has direct support for this feature, so I don't think it would be trivial to implement it here.
The text was updated successfully, but these errors were encountered: