diff --git a/RetroFE/Source/Collection/CollectionInfoBuilder.cpp b/RetroFE/Source/Collection/CollectionInfoBuilder.cpp index bebe38c..dd9e466 100644 --- a/RetroFE/Source/Collection/CollectionInfoBuilder.cpp +++ b/RetroFE/Source/Collection/CollectionInfoBuilder.cpp @@ -493,7 +493,7 @@ void CollectionInfoBuilder::addPlaylists(CollectionInfo *info) } -void CollectionInfoBuilder::updateLastPlayedPlaylist(CollectionInfo *info, Item *item) +void CollectionInfoBuilder::updateLastPlayedPlaylist(CollectionInfo *info, Item *item, int size) { std::string path = Utils::combinePath(Configuration::absolutePath, "collections", info->name, "playlists"); Logger::write(Logger::ZONE_INFO, "RetroFE", "Updating lastplayed playlist"); @@ -507,10 +507,7 @@ void CollectionInfoBuilder::updateLastPlayedPlaylist(CollectionInfo *info, Item else info->playlists["lastplayed"]->clear(); - int lastplayedSize = 0; - (void)conf_.getProperty("lastplayedSize", lastplayedSize); - - if (lastplayedSize == 0) + if (size == 0) return; // Put the new item at the front of the list. @@ -519,7 +516,7 @@ void CollectionInfoBuilder::updateLastPlayedPlaylist(CollectionInfo *info, Item // Add the items already in the playlist up to the lastplayedSize. for(std::vector::iterator it = lastplayedList.begin(); it != lastplayedList.end(); it++) { - if (info->playlists["lastplayed"]->size() >= static_cast( lastplayedSize )) + if (info->playlists["lastplayed"]->size() >= static_cast( size )) break; std::string collectionName = info->name; diff --git a/RetroFE/Source/Collection/CollectionInfoBuilder.h b/RetroFE/Source/Collection/CollectionInfoBuilder.h index dfd53e1..ca9fce5 100644 --- a/RetroFE/Source/Collection/CollectionInfoBuilder.h +++ b/RetroFE/Source/Collection/CollectionInfoBuilder.h @@ -32,7 +32,7 @@ public: CollectionInfo *buildCollection(std::string collectionName); CollectionInfo *buildCollection(std::string collectionName, std::string mergedCollectionName); void addPlaylists(CollectionInfo *info); - void updateLastPlayedPlaylist(CollectionInfo *info, Item *item); + void updateLastPlayedPlaylist(CollectionInfo *info, Item *item, int size); void injectMetadata(CollectionInfo *info); static bool createCollectionDirectory(std::string collectionName); bool ImportBasicList(CollectionInfo *info, std::string file, std::vector &list); diff --git a/RetroFE/Source/RetroFE.cpp b/RetroFE/Source/RetroFE.cpp index 4371a7f..8a1ac8d 100644 --- a/RetroFE/Source/RetroFE.cpp +++ b/RetroFE/Source/RetroFE.cpp @@ -1004,11 +1004,13 @@ void RetroFE::run( ) CollectionInfoBuilder cib(config_, *metadb_); std::string attractModeSkipPlaylist = ""; std::string lastPlayedSkipCollection = ""; + int size = 0; config_.getProperty( "attractModeSkipPlaylist", attractModeSkipPlaylist ); config_.getProperty( "lastPlayedSkipCollection", lastPlayedSkipCollection ); + config_.getProperty( "lastplayedSize", size ); if (currentPage_->getPlaylistName( ) != attractModeSkipPlaylist && nextPageItem_->collectionInfo->name != lastPlayedSkipCollection) - cib.updateLastPlayedPlaylist( currentPage_->getCollection(), nextPageItem_ ); // Update last played playlist if not currently in the skip playlist (e.g. settings) + cib.updateLastPlayedPlaylist( currentPage_->getCollection(), nextPageItem_, size ); // Update last played playlist if not currently in the skip playlist (e.g. settings) l.run(nextPageItem_->collectionInfo->name, nextPageItem_); launchExit( ); currentPage_->exitGame( ); @@ -1483,6 +1485,17 @@ RetroFE::RETROFE_STATE RetroFE::processUserInput( Page *page ) } else { + CollectionInfoBuilder cib(config_, *metadb_); + std::string attractModeSkipPlaylist = ""; + std::string lastPlayedSkipCollection = ""; + int size = 0; + config_.getProperty( "attractModeSkipPlaylist", attractModeSkipPlaylist ); + config_.getProperty( "lastPlayedSkipCollection", lastPlayedSkipCollection ); + config_.getProperty("lastplayedCollectionSize", size); + + if (currentPage_->getPlaylistName( ) != attractModeSkipPlaylist && + nextPageItem_->collectionInfo->name != lastPlayedSkipCollection) + cib.updateLastPlayedPlaylist( currentPage_->getCollection(), nextPageItem_, size ); // Update last played playlist if not currently in the skip playlist (e.g. settings) state = RETROFE_NEXT_PAGE_REQUEST; } } diff --git a/RetroFE/Source/Version.cpp b/RetroFE/Source/Version.cpp index 009031d..a0ab4a8 100644 --- a/RetroFE/Source/Version.cpp +++ b/RetroFE/Source/Version.cpp @@ -21,7 +21,7 @@ std::string retrofe_version_major = "0"; std::string retrofe_version_minor = "9"; -std::string retrofe_version_build = "31"; +std::string retrofe_version_build = "32"; std::string Version::getString( )