Browse Source

UI: Translate to current OS for all colection imports

Importers are written to convert third-party collection formats to a
Windows OBS scene collection. The Studio importer is capable of
translating scene collections to the correct types for the current
operating system. This change makes it so all imports will be ran
through the Studio translation, not just Studio and SL collections.
VodBox 4 years ago
parent
commit
19ced32c58
3 changed files with 13 additions and 0 deletions
  1. 5 0
      UI/importers/classic.cpp
  2. 3 0
      UI/importers/sl.cpp
  3. 5 0
      UI/importers/xsplit.cpp

+ 5 - 0
UI/importers/classic.cpp

@@ -530,6 +530,11 @@ int ClassicImporter::ImportScenes(const string &path, string &name, Json &res)
 	Json sc = data;
 	translate_sc(sc, res);
 
+	QDir dir(path.c_str());
+
+	TranslateOSStudio(res);
+	TranslatePaths(res, QDir::cleanPath(dir.filePath("..")).toStdString());
+
 	return IMPORTER_SUCCESS;
 }
 

+ 3 - 0
UI/importers/sl.cpp

@@ -439,7 +439,10 @@ int SLImporter::ImportScenes(const string &path, string &name, Json &res)
 		}
 	}
 
+	QDir dir(path.c_str());
+
 	TranslateOSStudio(res);
+	TranslatePaths(res, QDir::cleanPath(dir.filePath("..")).toStdString());
 
 	return result;
 }

+ 5 - 0
UI/importers/xsplit.cpp

@@ -477,6 +477,11 @@ int XSplitImporter::ImportScenes(const string &path, string &name,
 
 	res = r;
 
+	QDir dir(path.c_str());
+
+	TranslateOSStudio(res);
+	TranslatePaths(res, QDir::cleanPath(dir.filePath("..")).toStdString());
+
 	return IMPORTER_SUCCESS;
 }