[banshee] [RadioTrackInfo] Parse metadata from file opened through "Open Location"



commit 1373c3754264816b0467a50b542d9381e1e94820
Author: Haitao Feng <haitao feng gmail com>
Date:   Tue Sep 22 21:06:52 2009 +0200

    [RadioTrackInfo] Parse metadata from file opened through "Open Location"
    
    This allows video file to be recognized, so that they get played in the
    Now Playing source and not in a new window. Fixes BGO#595560.
    
    Signed-off-by: Bertrand Lorentz <bertrand lorentz gmail com>

 .../Banshee.Streaming/RadioTrackInfo.cs            |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)
---
diff --git a/src/Core/Banshee.Services/Banshee.Streaming/RadioTrackInfo.cs b/src/Core/Banshee.Services/Banshee.Streaming/RadioTrackInfo.cs
index eec760f..eac60b4 100644
--- a/src/Core/Banshee.Services/Banshee.Streaming/RadioTrackInfo.cs
+++ b/src/Core/Banshee.Services/Banshee.Streaming/RadioTrackInfo.cs
@@ -213,6 +213,15 @@ namespace Banshee.Streaming
                 if(stream_uris.Count > 0) {
                     Uri = stream_uris[stream_index];
                     Log.Debug("Playing Radio Stream", Uri.AbsoluteUri);
+                    if (Uri.IsFile) {
+                        try {
+                            TagLib.File file = StreamTagger.ProcessUri (Uri);
+                            StreamTagger.TrackInfoMerge (this, file, true);
+                        } catch (Exception e) {
+                            Log.Warning (String.Format ("Failed to update metadata for {0}", this),
+                                e.GetType ().ToString (), false);
+                        }
+                    }
                     ServiceManager.PlayerEngine.OpenPlay(this);
                 }
             }



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]