Bug 225743 - Filenames design selector not find the right file name pattern
Summary: Filenames design selector not find the right file name pattern
Status: RESOLVED FIXED
Alias: None
Product: amarok
Classification: Applications
Component: Metadata Editing and Reading (show other bugs)
Version: 2.3.0
Platform: Ubuntu Linux
: NOR normal
Target Milestone: ---
Assignee: Amarok Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-02-06 17:56 UTC by Javier G.
Modified: 2010-05-29 20:42 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In: 2.3.2


Attachments
Visual example (because I don't know how is spelled in english that menu) (56.30 KB, image/png)
2010-02-06 17:57 UTC, Javier G.
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Javier G. 2010-02-06 17:56:38 UTC
Version:            (using KDE 4.3.5)
OS:                Linux
Installed from:    Ubuntu Packages

I have a file called "03.Moloko - Sing It back.mp3" and I tried to use the pattern "%ignore.%artist - %title" or "%track.%artist - %title" to detect the right ID3 tags from the file name but unfortunally it only detect the title "Sing It back" .

Is possible that that dot isn't work correctly (I checked if was the "03" track or "3" but does the same).
Comment 1 Javier G. 2010-02-06 17:57:41 UTC
Created attachment 40571 [details]
Visual example (because I don't know how is spelled in english that menu)
Comment 2 Myriam Schweingruber 2010-02-06 20:14:03 UTC
This is the Filename Layout Chooser. Try adding a space after the dot, that works for me.
Which exact Amarok version is this?
Comment 3 Javier G. 2010-02-06 20:32:38 UTC
Oh I forgot the typical info for bug reports, sorry :S

Amarok v2.2.2
Comment 4 Myriam Schweingruber 2010-02-06 20:42:18 UTC
Thank you for your feedback. Confirmed on 2.2.3-git, it only works with a space after the dot
Comment 5 Casey Link 2010-05-29 19:21:02 UTC
Which dot exactly do you put s space after?

Rather, what is the exact format that works?
Comment 6 Casey Link 2010-05-29 20:34:13 UTC
commit dcb764356ffd136c012fd4859c1689b75c1d65db
Author: Casey Link <unnamedrambler@gmail.com>
Date:   Sat May 29 13:28:35 2010 -0500

    Escape all special regex characters in the schema of a filename before
    parsing it. Before, if a user had a special regex char in their filename
    it would be interpreted in the regex pattern as a special char.
    
    BUG: 225743

diff --git a/ChangeLog b/ChangeLog
index 9b6ac49..0a43a33 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -25,6 +25,8 @@ VERSION 2.3.2-Beta 1
       Patch by Richard Longland <rlongland@hotmail.com>.
 
   BUGFIXES:
+    * Filenames with dots (.) and other special RegEx characters will now be
+      parsed correctly when guessing tags from a filename. (BR 225743)
     * Align track details dialog's labels to the right as per KDE4's HIG.
       (BR 234555)
     * The last.fm service will now only open the wallet on startup if the user
diff --git a/src/dialogs/TagGuesser.cpp b/src/dialogs/TagGuesser.cpp
index 6008b5d..bd3820d 100644
--- a/src/dialogs/TagGuesser.cpp
+++ b/src/dialogs/TagGuesser.cpp
@@ -74,7 +74,7 @@ TagGuesser::guess()
 {
     if( ( !m_fileName.isEmpty() ) && ( !m_schema.isEmpty() ) )
     {
-        QString regExpr = getRegExpFromSchema( m_schema );
+        QString regExpr = getRegExpFromSchema( QRegExp::escape( m_schema ) );
         QRegExp fileExpr(regExpr + "\\.(.*)");
         QRegExp schemaExpr(regExpr);