mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2025-01-29 19:55:37 +00:00
(Windows) Fixed an issue where the video and slideshow screensavers didn't work if a custom game media directory had been configured
This commit is contained in:
parent
b26da9d80d
commit
f09f4838f1
|
@ -410,27 +410,32 @@ void Screensaver::generateImageList()
|
||||||
if (!(*it)->isGameSystem() || (*it)->isCollection())
|
if (!(*it)->isGameSystem() || (*it)->isCollection())
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
// This method of building an inventory of all image files isn't pretty, but to use the
|
#if defined(_WIN64)
|
||||||
// FileData::getImagePath() function leads to unacceptable performance issues on some
|
const std::string mediaBaseDir {
|
||||||
// platforms like Android that offer very poor disk I/O performance. To instead list
|
Utils::String::replace(FileData::getMediaDirectory(), "\\", "/")};
|
||||||
// all files recursively is much faster as this avoids stat() function calls which are
|
#else
|
||||||
// very expensive on such problematic platforms.
|
const std::string mediaBaseDir {FileData::getMediaDirectory()};
|
||||||
|
#endif
|
||||||
const std::string mediaDirMiximages {
|
const std::string mediaDirMiximages {
|
||||||
FileData::getMediaDirectory() + (*it)->getRootFolder()->getSystemName() + "/miximages"};
|
mediaBaseDir + (*it)->getRootFolder()->getSystemName() + "/miximages"};
|
||||||
const std::string mediaDirScreenshots {FileData::getMediaDirectory() +
|
const std::string mediaDirScreenshots {
|
||||||
(*it)->getRootFolder()->getSystemName() +
|
mediaBaseDir + (*it)->getRootFolder()->getSystemName() + "/screenshots"};
|
||||||
"/screenshots"};
|
const std::string mediaDirTitlescreens {
|
||||||
const std::string mediaDirTitlescreens {FileData::getMediaDirectory() +
|
mediaBaseDir + (*it)->getRootFolder()->getSystemName() + "/titlescreens"};
|
||||||
(*it)->getRootFolder()->getSystemName() +
|
const std::string mediaDirCovers {mediaBaseDir + (*it)->getRootFolder()->getSystemName() +
|
||||||
"/titlescreens"};
|
"/covers"};
|
||||||
const std::string mediaDirCovers {FileData::getMediaDirectory() +
|
|
||||||
(*it)->getRootFolder()->getSystemName() + "/covers"};
|
|
||||||
|
|
||||||
Utils::FileSystem::StringList dirContentMiximages;
|
Utils::FileSystem::StringList dirContentMiximages;
|
||||||
Utils::FileSystem::StringList dirContentScreenshots;
|
Utils::FileSystem::StringList dirContentScreenshots;
|
||||||
Utils::FileSystem::StringList dirContentTitlescreens;
|
Utils::FileSystem::StringList dirContentTitlescreens;
|
||||||
Utils::FileSystem::StringList dirContentCovers;
|
Utils::FileSystem::StringList dirContentCovers;
|
||||||
|
|
||||||
|
// This method of building an inventory of all image files isn't pretty, but to use the
|
||||||
|
// FileData::getImagePath() function leads to unacceptable performance issues on some
|
||||||
|
// platforms like Android that offer very poor disk I/O performance. To instead list
|
||||||
|
// all files recursively is much faster as this avoids stat() function calls which are
|
||||||
|
// very expensive on such problematic platforms.
|
||||||
|
|
||||||
#if defined(_WIN64) || defined(__APPLE__) || defined(__ANDROID__)
|
#if defined(_WIN64) || defined(__APPLE__) || defined(__ANDROID__)
|
||||||
// Although macOS may have filesystem case-sensitivity enabled it's rare and the impact
|
// Although macOS may have filesystem case-sensitivity enabled it's rare and the impact
|
||||||
// would not be severe in this case anyway.
|
// would not be severe in this case anyway.
|
||||||
|
@ -535,14 +540,21 @@ void Screensaver::generateVideoList()
|
||||||
if (!(*it)->isGameSystem() || (*it)->isCollection())
|
if (!(*it)->isGameSystem() || (*it)->isCollection())
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
#if defined(_WIN64)
|
||||||
|
const std::string mediaBaseDir {
|
||||||
|
Utils::String::replace(FileData::getMediaDirectory(), "\\", "/")};
|
||||||
|
#else
|
||||||
|
const std::string mediaBaseDir {FileData::getMediaDirectory()};
|
||||||
|
#endif
|
||||||
|
const std::string mediaDir {mediaBaseDir + (*it)->getRootFolder()->getSystemName() +
|
||||||
|
"/videos"};
|
||||||
|
Utils::FileSystem::StringList dirContent;
|
||||||
|
|
||||||
// This method of building an inventory of all video files isn't pretty, but to use the
|
// This method of building an inventory of all video files isn't pretty, but to use the
|
||||||
// FileData::getVideoPath() function leads to unacceptable performance issues on some
|
// FileData::getVideoPath() function leads to unacceptable performance issues on some
|
||||||
// platforms like Android that offer very poor disk I/O performance. To instead list
|
// platforms like Android that offer very poor disk I/O performance. To instead list
|
||||||
// all files recursively is much faster as this avoids stat() function calls which are
|
// all files recursively is much faster as this avoids stat() function calls which are
|
||||||
// very expensive on such problematic platforms.
|
// very expensive on such problematic platforms.
|
||||||
const std::string mediaDir {FileData::getMediaDirectory() +
|
|
||||||
(*it)->getRootFolder()->getSystemName() + "/videos"};
|
|
||||||
Utils::FileSystem::StringList dirContent;
|
|
||||||
|
|
||||||
#if defined(_WIN64) || defined(__APPLE__) || defined(__ANDROID__)
|
#if defined(_WIN64) || defined(__APPLE__) || defined(__ANDROID__)
|
||||||
// Although macOS may have filesystem case-sensitivity enabled it's rare and the impact
|
// Although macOS may have filesystem case-sensitivity enabled it's rare and the impact
|
||||||
|
|
Loading…
Reference in a new issue