[sound-juicer] Sanitize disc number if required



commit 28f0cc5814a8630c2eca51c0b655f0bcc9260dde
Author: Phillip Wood <phillip wood dunelm org uk>
Date:   Wed Aug 22 12:06:29 2012 +0100

    Sanitize disc number if required
    
    When the file name is set to 'Disc d - t ...' it should be sanitized
    in case the user has requested the removal of spaces from the file
    name.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=661646

 src/sj-extracting.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
---
diff --git a/src/sj-extracting.c b/src/sj-extracting.c
index 77871d5..820e35c 100644
--- a/src/sj-extracting.c
+++ b/src/sj-extracting.c
@@ -1160,7 +1160,9 @@ filepath_parse_pattern (const char* pattern, const TrackDetails *track)
       case 'n':
         /* Disc and track number */
         if (track->album->disc_number > 0) {
-          string = g_strdup_printf ("Disc %d - %d", track->album->disc_number, track->number);
+          char *s = g_strdup_printf ("Disc %d - %d", track->album->disc_number, track->number);
+          string = sanitize_path (s, filesystem_type); /* strip spaces if required */
+          g_free (s);
         } else {
           string = g_strdup_printf ("%d", track->number);
         }



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