mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2024-11-26 08:05:38 +00:00
Launching a game inside a folder now also updates the folder's last played timestamp.
This commit is contained in:
parent
0985867d0f
commit
9f04458bbd
|
@ -720,6 +720,15 @@ void FileData::launchGame(Window* window)
|
||||||
|
|
||||||
// Update last played time.
|
// Update last played time.
|
||||||
gameToUpdate->metadata.set("lastplayed", Utils::Time::DateTime(Utils::Time::now()));
|
gameToUpdate->metadata.set("lastplayed", Utils::Time::DateTime(Utils::Time::now()));
|
||||||
|
|
||||||
|
// If the parent is a folder and it's not the root of the system, then update its lastplayed
|
||||||
|
// timestamp to the same time as the game that was just launched.
|
||||||
|
if (gameToUpdate->getParent()->getType() == FOLDER && gameToUpdate->getParent()->getName() !=
|
||||||
|
gameToUpdate->getSystem()->getFullName()) {
|
||||||
|
gameToUpdate->getParent()->metadata.set("lastplayed",
|
||||||
|
gameToUpdate->metadata.get("lastplayed"));
|
||||||
|
}
|
||||||
|
|
||||||
CollectionSystemManager::get()->refreshCollectionSystems(gameToUpdate);
|
CollectionSystemManager::get()->refreshCollectionSystems(gameToUpdate);
|
||||||
|
|
||||||
gameToUpdate->mSystem->onMetaDataSavePoint();
|
gameToUpdate->mSystem->onMetaDataSavePoint();
|
||||||
|
|
|
@ -45,7 +45,8 @@ MetaDataDecl folderDecls[] = {
|
||||||
{"publisher", MD_STRING, "unknown", false, "publisher", "enter game publisher", true},
|
{"publisher", MD_STRING, "unknown", false, "publisher", "enter game publisher", true},
|
||||||
{"genre", MD_STRING, "unknown", false, "genre", "enter game genre", true},
|
{"genre", MD_STRING, "unknown", false, "genre", "enter game genre", true},
|
||||||
{"players", MD_INT, "unknown", false, "players", "enter number of players", true},
|
{"players", MD_INT, "unknown", false, "players", "enter number of players", true},
|
||||||
{"hidden", MD_BOOL, "false", false, "hidden", "enter hidden off/on", false}
|
{"hidden", MD_BOOL, "false", false, "hidden", "enter hidden off/on", false},
|
||||||
|
{"lastplayed", MD_TIME, "0", true, "last played", "enter last played date", false}
|
||||||
};
|
};
|
||||||
const std::vector<MetaDataDecl> folderMDD(folderDecls, folderDecls +
|
const std::vector<MetaDataDecl> folderMDD(folderDecls, folderDecls +
|
||||||
sizeof(folderDecls) / sizeof(folderDecls[0]));
|
sizeof(folderDecls) / sizeof(folderDecls[0]));
|
||||||
|
|
|
@ -259,8 +259,8 @@ void DetailedGameListView::updateInfoPanel()
|
||||||
mLastPlayed.setValue(file->metadata.get("lastplayed"));
|
mLastPlayed.setValue(file->metadata.get("lastplayed"));
|
||||||
mPlayCount.setValue(file->metadata.get("playcount"));
|
mPlayCount.setValue(file->metadata.get("playcount"));
|
||||||
}
|
}
|
||||||
else {
|
else if (file->getType() == FOLDER) {
|
||||||
mLastPlayed.setValue("");
|
mLastPlayed.setValue(file->metadata.get("lastplayed"));
|
||||||
mPlayCount.setValue("");
|
mPlayCount.setValue("");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -387,8 +387,8 @@ void GridGameListView::updateInfoPanel()
|
||||||
mLastPlayed.setValue(file->metadata.get("lastplayed"));
|
mLastPlayed.setValue(file->metadata.get("lastplayed"));
|
||||||
mPlayCount.setValue(file->metadata.get("playcount"));
|
mPlayCount.setValue(file->metadata.get("playcount"));
|
||||||
}
|
}
|
||||||
else {
|
else if (file->getType() == FOLDER) {
|
||||||
mLastPlayed.setValue("");
|
mLastPlayed.setValue(file->metadata.get("lastplayed"));
|
||||||
mPlayCount.setValue("");
|
mPlayCount.setValue("");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -303,8 +303,8 @@ void VideoGameListView::updateInfoPanel()
|
||||||
mLastPlayed.setValue(file->metadata.get("lastplayed"));
|
mLastPlayed.setValue(file->metadata.get("lastplayed"));
|
||||||
mPlayCount.setValue(file->metadata.get("playcount"));
|
mPlayCount.setValue(file->metadata.get("playcount"));
|
||||||
}
|
}
|
||||||
else {
|
else if (file->getType() == FOLDER) {
|
||||||
mLastPlayed.setValue("");
|
mLastPlayed.setValue(file->metadata.get("lastplayed"));
|
||||||
mPlayCount.setValue("");
|
mPlayCount.setValue("");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue