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

Metadata API #28

Open
wants to merge 7 commits into
base: non-admin-users
Choose a base branch
from
Open

Conversation

vishwasmittal
Copy link
Contributor

Added API to fetch metadata for the media files. Following data can be retrieved from a file:

        Format   string `json:"format"`
	FileType string `json:"file_type"`

	Title       string `json:"title"`
	Album       string `json:"album"`
	Artist      string `json:"artist"`
	AlbumArtist string `json:"album_artist"`
	Composer    string `json:"composer"`
	Genre       string `json:"genre"`
	Year        int    `json:"year"`

	Picture *tag.Picture // `json:"picture"` // Artwork
	Lyrics  string `json:"lyrics"`
	Comment string `json:"comment"

Some of it may be null subject to the data present in the file.

@vishwasmittal
Copy link
Contributor Author

fixes #26

@csoni111
Copy link
Member

I tested the pr, it works fine. Just one small issue that I noticed, it returns the complete cover image data in the JSON response, something like this:

"Picture":{"Ext":"jpg","MIMEType":"image/jpeg","Type":"Cover (front)","Description":"","Data":"/9j/4AAQSkZJRgABAQEASABIAAD/....."}

How to use this image data on the client-side? The purpose behind building this API was to serve chromecast with the URL of the cover image. So it would make sense if we cache this image data in a jpeg file in .fscache directory and return the URL of the file accessible via /cache.

@csoni111
Copy link
Member

Please also include the docs for this API in amahi-anywhere-specs

@vishwasmittal
Copy link
Contributor Author

Yeah, caching the image in .fscache makes sense. Will update the PR.

@cpg
Copy link
Member

cpg commented Aug 27, 2019

Can we get the docs for the API at the same time as the code, so we can deploy it?

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants