Discussion:
[emms-help] info-year and info-date
Pierre Neidhardt
2017-11-05 12:23:36 UTC
Permalink
Almost all my tracks use 'info-date and not info-year.

Because of

(defun emms-browser-format-line (bdata &optional target)
;; ...
(format-choices
`(("i" . ,indent)
("n" . ,name)
("y" . ,(emms-track-get track 'info-year))

the album date (or year) does not get displayed in the browser.

The following fixes it:

("y" . ,(emms-track-get track 'info-date))

Of course this is not a viable solution as the users who need the
'info-year field lose the year display.

Is there any generic way to always derive the track year from both
'info-date and 'info-year?

Do we actually need both fields? Looks like only info-date would be useful.

--
Pierre Neidhardt

About the only thing we have left that actually discriminates in favor of
the plain people is the stork.
Pierre Neidhardt
2017-11-05 13:53:00 UTC
Permalink
Another example: album sorting also uses 'info-year only.

My quick&dirty patch:

(defun emms-browser-year-number (track)
"Return a string representation of a track's year.
This will be in the form '(1998) '."
(let ((year (or (emms-track-get track 'info-year) (emms-track-get track 'info-date))))
(if (or (not (stringp year)) (string= year "0"))
""
(concat
"(" year ") "))))
--
Pierre Neidhardt

Life's too short to dance with ugly women.
Yoni Rabkin
2017-11-06 23:44:01 UTC
Permalink
Post by Pierre Neidhardt
Almost all my tracks use 'info-date and not info-year.
Because of
(defun emms-browser-format-line (bdata &optional target)
;; ...
(format-choices
`(("i" . ,indent)
("n" . ,name)
("y" . ,(emms-track-get track 'info-year))
the album date (or year) does not get displayed in the browser.
("y" . ,(emms-track-get track 'info-date))
Of course this is not a viable solution as the users who need the
'info-year field lose the year display.
Is there any generic way to always derive the track year from both
'info-date and 'info-year?
Unfortunately, there is no easy way to do this.
Post by Pierre Neidhardt
Do we actually need both fields? Looks like only info-date would be useful.
I agree, but as I've mentioned elsewhere, I don't use the browser so my
opinion isn't worth as much here.

Rasmus? Do you have input on this issue?
--
"Cut your own wood and it will warm you twice"
Pierre Neidhardt
2017-11-07 07:04:03 UTC
Permalink
Post by Yoni Rabkin
Unfortunately, there is no easy way to do this.
What about

("y" . ,(or (emms-track-get 'info-year) (emms-GET-YEAR-FROM-DATE (emms-track-get track 'info-date)))

Where the upcase function might have to be implemented, although I got
one on this mailing list recently.
--
Pierre Neidhardt

I am the wandering glitch -- catch me if you can.
Rasmus Pank Roulund
2017-11-07 09:37:40 UTC
Permalink
Post by Pierre Neidhardt
Post by Yoni Rabkin
Unfortunately, there is no easy way to do this.
What about
("y" . ,(or (emms-track-get 'info-year) (emms-GET-YEAR-FROM-DATE (emms-track-get track 'info-date)))
Where the upcase function might have to be implemented, although I got
one on this mailing list recently.
Yeah, I think that is a good way, although I would fall back on info-year
and prefer info-date, if present (it is presumably more detailed). The
order could also be custom preference.

In any case, it might be preferable to move this to a separate function
‘emms-get-year’, say, and call that. It might look cleaner.

Thank Pierre and Yoni!

Rasmus
--
You people at the NSA are becoming my new best friends!
Pierre Neidhardt
2017-11-27 08:32:52 UTC
Permalink
I've commited the change to master. Let me know if that works for you.
Post by Pierre Neidhardt
Post by Pierre Neidhardt
Post by Yoni Rabkin
Unfortunately, there is no easy way to do this.
What about
("y" . ,(or (emms-track-get 'info-year) (emms-GET-YEAR-FROM-DATE
(emms-track-get track 'info-date)))
Post by Pierre Neidhardt
Where the upcase function might have to be implemented, although I got
one on this mailing list recently.
Yeah, I think that is a good way, although I would fall back on info-year
and prefer info-date, if present (it is presumably more detailed). The
order could also be custom preference.
In any case, it might be preferable to move this to a separate function
‘emms-get-year’, say, and call that. It might look cleaner.
Thank Pierre and Yoni!
Rasmus
--
You people at the NSA are becoming my new best friends!
Petteri Hintsanen
2017-11-07 08:35:27 UTC
Permalink
Post by Pierre Neidhardt
Do we actually need both fields? Looks like only info-date would be useful.
I think we do, because there are probably massive amounts of old MP3s
lying around which have only ancient ID3v1 tags with 4-digit YEAR tags.
WMAs maybe as well. Some EMMS info tag functions may convert these to
info-dates instead of info-years, but not necessarily all. I'd
personally opt to keep all tag information as-is, and only transform
information on the browser interface (in elisp).

For instance, I have DATE tags mostly because I have run almost all of
my stuff through Picard (MusicBrainz). That gives "proper" dates,
albeit in some cases dates are YYYY, sometimes YYYY-MM, sometimes
YYYY-MM-DD. Before Picard I had mostly YEARs, at least for MP3s.

Then there is the separation between "release date" and "original date".
This difference matters eg. for re-releases (anniversaries and such),
where the release date is usually much more recent than the original
release date. In such cases you probably want to show the original
release date. The date accessing code ought to figure that, and also
consider that there can be info-date, info-originaldate, info-year and
info-originalyear.
Post by Pierre Neidhardt
Is there any generic way to always derive the track year from both
'info-date and 'info-year?
Not implemented at the moment, as far as I know. But I think that such
implementation should consider the above points.

regards,
Petteri
Loading...