|
@@ -49,6 +49,33 @@ QString Paths::dataDir(const QString& file)
|
|
|
return d.filePath(file);
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+QString Paths::plexCommonDataDir(const QString& file)
|
|
|
+{
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+#ifdef Q_OS_MAC
|
|
|
+ QDir d(qgetenv("HOME"));
|
|
|
+ d.cd("Library");
|
|
|
+ d.cd("Application Support");
|
|
|
+#else
|
|
|
+ QDir d = QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation);
|
|
|
+#endif
|
|
|
+
|
|
|
+ if (!d.mkpath(d.absolutePath() + "/" + "Plex"))
|
|
|
+ {
|
|
|
+ QLOG_WARN() << "Failed to create directory:" << d.absolutePath();
|
|
|
+ return QString();
|
|
|
+ }
|
|
|
+
|
|
|
+ d.cd("Plex");
|
|
|
+
|
|
|
+ if (file.isEmpty())
|
|
|
+ return d.absolutePath();
|
|
|
+ return d.filePath(file);
|
|
|
+}
|
|
|
+
|
|
|
|
|
|
QString Paths::cacheDir(const QString& file)
|
|
|
{
|