banshee r4659 - in trunk/banshee: . src/Extensions/Banshee.Lastfm/Banshee.Lastfm.Radio



Author: gburt
Date: Mon Oct  6 18:36:19 2008
New Revision: 4659
URL: http://svn.gnome.org/viewvc/banshee?rev=4659&view=rev

Log:
2008-10-06  Gabriel Burt  <gabriel burt gmail com>

	* src/Extensions/Banshee.Lastfm/Banshee.Lastfm.Radio/StationType.cs:
	Support for creating a station in the station dialog from a lastfm:// URL,
	based on a patch from Russ Smith, slightly modified by myself (BGO
	#554724).



Modified:
   trunk/banshee/ChangeLog
   trunk/banshee/src/Extensions/Banshee.Lastfm/Banshee.Lastfm.Radio/StationType.cs

Modified: trunk/banshee/src/Extensions/Banshee.Lastfm/Banshee.Lastfm.Radio/StationType.cs
==============================================================================
--- trunk/banshee/src/Extensions/Banshee.Lastfm/Banshee.Lastfm.Radio/StationType.cs	(original)
+++ trunk/banshee/src/Extensions/Banshee.Lastfm/Banshee.Lastfm.Radio/StationType.cs	Mon Oct  6 18:36:19 2008
@@ -52,7 +52,8 @@
 
         public string GetStationFor (string arg)
         {
-            return "lastfm://" + String.Format (station_format, arg);
+            string url = String.Format (station_format, arg);
+            return url.StartsWith ("lastfm://") ? url : "lastfm://" + url;
         }
 
         public override string ToString ()
@@ -150,8 +151,17 @@
             false
         );
 
+        public static StationType LastfmUrl = new StationType (
+            "LastfmUrl",
+            Catalog.GetString ("lastfm:// URL"),
+            Catalog.GetString ("lastfm://"),
+            "{0}",
+            "lastfm-personal",
+            false
+        );
+
         public static StationType [] Types = new StationType [] {
-            Recommended, Personal, Loved, Neighbor, Group, Tag, Fan, Similar
+            Recommended, Personal, Loved, Neighbor, Group, Tag, Fan, Similar, LastfmUrl
         };
     }
 }



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