Hi Just a quick update on this, Im not sure if its an error in the coding, I can now use {PlayniteDir} or {EmulatorDir} as well as .\ in the emulator auto scan configuration fields, but when I rescan the Emulator, it doesn't detect the already existing games and ignore the update.
Im guessing for example the script is finding the autoconfiguration field as:
{PlayniteDir}\..\Roms\NintendoSwitch\
Then it must compile the full directory to update the games e.g:
E:\Roms\NintendoSwitch\
Then tries to match the two directories and doesn't find a match
if( "{PlayniteDir}\..\Roms\NintendoSwitch\" == "E:\Roms\NintendoSwitch\" ){
// skips adding this game to the library as it already exists
return;
}
So it is doing a false match. as when it uses full directory paths it finds a match and skips the game and doesn't create duplicate games for the system:
So if I set the full directory In the auto-configuration "Scan Folder":
E:\Roms\NintendoSwitch\
When I run another auto scan because Ive added one new game, it skips all the duplicates and just adds the one new game, so I'm guessing its running something like this:
if( "E:\Roms\NintendoSwitch\" == "E:\Roms\NintendoSwitch\" ){
// skips adding this game to the library as it already exists
return;
}
This would match TRUE as the two fields are the same and skip the duplicates.
I've obviously replaced the variables with the full fields for example purposes.
It is only a guess of what is happening, but that seems to be what is happening in the background in my opinion.
Im guessing for example the script is finding the autoconfiguration field as:
{PlayniteDir}\..\Roms\NintendoSwitch\
Then it must compile the full directory to update the games e.g:
E:\Roms\NintendoSwitch\
Then tries to match the two directories and doesn't find a match
if( "{PlayniteDir}\..\Roms\NintendoSwitch\" == "E:\Roms\NintendoSwitch\" ){
// skips adding this game to the library as it already exists
return;
}
So it is doing a false match. as when it uses full directory paths it finds a match and skips the game and doesn't create duplicate games for the system:
So if I set the full directory In the auto-configuration "Scan Folder":
E:\Roms\NintendoSwitch\
When I run another auto scan because Ive added one new game, it skips all the duplicates and just adds the one new game, so I'm guessing its running something like this:
if( "E:\Roms\NintendoSwitch\" == "E:\Roms\NintendoSwitch\" ){
// skips adding this game to the library as it already exists
return;
}
This would match TRUE as the two fields are the same and skip the duplicates.
I've obviously replaced the variables with the full fields for example purposes.
It is only a guess of what is happening, but that seems to be what is happening in the background in my opinion.