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

song duration #14

Closed
jxs opened this issue Oct 15, 2017 · 10 comments
Closed

song duration #14

jxs opened this issue Oct 15, 2017 · 10 comments

Comments

@jxs
Copy link
Contributor

jxs commented Oct 15, 2017

is there a reason for songs not having them? if not I can submit a PR in the next couple days adding them to the formats that support them (from what i see both id3and metaflac have support=
cheers :)

@agersant
Copy link
Owner

I'm all up for it! The main reason I did not do it earlier is that I found a lot of software doesn't write the duration ID3 value and I didn't want to slow down indexing by having to peek at the audio data .

@jxs
Copy link
Contributor Author

jxs commented Nov 19, 2017

i am sorry! haven't yet had time to finish this, i'll try to PR tomorrow
(also, thanks for the search!)

@agersant
Copy link
Owner

No worries! I haven't deployed a build with search on my own 'production' server yet, did you get a chance to test it?

@jxs
Copy link
Contributor Author

jxs commented Nov 28, 2017

Sorry, this is going to take a lot more, I ingenuously thought that the duration was present on the files metadata but turns out it is not, you have to calculate it from the bitrate and the file size.
The search works pretty flawless from my also short experience, I would just make it always present with a kind of fuzzy matching

@agersant
Copy link
Owner

Yeah, I'm afraid this will have to be implemented per audio format :c
My biggest worry would be having to actually read the audio data for some format (especially MP3), because that might hurt indexing speed a lot.

@jxs
Copy link
Contributor Author

jxs commented Nov 30, 2017

yeah, mp3 for example if it's VBR, from what i have read you have to calculate each frame duration using it's bitrate and size.
Yeah that might happen for sure, one alternative is to save the duration to the database and only scan each file once, if the path already exists on the database do not read it's values again, what do you think?

@agersant
Copy link
Owner

agersant commented Dec 2, 2017

Hard to make a call without performance measurements. I think this is a good plan B if measuring duration is very slow compared to querying the DB for an existing entry (with the drawback of potentially leaving a bad duration in the DB if the file is ever updated).

@jxs
Copy link
Contributor Author

jxs commented Dec 3, 2017

Ok, so flac is easy and fast jxs@16ae131 I am going to look into mp3 today, if you want i can PR with this, else i will submit when mp3 is done :)

@agersant
Copy link
Owner

agersant commented Dec 3, 2017

I would welcome a PR with just FLAC, baby steps!

@agersant
Copy link
Owner

This has been in for a while for mp3 and FLAC.

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

No branches or pull requests

2 participants