title
Products            Buy            Support Forum            Professional            About            Codec Central
 

Trim filename and path to x number chars

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • moley6knipe
    dBpoweramp Enthusiast

    • May 2008
    • 97

    Trim filename and path to x number chars

    Been having some problems with dBpoweramp reference 13 ripping long filenames and paths in Apple Lossless.

    Win XP Pro SP2
    dBpoweramp reference 13 registered
    Multi-encoding to...
    Apple Lossless R8 codec
    Lame 3.97 codec

    For example, if my intended ripping path/filename is...

    C:\Documents and Settings\Colin Wheatley\My Documents\My Music\iTunes\SqueezeCenter and AppleTV Library\iTunes Music\+DBPOWERAMP RIPS+\Rod Stewart\Reason To Believe; The Complete Mercury Studio Recordings [Disc 01]17-You're My Girl (I Don't Want To Discuss It).m4a

    ...then the resulting file is in a directory called...

    ...Reason To Believe; The Complete Mercury Studio Recordings [Disc 0\17-You're My Girl (I Don't Want To Discuss It).m4a

    ...and the file is invalid. Oddly the mirror directory structure of mp3s is fine...

    C:\Documents and Settings\Colin Wheatley\My Documents\My Music\iTunes\iPod Library\iTunes Music\Rod Stewart\Reason to Believe; The Complete Mercury Studio Recordings [Disc 01]\17-You're My Girl (I Don't Want to Discuss It).mp3

    ...is a valid file. But I guess that's a marginally shorter path.

    so, please can I request an option to trim filenames/paths to x number of characters, preferably with the option of where to lose the characters, ie from alubm name or filename.

    Thanks!!
  • moley6knipe
    dBpoweramp Enthusiast

    • May 2008
    • 97

    #2
    Re: Trim filename and path to x number chars

    I should add that I've reorganised my ridiculous file path so I've shaved a 101 characters off the full filename and path!

    So I've got a workaround, but the above took me ages to suss out what was going wrong!

    Comment

    • Spoon
      Administrator
      • Apr 2002
      • 44583

      #3
      Re: Trim filename and path to x number chars

      I will look at it for r13.1
      Spoon
      www.dbpoweramp.com

      Comment

      • EliC
        dBpoweramp Guru

        • May 2004
        • 1175

        #4
        Re: Trim filename and path to x number chars

        The best way to do this would be:

        [MAXCHAR]count,string[] <<-- Not a real command, dont use

        You could then specify in a nested manner how many to allow for each part

        [MAXCHAR]20,[ALBUM][]

        so

        Reason To Believe; The Complete Mercury Studio Recordings

        becomes

        Reason To Believe; T

        Comment

        • EliC
          dBpoweramp Guru

          • May 2004
          • 1175

          #5
          Re: Trim filename and path to x number chars

          Couldn you use the SETLEN command?

          [SETLEN]count,pre,post,string[]

          [SETLEN]20,,,[ALBUM][]

          Comment

          • Teknojnky
            dBpoweramp Guru

            • Dec 2006
            • 323

            #6
            Re: Trim filename and path to x number chars

            the windows documents & settings folder causes alot of problems with long path/filenames.

            Best to have a short \music or similar root folder to shave a ton of useless characters from the path.

            Comment

            • EliC
              dBpoweramp Guru

              • May 2004
              • 1175

              #7
              Re: Trim filename and path to x number chars

              yeah, you will get the best bang for your buck by changing

              Documents and Settings\Colin Wheatley\My Documents\My Music\iTunes\SqueezeCenter and AppleTV Library\iTunes Music\+DBPOWERAMP RIPS+\

              to

              Music\

              Comment

              • moley6knipe
                dBpoweramp Enthusiast

                • May 2008
                • 97

                #8
                Re: Trim filename and path to x number chars

                Yeah, thanks folks, done exactly that! I've always put music in a folder on the root before, but started ripping before I'd thought about it when I bought my latest PC!

                I have indeed since discovered setlen, which works nicely (I truncate filename to 30 characters). A global setting might be nice though - perhaps something that could restrict all folders/filenames past a certain point in the folder path to x characters each, or x characters shared between the remaining filepath?

                As an aside, I rip to Apple Lossless using ref 13. When I used to rip to Apple Lossless using iTunes, it would create the filenames with 36 characters being the maximum it would use.

                And as a Squeezebox user, I know there's a problem with SqueezeCenter not being able to play AAC or ALAC files whose filename is above 63 characters; I think it's a limitation of QuickTime on a Windows machine, which is what SqueezeCenter calls on to transcode these formats.

                Just a couple fo points in case they're of use! Cheers for the pointers folks!

                Comment

                • Spoon
                  Administrator
                  • Apr 2002
                  • 44583

                  #9
                  Re: Trim filename and path to x number chars

                  It was multi encoder which needed recompiling with our latest code, now fixed:

                  Changes: Updated to latest R13 naming conventions. Also corrections to naming which will now correctly limit the filename length. Bug Fix: Could not type a directory name longer than the visible output to folder. Download: &lt;Now Released&gt;
                  Spoon
                  www.dbpoweramp.com

                  Comment

                  • moley6knipe
                    dBpoweramp Enthusiast

                    • May 2008
                    • 97

                    #10
                    Re: Trim filename and path to x number chars

                    Great, thanks! Nice work fixing the "can't type more than visible" in filepath bug, been meaning to post about that!

                    Comment

                    • dvdr
                      dBpoweramp Enthusiast

                      • Sep 2008
                      • 235

                      #11
                      Re: Trim filename and path to x number chars

                      Hi

                      I just don't get this to work. I am using the default value plus the SETLEN command as described here - but whatever I do, the filename ALWAYS is extended to 180 characters! I would love to limit it, in case it should be longer, but if it's shorter, than not extend it...

                      Here's what I have been using:

                      [IFCOMP][IFVALUE]album artist,[album artist],Various Artists[]\[album][IFMULTI] Disc [disc][]\[SETLEN]180,,,[track] - [artist] - [title][][][IF!COMP][IFVALUE]album artist,[album artist],[artist][]\[album]\[SETLEN]180,,,[artist] - [album][IFMULTI] Disc [disc][] - [track] - [title][][]

                      Am I missing anything? Any error in the code? All plugins are updated to the latest version, also the multiencoder, in case it would interfere (you rewrote some code, as I read)

                      Thanks for helping.

                      Comment

                      • Spoon
                        Administrator
                        • Apr 2002
                        • 44583

                        #12
                        Re: Trim filename and path to x number chars

                        Try R13.1 and use the new (not in multi encoder):

                        [maxlength]180,xxxxxxxxxx[]
                        Spoon
                        www.dbpoweramp.com

                        Comment

                        • jason_s

                          • Oct 2007
                          • 3

                          #13
                          Re: Trim filename and path to x number chars

                          Does the new [maxlength] option work with Arrange Audio through Batch Converter in 13.1?

                          Not having any luck so far...

                          Comment

                          • Spoon
                            Administrator
                            • Apr 2002
                            • 44583

                            #14
                            Re: Trim filename and path to x number chars

                            No it would not.
                            Spoon
                            www.dbpoweramp.com

                            Comment

                            • dvdr
                              dBpoweramp Enthusiast

                              • Sep 2008
                              • 235

                              #15
                              Re: Trim filename and path to x number chars

                              Hi
                              After experimenting with the trial, I bought dBpoweramp (the trial absolutely convinced me!) and am currently running 13.1
                              Where would I set the proper command to limit my character-count to let's say 180 in the following naming-scheme:

                              [IFEQUALS]genre,Classical,[IFCOMP]Compilations\[album][IFVALUE]album artist,\[album artist]\,[]\[IFMULTI]Disc [disc] - [][track] - [title] ([composer] - [artist])[][IF!COMP][composer]\[album] ([year])\[IFVALUE]album artist,[album artist],[artist][]\[IFMULTI] Disc [disc] - [][track] - [title] ([album] ([composer]) - [artist])[][][IF!EQUALS]genre,Classical,[IFCOMP]Compilations\[album][IFVALUE]album artist,\[album artist]\,[]\[IFMULTI] Disc [disc] - [][track] - [artist] - [title][][IF!COMP][IFVALUE]album artist,[album artist],[artist][]\[album]\[IFMULTI] Disc [disc] - [][track] - [title]([artist] - [album])[][]

                              Thanks for helping!

                              Comment

                              Working...

                              ]]>