[rhythmbox] library: add more substitution variables to the file pattern code



commit b50e62b40d5f9f54cafbf0438cb3d1b330fe74c3
Author: Jonathan Matthew <jonathan d14n org>
Date:   Thu Feb 25 09:25:21 2010 +1000

    library: add more substitution variables to the file pattern code

 sources/rb-library-source.c |   20 ++++++++++++++++++++
 1 files changed, 20 insertions(+), 0 deletions(-)
---
diff --git a/sources/rb-library-source.c b/sources/rb-library-source.c
index 3a90fb2..d999bca 100644
--- a/sources/rb-library-source.c
+++ b/sources/rb-library-source.c
@@ -833,6 +833,11 @@ sanitize_pattern (const char *pat)
  * %aA -- album artist (lowercase)
  * %as -- album artist sortname
  * %aS -- album artist sortname (lowercase)
+ * %aY -- album release year
+ * %an -- album disc number
+ * %aN -- album disc number, zero padded
+ * %ag -- album genre
+ * %aG -- album genre (lowercase)
  * %tn -- track number (i.e 8)
  * %tN -- track number, zero padded (i.e 08)
  * %tt -- track title
@@ -913,6 +918,21 @@ filepath_parse_pattern (RhythmDB *db,
 				string = sanitize_path (t);
 				g_free (t);
 				break;
+			case 'y':
+				string = g_strdup_printf ("%u", (guint)rhythmdb_entry_get_ulong (entry, RHYTHMDB_PROP_YEAR));
+				break;
+			case 'n':
+				string = g_strdup_printf ("%u", (guint)rhythmdb_entry_get_ulong (entry, RHYTHMDB_PROP_DISC_NUMBER));
+				break;
+			case 'N':
+				string = g_strdup_printf ("%02u", (guint)rhythmdb_entry_get_ulong (entry, RHYTHMDB_PROP_DISC_NUMBER));
+				break;
+			case 'g':
+				string = sanitize_path (rhythmdb_entry_get_string (entry, RHYTHMDB_PROP_GENRE));
+				break;
+			case 'G':
+				string = sanitize_path (rhythmdb_entry_get_string (entry, RHYTHMDB_PROP_GENRE_FOLDED));
+				break;
 			default:
 				string = g_strdup_printf ("%%a%c", *p);
 			}



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