Skip to content

Commit f22c513

Browse files
authored
Merge pull request #49 from oblivioncth/bugfix/lb_data_filenames
Fix filenames changing when running LB after import
2 parents e90f475 + 8f0baab commit f22c513

File tree

1 file changed

+18
-5
lines changed

1 file changed

+18
-5
lines changed

app/src/frontend/launchbox/lb-install.cpp

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -306,13 +306,26 @@ QString Install::translateDocName(const QString& originalName, Fe::DataDoc::Type
306306
{
307307
Q_UNUSED(type);
308308

309-
// Perform general kosherization
310-
QString translatedName = Qx::kosherizeFileName(originalName);
311-
312-
// LB specific changes
309+
/* LB has started doing something strange and annoying...
310+
* It appears it might be that it tries to override the filename of playlists with the
311+
* internal name (i.e. <Name> within the file), and then applies its own substitution
312+
* rules to deal with illegal characters. As such, here we try to do what LB does to avoid
313+
* unintended filename changes after an import (since that will lead to mismatches for
314+
* icons and futurer imports).
315+
*
316+
* The replacements needed, and the order of them, will need to be determined on a case-by-case
317+
* basis as they come up.
318+
*/
319+
320+
QString translatedName = originalName;
321+
322+
// LB matched changes (LB might replace all illegal characters with underscores, but these are is known for sure)
323+
translatedName.replace(':','_');
313324
translatedName.replace('#','_');
314325
translatedName.replace('\'','_');
315-
translatedName.replace('-','_');
326+
327+
// General kosherization
328+
translatedName = Qx::kosherizeFileName(translatedName);
316329

317330
return translatedName;
318331
}

0 commit comments

Comments
 (0)