Matthew Kennedy <[EMAIL PROTECTED]> writes:
> Natural track order is the order in which you were meant to hear the
> tracks on a CD. This means sort by album name *and then* by track
> number.
Nifty idea !
> Here's what I implemented to achieve a natural order sort. It might
> be nice to include something like it in Emms though...
Thanks. I've added this to `emms-playlist-sort.el' and sent the
patch. Next time you may send a patch directly to forcer or
[EMAIL PROTECTED]
> (defun emms-sort-natural-order-less-p (a b)
> "Sort two tracks by natural order.
> This is the order in which albums where intended to be played.
> ie. by album name and then by track number."
> (or (emms-string> (emms-track-get a 'info-album)
> (emms-track-get b 'info-album))
> (and (string= (emms-track-get a 'info-album)
> (emms-track-get b 'info-album))
> (< (string-to-number (emms-track-get a 'info-tracknumber))
> (string-to-number (emms-track-get b 'info-tracknumber))))))
Here, an error will occur in `string-to-number' when `emms-track-get'
returns nil. I've modified it to,
(< (string-to-number (or (emms-track-get a 'info-tracknumber)
"0"))
(string-to-number (or (emms-track-get b 'info-tracknumber)
"0"))))))
--
William
_______________________________________________
Emms-help mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/emms-help