Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions RetroFE/Source/Collection/CollectionInfoBuilder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@ CollectionInfo *CollectionInfoBuilder::buildCollection(std::string name, std::st
std::string metadataType = name;
std::string metadataPath;

// todo make array of listItemsPaths
conf_.getCollectionAbsolutePath(name, listItemsPath);

(void)conf_.getProperty(extensionsKey, extensions);
Expand All @@ -183,7 +184,7 @@ CollectionInfo *CollectionInfoBuilder::buildCollection(std::string name, std::st

Logger::write(Logger::ZONE_NOTICE, "Collections", ss.str());
}

// pas into this
CollectionInfo *collection = new CollectionInfo(name, listItemsPath, extensions, metadataType, metadataPath);

(void)conf_.getProperty("collections." + collection->name + ".launcher", collection->launcher);
Expand Down Expand Up @@ -290,7 +291,6 @@ bool CollectionInfoBuilder::ImportDirectory(CollectionInfo *info, std::string me

if (mergedCollectionName != "")
{

std::string mergedFile = Utils::combinePath(Configuration::absolutePath, "collections", mergedCollectionName, info->name + ".sub");
Logger::write(Logger::ZONE_INFO, "CollectionInfoBuilder", "Checking for \"" + mergedFile + "\"");
(void)conf_.getProperty("collections." + mergedCollectionName + ".list.includeMissingItems", showMissing);
Expand Down Expand Up @@ -327,6 +327,7 @@ bool CollectionInfoBuilder::ImportDirectory(CollectionInfo *info, std::string me
{
do
{
// todo loop through path array and still support ';' seperators
std::string rompath;
size_t position = path.find( ";" );
if(position != std::string::npos)
Expand Down Expand Up @@ -662,7 +663,8 @@ void CollectionInfoBuilder::ImportRomDirectory(std::string path, CollectionInfo
Logger::write(Logger::ZONE_INFO, "CollectionInfoBuilder", "Could not read directory \"" + path + "\". Ignore if this is a menu.");
return;
}

// todo " reads one path first and then the other, so if there are 20 roms in the first path, it orders that one first and then shows the other roms from the second path."
// todo confirm it merges both paths and orders them all together
while(dp != NULL && (dirp = readdir(dp)) != NULL)
{
std::string file = dirp->d_name;
Expand Down
9 changes: 8 additions & 1 deletion RetroFE/Source/Execute/Launcher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,10 @@ bool Launcher::run(std::string collection, Item *collectionItem)
Logger::write(Logger::ZONE_ERROR, "Launcher", "No file extensions configured for collection \"" + collection + "\"");
return false;
}

// todo populate array of selectedItemDirectories
// loop to 9, pass in index into function to pass into getCollectionAbsolutePath to build path0-9
// and at the end check if any directory has items then show below error
if(!collectionDirectory(selectedItemsDirectory, collection))
{
Logger::write(Logger::ZONE_ERROR, "Launcher", "Could not find files in directory \"" + selectedItemsDirectory + "\" for collection \"" + collection + "\"");
Expand All @@ -78,13 +82,15 @@ bool Launcher::run(std::string collection, Item *collectionItem)
return false;
}


// todo maybe move before collectionDirectory if it's just going to overwrite it
// Overwrite selectedItemsDirectory if already set in the file
if (collectionItem->filepath != "")
{
selectedItemsDirectory = collectionItem->filepath;
}

// todo pass selectedItemDirectories to loop on to find
// todo return from find path selectedItemsPath to be used in replaceVariables
// It is ok to continue if the file could not be found. We could be launching a merged romset
if (collectionItem->file == "")
findFile(selectedItemsPath, matchedExtension, selectedItemsDirectory, collectionItem->name, extensionstr);
Expand Down Expand Up @@ -358,6 +364,7 @@ bool Launcher::collectionDirectory(std::string &directory, std::string collectio
return true;
}

// todo support selectedItemDirectories array to loop on to find file
bool Launcher::findFile(std::string &foundFilePath, std::string &foundFilename, std::string directory, std::string filenameWithoutExtension, std::string extensions)
{
std::string extension;
Expand Down
2 changes: 1 addition & 1 deletion RetroFE/Source/RetroFE.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1670,7 +1670,7 @@ RetroFE::RETROFE_STATE RetroFE::processUserInput( Page *page )
page->togglePlaylist( );
state = RETROFE_PLAYLIST_REQUEST;
}
}
}

else if ( input_.keystate(UserInput::KeyCodeSkipForward) )
{
Expand Down