From 2dcaf88e6262c701ab7a8f175a369de0a64b9876 Mon Sep 17 00:00:00 2001 From: William Xu Date: Mon, 5 Mar 2007 05:39:00 +0000 Subject: emms-lyrics.el: Find chinese lyrics based on filename instead of `title' from the tag info. (thus to avoid dealing with different tag info coding systems.) darcs-hash:20070305053910-cfa61-50ac2c72c140ef4e64fa2a85c4b2f8e9a3478238.gz --- emms-lyrics.el | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/emms-lyrics.el b/emms-lyrics.el index 9b126dd..69bd8df 100644 --- a/emms-lyrics.el +++ b/emms-lyrics.el @@ -195,15 +195,18 @@ If we can't find it from local disk, then search it from internet." (find-file lrc) (message "lyric file does not exist, search it from internet...") (let ((title (emms-track-get track 'title)) + (filename (file-name-sans-extension + (file-name-nondirectory name))) (url "")) (unless title - (setq title (file-name-sans-extension - (file-name-nondirectory name)))) + (setq title filename)) (cond ((string-match "\\cc" title) ; chinese lyrics + ;; Since tag info might be encoded using various coding + ;; systems, we'd better fall back on filename. (setq url (format "http://mp3.baidu.com/m?f=ms&rn=10&tn=baidump3lyric&ct=150994944&word=%s&lm=-1" (emms-lyrics-url-quote-plus - (encode-coding-string title 'gb2312))))) + (encode-coding-string filename 'gb2312))))) (t ; english lyrics (setq url (format "http://search.lyrics.astraweb.com/?word=%s" ;;"http://www.lyrics007.com/cgi-bin/s.cgi?q=" -- cgit v1.2.3