ArturSierzant / OMPD

O!MPD is free, opensource MPD client based on PHP and mySQL.
http://ompd.pl
GNU General Public License v3.0
40 stars 13 forks source link

Year view enhancement #78

Closed brendan-pike closed 6 years ago

brendan-pike commented 6 years ago

I'd like to request more flexability in the way years are used. The main date I find interesting is the year something was recorded, the album release date less so. For example I'm listening to Boss Tenor by Gene Ammons currently, it was recorded in 1960 but the release I have is from 1991. When I browse my albums by year I am wanting to know when something was recorded. There seems to be a few used date meta tags in picard; date, originaldate, originalyear. I'm not sure which you are indexing and using in the year viewYear but my preference would be to either have the ability to select which is used or give preference to originaldate and originalyear.

ArturSierzant commented 6 years ago

The order of tags for year is as follows (code is in /include/tagProcessor.inc.php, function parseYear): year -> date -> creation_date So if year is found in tags (actually in comments section of getID3 analyse result), it is written in DB. If not, then script seeks for date and so on. If none is found, then unknown is written. Of course it is possible to let user to decide which tag should be treat as year - I can add new cfg value for that. But I'm not sure if it's enough: one value can be insufficient to cover all types of files. For example for mp3 files with id3v2 we have in comments section: original_release_time for tag TDOR, recording_time for TDRC; for flac this can be something else and so on. Please take a look at your files (file details from track/file menu in O!MPD) and write how originaldate and originalyear are represented in comments section for different types of files. I think it would be better to add new positions to function parseYear so the order looks like: originaldate -> originalyear -> year -> date -> creation_date -> maybe something else Anyway I need to know how it looks for your files.

For me this is also important, but I solved it like this: as a year I always use original issue date; for remasters or newer releases I add new date in album title, e.g. 'London Calling (1999 Remaster)' for The Clash album from 1979. That way I have both years displayed in album view or Now Playing.

brendan-pike commented 6 years ago

Thanks Artur, sorry for the late reply, I seemed to miss notifications. I mainly use Picard and thus follow the tagging standards of Musicbrainz, my main date fields are: (in importance to me) Recorded date ORIGINALYEAR ORIGINALDATE RETAIL DATE

ArturSierzant commented 6 years ago

No problem with late answer. I installed Picard and found ORIGINALYEAR and ORIGINALDATE on its list of tags. But I can't find Recorded date and RETAIL DATE - do you add them by hand?

brendan-pike commented 6 years ago

Yeh interesting. I examined my files using https://mediaarea.net/en/MediaInfo and found the tags that way. But your right, eg. $ mediainfo /mnt/Audio/Lossless/Robert\ Cray\ Band/Live...\ Texas/01\ I\ Guess\ I\ Showed\ Her.flac General Complete name : /mnt/Audio/Lossless/Robert Cray Band/Live... Texas/01 I Guess I Showed Her.flac Format : FLAC Format/Info : Free Lossless Audio Codec File size : 23.4 MiB Duration : 3mn 49s Overall bit rate mode : Variable Overall bit rate : 855 Kbps Album : Live... Texas '87 Album/Performer : Robert Cray Band Part : 1 Part/Total : 1 / 1 Track name : I Guess I Showed Her Track name/Position : 01 Track name/Total : 14 / 14 Performer : Robert Cray Band Genre : Blues; Rock Recorded date : 2016 Cover : Yes Cover type : Cover (front) Cover MIME : image/jpeg dynamic range : 10 album dynamic range : 9 STYLE : Rock; Blues ACOUSTID_ID : 89c110a9-d379-44f3-bc31-7fac6c217dfe

Audio Format : FLAC Format/Info : Free Lossless Audio Codec Duration : 3mn 49s Bit rate mode : Variable Bit rate : 852 Kbps Channel(s) : 2 channels Channel positions : Front: L R Sampling rate : 44.1 KHz Bit depth : 16 bits Stream size : 23.3 MiB (100%) Writing library : libFLAC 1.3.1 (UTC 2014-11-25)

ArturSierzant commented 6 years ago

OK, so let's see how getID3 sees that. Please do as follows: in O!MPD file browser (Library -> files) navigate to that album and from 01 I Guess I Showed Her.flac file menu select File details. You should see table with data red from file by getID3. Try to find there Recorded date and write in what section it's placed. My guess is that Mediainfo just displays one of the tags ORIGINALYEAR, ORIGINALDATE, YEAR or DATE as Recorded date, but I might be wrong.

brendan-pike commented 6 years ago

I just inspected using GetID3 and your right, that 'Recorded date' tag does not exist, so mediainfo must be creating it itself, probably from the 'date' tag I suspect.

ArturSierzant commented 6 years ago

I took a closer look at the way of storing the year informations in different containers and I modified parseYear so now the order of choosing the year looks like this: originalyear -> originaldate -> origyear -> original_year -> original_release_time -> year -> date -> creation_date First 3 are valid for FLAC/mp3, next 2 for mp3 and last 3 are common. Now O!MPD should correctly index originalyear and originaldate (if they are used) and use them as 'year' in DB.