- QString path = currentDownloadFolder();
-
- // TODO ensure all chars are filename compatible
- QString basename = video->title();
- basename.replace('(', '[');
- basename.replace(')', ']');
- basename.replace('/', ' ');
- basename.replace('\\', ' ');
- basename.replace('<', ' ');
- basename.replace('>', ' ');
- basename.replace(':', ' ');
- basename.replace('"', ' ');
- basename.replace('|', ' ');
- basename.replace('?', ' ');
- basename.replace('*', ' ');
- basename = basename.simplified();
-
- QString filename = path + "/" + basename + ".mp4";
+ QString basename = DataUtils::stringToFilename(video->getTitle());
+ if (basename.isEmpty()) basename = video->getId();
+
+ QString filename = currentDownloadFolder() + "/" + basename + ".mp4";