From 1ea46185e2a5e42a303ca37f6854451cd8f3fe50 Mon Sep 17 00:00:00 2001 From: Christian Weiske Date: Thu, 6 Jul 2017 14:16:17 +0200 Subject: [PATCH] --- 0-patch.diff | 42 ++++++++++++++++++++++++++++++++++++++++++ 1-command.sh | 1 + 2-output.txt | 22 ++++++++++++++++++++++ 3 files changed, 65 insertions(+) create mode 100644 0-patch.diff create mode 100644 1-command.sh create mode 100644 2-output.txt diff --git a/0-patch.diff b/0-patch.diff new file mode 100644 index 0000000..92cd9ff --- /dev/null +++ b/0-patch.diff @@ -0,0 +1,42 @@ +diff --git plugins/lyrics/lyrics.py plugins/lyrics/lyrics.py +index 13124b3..6bff657 100644 +--- plugins/lyrics/lyrics.py ++++ plugins/lyrics/lyrics.py +@@ -32,6 +32,7 @@ import urllib.request + import rb + from gi.repository import Gtk, Gio, GObject, Peas + from gi.repository import RB ++from gi.repository import Gst, GstPbutils + + import LyricsParse + from LyricsConfigureDialog import LyricsConfigureDialog +@@ -146,6 +147,29 @@ class LyricGrabber(object): + def search_lyrics(self, callback, cache_only=False): + self.callback = callback + ++ #location = self.entry.get_string(RB.RhythmDBPropType.MOUNTPOINT) ++ location = self.entry.get_playback_uri() ++ print("discovering %s" % location) ++ self.discoverer = GstPbutils.Discoverer(timeout=Gst.SECOND*1) ++ info = self.discoverer.discover_uri(location) ++ tags = info.get_tags() ++ print("abc") ++ if tags is not None: ++ def fetags (list, tag): ++ print("tag: %s" % tag) ++ tags.foreach(fetags) ++ (found, text) = tags.get_string_index('lyrics', 0) ++ (found, text) = tags.get_string_index('extended-comment', 0) ++ if found: ++ print("found lyrics tag:\n%s" % text) ++ self.callback(text) ++ return ++ else: ++ print("no lyrics tag found") ++ else: ++ print("no tags found") ++ ++ print("abc") + status = self.verify_lyric() + + if status: diff --git a/1-command.sh b/1-command.sh new file mode 100644 index 0000000..fe33ecb --- /dev/null +++ b/1-command.sh @@ -0,0 +1 @@ + ./shell/rhythmbox --debug-match lyrics filename.ogg \ No newline at end of file diff --git a/2-output.txt b/2-output.txt new file mode 100644 index 0000000..6649822 --- /dev/null +++ b/2-output.txt @@ -0,0 +1,22 @@ +(14:13:55) [0x1c7bb20] [LyricGrabber.search_lyrics] /home/cweiske/php/rhythmbox/rhythmbox/data/../plugins/lyrics/lyrics.py:299: discovering file:///home/cweiske/Musik/neu/Britney%20Spears/Femme%20Fatale/Britney%20Spears%20-%20Femme%20Fatale%20-%2003%20-%20Inside%20Out.ogg +(14:13:55) [0x1c7bb20] [LyricGrabber.search_lyrics] /home/cweiske/php/rhythmbox/rhythmbox/data/../plugins/lyrics/lyrics.py:303: abc +(14:13:55) [0x1c7bb20] [fetags] /home/cweiske/php/rhythmbox/rhythmbox/data/../plugins/lyrics/lyrics.py:317: tag: title +(14:13:55) [0x1c7bb20] [fetags] /home/cweiske/php/rhythmbox/rhythmbox/data/../plugins/lyrics/lyrics.py:317: tag: artist +(14:13:55) [0x1c7bb20] [fetags] /home/cweiske/php/rhythmbox/rhythmbox/data/../plugins/lyrics/lyrics.py:317: tag: album +(14:13:55) [0x1c7bb20] [fetags] /home/cweiske/php/rhythmbox/rhythmbox/data/../plugins/lyrics/lyrics.py:317: tag: datetime +(14:13:55) [0x1c7bb20] [fetags] /home/cweiske/php/rhythmbox/rhythmbox/data/../plugins/lyrics/lyrics.py:317: tag: track-number +(14:13:55) [0x1c7bb20] [fetags] /home/cweiske/php/rhythmbox/rhythmbox/data/../plugins/lyrics/lyrics.py:317: tag: track-count +(14:13:55) [0x1c7bb20] [fetags] /home/cweiske/php/rhythmbox/rhythmbox/data/../plugins/lyrics/lyrics.py:317: tag: genre +(14:13:55) [0x1c7bb20] [fetags] /home/cweiske/php/rhythmbox/rhythmbox/data/../plugins/lyrics/lyrics.py:317: tag: image +(14:13:55) [0x1c7bb20] [fetags] /home/cweiske/php/rhythmbox/rhythmbox/data/../plugins/lyrics/lyrics.py:317: tag: extended-comment +(14:13:55) [0x1c7bb20] [fetags] /home/cweiske/php/rhythmbox/rhythmbox/data/../plugins/lyrics/lyrics.py:317: tag: encoder +(14:13:55) [0x1c7bb20] [fetags] /home/cweiske/php/rhythmbox/rhythmbox/data/../plugins/lyrics/lyrics.py:317: tag: encoder-version +(14:13:55) [0x1c7bb20] [fetags] /home/cweiske/php/rhythmbox/rhythmbox/data/../plugins/lyrics/lyrics.py:317: tag: audio-codec +(14:13:55) [0x1c7bb20] [fetags] /home/cweiske/php/rhythmbox/rhythmbox/data/../plugins/lyrics/lyrics.py:317: tag: nominal-bitrate +(14:13:55) [0x1c7bb20] [fetags] /home/cweiske/php/rhythmbox/rhythmbox/data/../plugins/lyrics/lyrics.py:317: tag: bitrate +(14:13:55) [0x1c7bb20] [fetags] /home/cweiske/php/rhythmbox/rhythmbox/data/../plugins/lyrics/lyrics.py:317: tag: container-format +(14:13:55) [0x1c7bb20] [LyricGrabber.search_lyrics] /home/cweiske/php/rhythmbox/rhythmbox/data/../plugins/lyrics/lyrics.py:311: found lyrics tag: +LYRICS=Said you're gonna be here in a minute +Sitting in the mirror getting pretty +Gotta look my best if we're gonna break up +Gotta look my best if we're gonna break up -- 2.30.2