diff options
author | William Xu <william.xwl@gmail.com> | 2007-03-05 05:39:00 +0000 |
---|---|---|
committer | William Xu <william.xwl@gmail.com> | 2007-03-05 05:39:00 +0000 |
commit | 2dcaf88e6262c701ab7a8f175a369de0a64b9876 (patch) | |
tree | e4895b7f390718c935cf0dacbbd19f7fd329d487 | |
parent | 12bb84d83af7c6974f4d8ed1f3f67d1a3b42e574 (diff) |
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
-rw-r--r-- | emms-lyrics.el | 9 |
1 files 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=" |