banshee r4302 - in trunk/banshee: . src/Core/Banshee.Core/Banshee.Base src/Core/Banshee.Core/Banshee.Collection src/Core/Banshee.Core/Banshee.Configuration.Schema



Author: blorentz
Date: Wed Jul 30 20:14:03 2008
New Revision: 4302
URL: http://svn.gnome.org/viewvc/banshee?rev=4302&view=rev

Log:
2008-07-30  Bertrand Lorentz  <bertrand lorentz gmail com>

	* src/Core/Banshee.Core/Banshee.Collection/TrackInfo.cs:
	* src/Core/Banshee.Core/Banshee.Collection/ITrackInfo.cs:
	* src/Core/Banshee.Core/Banshee.Configuration.Schema/LibrarySchema.cs:
	* src/Core/Banshee.Core/Banshee.Base/FileNamePattern.cs: Patch from 
	Brian Teague adding the genre option to the file name pattern 
	construction (BGO #492181).



Modified:
   trunk/banshee/ChangeLog
   trunk/banshee/src/Core/Banshee.Core/Banshee.Base/FileNamePattern.cs
   trunk/banshee/src/Core/Banshee.Core/Banshee.Collection/ITrackInfo.cs
   trunk/banshee/src/Core/Banshee.Core/Banshee.Collection/TrackInfo.cs
   trunk/banshee/src/Core/Banshee.Core/Banshee.Configuration.Schema/LibrarySchema.cs

Modified: trunk/banshee/src/Core/Banshee.Core/Banshee.Base/FileNamePattern.cs
==============================================================================
--- trunk/banshee/src/Core/Banshee.Core/Banshee.Base/FileNamePattern.cs	(original)
+++ trunk/banshee/src/Core/Banshee.Core/Banshee.Base/FileNamePattern.cs	Wed Jul 30 20:14:03 2008
@@ -88,7 +88,12 @@
                 delegate (ITrackInfo t, object r) {
                     return Escape (t == null ? (string)r : t.DisplayArtistName);
             });
-            
+                        
+            AddConversion ("genre", Catalog.GetString ("Genre"),  
+                delegate (ITrackInfo t, object r) {
+                    return Escape (t == null ? (string)r : t.DisplayGenre);
+            });
+
             AddConversion ("album", Catalog.GetString ("Album"),  
                 delegate (ITrackInfo t, object r) {
                     return Escape (t == null ? (string)r : t.DisplayAlbumTitle);

Modified: trunk/banshee/src/Core/Banshee.Core/Banshee.Collection/ITrackInfo.cs
==============================================================================
--- trunk/banshee/src/Core/Banshee.Core/Banshee.Collection/ITrackInfo.cs	(original)
+++ trunk/banshee/src/Core/Banshee.Core/Banshee.Collection/ITrackInfo.cs	Wed Jul 30 20:14:03 2008
@@ -36,6 +36,7 @@
         string DisplayArtistName { get; }
         string DisplayAlbumTitle { get; }
         string DisplayTrackTitle { get; }
+        string DisplayGenre { get; }
         
         int TrackNumber { get; }
         int TrackCount { get; }

Modified: trunk/banshee/src/Core/Banshee.Core/Banshee.Collection/TrackInfo.cs
==============================================================================
--- trunk/banshee/src/Core/Banshee.Core/Banshee.Collection/TrackInfo.cs	(original)
+++ trunk/banshee/src/Core/Banshee.Core/Banshee.Collection/TrackInfo.cs	Wed Jul 30 20:14:03 2008
@@ -208,6 +208,16 @@
                     : title; 
             } 
         }     
+
+        public string DisplayGenre { 
+            get { 
+                string genre = Genre == null ? null : Genre.Trim ();
+                return String.IsNullOrEmpty (genre) 
+                    ? Catalog.GetString ("Unknown Genre") 
+                    : genre; 
+            } 
+        }     
+        
         
         public virtual string ArtworkId { 
             get { return CoverArtSpec.CreateArtistAlbumId (AlbumArtist, AlbumTitle); }

Modified: trunk/banshee/src/Core/Banshee.Core/Banshee.Configuration.Schema/LibrarySchema.cs
==============================================================================
--- trunk/banshee/src/Core/Banshee.Core/Banshee.Configuration.Schema/LibrarySchema.cs	(original)
+++ trunk/banshee/src/Core/Banshee.Core/Banshee.Configuration.Schema/LibrarySchema.cs	Wed Jul 30 20:14:03 2008
@@ -46,8 +46,9 @@
             "Library Folder Pattern",
             "Format for creating a track folder inside the library. Do not create an absolute path. " +
                 "Location here is relative to the Banshee music directory. See LibraryLocation. Legal tokens: " +
-                "%artist%, %album%, %title%, %track_number%, %track_count%, %track_number_nz% (No prefixed zero), " + 
-                "%track_count_nz% (No prefixed zero), %path_sep% (portable directory separator (/))."
+                "%artist%, %album%, %genre%, %title%, %track_number%, %track_count%, " +
+                "%track_number_nz% (No prefixed zero), %track_count_nz% (No prefixed zero), " +
+                "%path_sep% (portable directory separator (/))."
         );
 
         public static readonly SchemaEntry<string> FilePattern = new SchemaEntry<string>(
@@ -55,8 +56,8 @@
             Banshee.Base.FileNamePattern.DefaultFile,
             "Library File Pattern",
             "Format for creating a track filename inside the library. Do not use path tokens/characters here. " +
-                "See LibraryFolderPattern. Legal tokens: %artist%, %album%, %title%, %track_number%, %track_count%, " +
-                "%track_number_nz% (No prefixed zero), %track_count_nz% (No prefixed zero)."
+                "See LibraryFolderPattern. Legal tokens: %artist%, %album%, %genre%, %title%, %track_number%, " +
+                "%track_count%, %track_number_nz% (No prefixed zero), %track_count_nz% (No prefixed zero)."
         );
 
         public static readonly SchemaEntry<int> SortColumn = new SchemaEntry<int>(



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