mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2025-02-18 04:45:39 +00:00
(Android) Added creation of .nomedia files in the themes and downloaded_media directories
This commit is contained in:
parent
1385b09c39
commit
0af45b03e3
|
@ -895,6 +895,17 @@ std::string MiximageGenerator::getSavePath() const
|
||||||
if (!Utils::FileSystem::exists(path))
|
if (!Utils::FileSystem::exists(path))
|
||||||
Utils::FileSystem::createDirectory(path);
|
Utils::FileSystem::createDirectory(path);
|
||||||
|
|
||||||
|
#if defined(__ANDROID__)
|
||||||
|
if (!Utils::FileSystem::exists(path + ".nomedia")) {
|
||||||
|
LOG(LogInfo) << "Creating \"no media\" file \"" << path + ".nomedia"
|
||||||
|
<< "\"...";
|
||||||
|
Utils::FileSystem::createEmptyFile(path + ".nomedia");
|
||||||
|
if (!Utils::FileSystem::exists(path + ".nomedia")) {
|
||||||
|
LOG(LogWarning) << "Couldn't create file, permission problems?";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
path += mGame->getSystemName() + "/miximages" + subFolders + "/";
|
path += mGame->getSystemName() + "/miximages" + subFolders + "/";
|
||||||
|
|
||||||
if (!Utils::FileSystem::exists(path))
|
if (!Utils::FileSystem::exists(path))
|
||||||
|
|
|
@ -796,6 +796,14 @@ int main(int argc, char* argv[])
|
||||||
LOG(LogWarning) << "Couldn't create directory, permission problems?";
|
LOG(LogWarning) << "Couldn't create directory, permission problems?";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (!Utils::FileSystem::exists(themeDir + "/.nomedia")) {
|
||||||
|
LOG(LogInfo) << "Creating \"no media\" file \"" << themeDir + "/.nomedia"
|
||||||
|
<< "\"...";
|
||||||
|
Utils::FileSystem::createEmptyFile(themeDir + "/.nomedia");
|
||||||
|
if (!Utils::FileSystem::exists(themeDir + "/.nomedia")) {
|
||||||
|
LOG(LogWarning) << "Couldn't create file, permission problems?";
|
||||||
|
}
|
||||||
|
}
|
||||||
#else
|
#else
|
||||||
// Create the themes folder in the application data directory (or elsewhere if the
|
// Create the themes folder in the application data directory (or elsewhere if the
|
||||||
// UserThemeDirectory setting has been defined).
|
// UserThemeDirectory setting has been defined).
|
||||||
|
@ -821,6 +829,21 @@ int main(int argc, char* argv[])
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
#if defined(__ANDROID__)
|
||||||
|
const std::string mediaDirectory {FileData::getMediaDirectory()};
|
||||||
|
if (Utils::FileSystem::exists(mediaDirectory))
|
||||||
|
if (!Utils::FileSystem::exists(mediaDirectory + ".nomedia")) {
|
||||||
|
LOG(LogInfo) << "Creating \"no media\" file \"" << mediaDirectory + ".nomedia"
|
||||||
|
<< "\"...";
|
||||||
|
Utils::FileSystem::createEmptyFile(mediaDirectory + ".nomedia");
|
||||||
|
if (!Utils::FileSystem::exists(mediaDirectory + ".nomedia")) {
|
||||||
|
LOG(LogWarning) << "Couldn't create file, permission problems?";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
// Create the scripts folder in the application data directory. This is only required
|
// Create the scripts folder in the application data directory. This is only required
|
||||||
// for custom event scripts so it's also created as a convenience.
|
// for custom event scripts so it's also created as a convenience.
|
||||||
|
@ -847,6 +870,16 @@ int main(int argc, char* argv[])
|
||||||
LOG(LogWarning) << "Couldn't create directory, permission problems?";
|
LOG(LogWarning) << "Couldn't create directory, permission problems?";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#if defined(__ANDROID__)
|
||||||
|
if (!Utils::FileSystem::exists(screensaversDir + "/.nomedia")) {
|
||||||
|
LOG(LogInfo) << "Creating \"no media\" file \"" << screensaversDir + "/.nomedia"
|
||||||
|
<< "\"...";
|
||||||
|
Utils::FileSystem::createEmptyFile(screensaversDir + "/.nomedia");
|
||||||
|
if (!Utils::FileSystem::exists(screensaversDir + "/.nomedia")) {
|
||||||
|
LOG(LogWarning) << "Couldn't create file, permission problems?";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
if (!Utils::FileSystem::exists(slideshowDir)) {
|
if (!Utils::FileSystem::exists(slideshowDir)) {
|
||||||
LOG(LogInfo) << "Creating custom_slideshow directory \"" << slideshowDir << "\"...";
|
LOG(LogInfo) << "Creating custom_slideshow directory \"" << slideshowDir << "\"...";
|
||||||
Utils::FileSystem::createDirectory(slideshowDir);
|
Utils::FileSystem::createDirectory(slideshowDir);
|
||||||
|
|
|
@ -714,6 +714,17 @@ std::string getSaveAsPath(const ScraperSearchParams& params,
|
||||||
if (!Utils::FileSystem::exists(path))
|
if (!Utils::FileSystem::exists(path))
|
||||||
Utils::FileSystem::createDirectory(path);
|
Utils::FileSystem::createDirectory(path);
|
||||||
|
|
||||||
|
#if defined(__ANDROID__)
|
||||||
|
if (!Utils::FileSystem::exists(path + ".nomedia")) {
|
||||||
|
LOG(LogInfo) << "Creating \"no media\" file \"" << path + ".nomedia"
|
||||||
|
<< "\"...";
|
||||||
|
Utils::FileSystem::createEmptyFile(path + ".nomedia");
|
||||||
|
if (!Utils::FileSystem::exists(path + ".nomedia")) {
|
||||||
|
LOG(LogWarning) << "Couldn't create file, permission problems?";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
path.append(systemsubdirectory)
|
path.append(systemsubdirectory)
|
||||||
.append("/")
|
.append("/")
|
||||||
.append(filetypeSubdirectory)
|
.append(filetypeSubdirectory)
|
||||||
|
|
Loading…
Reference in a new issue