kabouzeid / Phonograph

A material designed music player for Android
GNU General Public License v3.0
2.73k stars 728 forks source link

Flac year tag #740

Open g0rdonL opened 5 years ago

g0rdonL commented 5 years ago

flac year tags unrecognized so i cant sort songs by year

-

Device info:

App version1.3.1
App version code175
Android build version1907281556
Android release version9
Android SDK version28
Android build IDRENOVATE ICE OP7Pro 6.0
Device brandOnePlus
Device manufacturerOnePlus
Device nameOnePlus7Pro
Device modelGM1910
Device product nameOnePlus7Pro_EEA
Device hardware nameqcom
ABIs[arm64-v8a, armeabi-v7a, armeabi]
ABIs (32bit)[armeabi-v7a, armeabi]
ABIs (64bit)[arm64-v8a]
abbluiz commented 5 years ago

I have the same problem. I was wondering if it was something wrong with my files, but nope.

abbluiz commented 5 years ago

Maybe the app does not recognize the vorbis comment "date" and use a custom field which I'm not using to tag my music...

paolovalerdi commented 5 years ago

This ahold be related to the Tag reader being unable to extract the date times from flac or vorbis files.

abbluiz commented 5 years ago

Why is that? Is it a separate application?

Also, I have noticed that VLC manages to read the date of my FLAC files just fine, if someone is looking for another app to listen your songs from, or perhaps seek a solution with their source code

quadrilo44 commented 5 years ago

Maybe the app does not recognize the vorbis comment "date" and use a custom field which I'm not using to tag my music...

From my testing of tags on vorbis files with a player forked from Phonograph. It's not looking at the "DATE" tag on them, only at the "YEAR" tag.

This file works:

64487262-bb2a7900-d26a-11e9-8fc9-905d5a4ca38a

This one doesn't

64487269-d4cbc080-d26a-11e9-8412-b0c460117410

I added the "YEAR" tag to the second file using Kid3 and the player picked it up immediately.

paolovalerdi commented 5 years ago

@quadrilo44 the "fork" was yours?. Anyway nice catch, I think this should be tweaked to not only look at the YEAR tag but the DATE also.

quadrilo44 commented 5 years ago

@quadrilo44 the "fork" was yours?. Anyway nice catch, I think this should be tweaked to not only look at the YEAR tag but the DATE also.

Nope, not my fork. And just for completeness, I have tested with this official Phonograph and it's the same behavior with v1.3.0.

According to xiph.org, the proper year field for vorbis and other files that use xiph comments is "DATE": https://xiph.org/vorbis/doc/v-comment.html

I believe the field in ID3 is "YEAR" (https://en.wikipedia.org/wiki/ID3#ID3v1_and_ID3v1.1[5]). so any player probably needs to check the field that is appropriate to the tag format.

tguen commented 4 years ago

This is a bug in android.provider.MediaStore, and also affects .mp3 files with ID3v2.4 tags. The only solution that I can think of would be to check if the year returned from MediaStore is zero, then read the tags directly from the file (as the tag editor already does). Although you don't want to do this for tons of files every time the app starts, so the tags should be cached.

tguen commented 4 years ago

Well it seems the app sorts albums by storing SQL to use in MediaStore queries in the preferences file. To implement the workaround I was planning on, the entire sorting system would need to be replaced, which probably won't happen. You'll have to hope that Google gets around to fixing MediaStore, but that doesn't sound likely either. :(