The real problem is that this external library doesn't even try to retain file extensions.
Either that library should attempt to maintain the extension or godeez could call Filenamify() with 255 - (len(extension) + 1) and then add it afterwards to guarantee it's there.
'10. Grateful Dead - Not Fade Away, Pt. 2 (Live at the Capitol Theatre, Port Chester, NY, 2!18!71).flac'
becomes
'10. Grateful Dead - Not Fade Away, Pt. 2 (Live at the Capitol Theatre, Port Chester, NY, 2!18!71).fl'
'5. Grateful Dead - Greatest Story Ever Told (Live at the Capitol Theatre, Port Chester, NY, 2!18!71).flac'
becomes
'5. Grateful Dead - Greatest Story Ever Told (Live at the Capitol Theatre, Port Chester, NY, 2!18!71)'
'8. Grateful Dead - Not Fade Away, Pt. 1 (Live at the Capitol Theatre, Port Chester, NY, 2!18!71).flac'
becomes
'8. Grateful Dead - Not Fade Away, Pt. 1 (Live at the Capitol Theatre, Port Chester, NY, 2!18!71).fla'
'9. Grateful Dead - Goin' Down The Road Feeling Bad (Live at the Capitol Theatre, Port Chester, NY, 2!18!71).flac'
becomes
'9. Grateful Dead - Goin' Down The Road Feeling Bad (Live at the Capitol Theatre, Port Chester, NY, 2'
The call to
filenamify.Filenamify()is truncating filenames.It defaults to 100 which isn't great.
Quick fix would be to change all 3 instances of
filenamify.Options{}tofilenamify.Options{MaxLength: 255}This seems safe on Windows and Linux after some brief googling.
The real problem is that this external library doesn't even try to retain file extensions.
Either that library should attempt to maintain the extension or
godeezcould callFilenamify()with255 - (len(extension) + 1)and then add it afterwards to guarantee it's there.A proper way on Linux at least there's a subprocess you could call
getconf NAME_MAX /path/to/directorythat would tell you the max length filename allowed in a particular directory.