(no commit message)
[paste/456.git] / 0-patch.diff
index a03ea811030fd9737c4113abcc25c03a73ddd2d0..28db46a5e7a177a0425be73772df2210d4f50003 100644 (file)
@@ -1,5 +1,5 @@
 diff --git a/plugins/lyrics/lyrics.py b/plugins/lyrics/lyrics.py
-index 13124b3..7333f2f 100644
+index 13124b3..6c93944 100644
 --- a/plugins/lyrics/lyrics.py
 +++ b/plugins/lyrics/lyrics.py
 @@ -32,6 +32,7 @@ import urllib.request
@@ -10,7 +10,7 @@ index 13124b3..7333f2f 100644
  
  import LyricsParse
  from LyricsConfigureDialog import LyricsConfigureDialog
-@@ -142,10 +143,39 @@ class LyricGrabber(object):
+@@ -142,10 +143,41 @@ class LyricGrabber(object):
  
        def verify_lyric(self):
                return os.path.exists(self.cache_path)
@@ -20,7 +20,7 @@ index 13124b3..7333f2f 100644
 +              """
 +              Extract lyrics from the file meta data (tags)
 +              Currently supported formats:
-+              - ogg/vorbis files with "LYRICS" tag
++              - ogg/vorbis files with "LYRICS" and "SYNCLYRICS" tag
 +              """
 +              location = self.entry.get_playback_uri()
 +              print("discovering %s" % location)
@@ -30,13 +30,15 @@ index 13124b3..7333f2f 100644
 +              if tags is None:
 +                      return
 +
-+              def fetags (list, tag):
-+                      print("tag: %s" % tag)
-+              tags.foreach(fetags)
 +              for i in range(tags.get_tag_size("extended-comment")):
 +                      (exists, value) = tags.get_string_index("extended-comment", i)
++                      #ogg/vorbis unsynchronized lyrics
 +                      if exists and value.startswith("LYRICS"):
 +                              text = value.replace("LYRICS=", "")
++                              return text
++                      #ogg/vorbis synchronized lyrics
++                      elif exists and value.startswith("SYNCLYRICS"):
++                              text = value.replace("SYNCLYRICS=", "")
 +                              return text
          
        def search_lyrics(self, callback, cache_only=False):