-
Notifications
You must be signed in to change notification settings - Fork 36
Add metadata to fifo pipe output #203
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
base: master
Are you sure you want to change the base?
Conversation
Add /daemon /go-librespot
This is the config.yml I have been using:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
First review, I did not test it and generally glazed over some things.
Thank you for your effort!
"google.golang.org/protobuf/proto" | ||
) | ||
|
||
// Update extractMetadataFromStream method signature: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tautological comment
} | ||
} | ||
|
||
return title, artist, album, trackID, duration, artworkURL, artworkData |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should not be returning that many values
/* | ||
if p.primaryStream != nil { | ||
title, artist, album, trackID, duration, artworkURL := p.extractMetadataFromStream(p.primaryStream) | ||
p.app.log.Debugf("Sending metadata: %s by %s", title, artist) | ||
p.UpdateTrack(title, artist, album, trackID, duration, true, artworkURL) // true = playing | ||
} | ||
*/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can this be definitely removed?
|
||
p.UpdatePlayingState(true) | ||
|
||
// Add this line to update position on resume |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tautological comment
|
||
p.sess.Events().PostPrimaryStreamLoad(p.primaryStream, paused) | ||
|
||
// In loadCurrentTrack method: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tautological comment
drop bool | ||
} | ||
|
||
// Update MetadataCallback interface: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tautological comment
/daemon | ||
/go-librespot |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess these are because you are cross-compiling, but they are a bit misleading
|
||
_, err := fm.pipe.Write(data) | ||
if err != nil { | ||
// Close and attempt to reopen on error |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doesn't seem reconnection happens on error
switch fm.format { | ||
// case "json": | ||
// data = metadata.ToJSONFormat() | ||
case "xml": // ADD THIS CASE | ||
data = metadata.ToXMLFormat() | ||
//default: // "dacp" | ||
// data = metadata.ToDACPFormat() | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These should be supported right?
} | ||
|
||
// Update UpdateTrack method signature: | ||
func (pm *PlayerMetadata) UpdateTrack(title, artist, album, trackID string, duration time.Duration, playing bool, artworkURL string, artworkData []byte) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps we can use a struct here
Add metadata to fifo pipe output as requested in: Add metadata output to a pipe as it is in librespot-java #157
Functionally this works very well showing track info, duration and timing, and artwork when piped into owntone and the Home Assistant dashboard when running when running in an addon.
I used AI to help write it and don't see any issues at this point. This is my first pull request so I expect there will be nits and other issues, but I will do will what I can to help push this forward.