mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2024-11-26 08:05:38 +00:00
Merge pull request #109 from pjft/RetroPie-master-videofolders
Adding metadata to folders
This commit is contained in:
commit
9864c4c44c
|
@ -82,30 +82,14 @@ const std::string& FileData::getThumbnailPath() const
|
||||||
}
|
}
|
||||||
|
|
||||||
const std::string& FileData::getVideoPath() const
|
const std::string& FileData::getVideoPath() const
|
||||||
{
|
|
||||||
if (mType == GAME)
|
|
||||||
{
|
{
|
||||||
return metadata.get("video");
|
return metadata.get("video");
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
static std::string empty;
|
|
||||||
return empty;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
const std::string& FileData::getMarqueePath() const
|
const std::string& FileData::getMarqueePath() const
|
||||||
{
|
|
||||||
if (mType == GAME)
|
|
||||||
{
|
{
|
||||||
return metadata.get("marquee");
|
return metadata.get("marquee");
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
static std::string empty;
|
|
||||||
return empty;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
std::vector<FileData*> FileData::getFilesRecursive(unsigned int typeMask) const
|
std::vector<FileData*> FileData::getFilesRecursive(unsigned int typeMask) const
|
||||||
|
|
|
@ -25,10 +25,18 @@ MetaDataDecl gameDecls[] = {
|
||||||
const std::vector<MetaDataDecl> gameMDD(gameDecls, gameDecls + sizeof(gameDecls) / sizeof(gameDecls[0]));
|
const std::vector<MetaDataDecl> gameMDD(gameDecls, gameDecls + sizeof(gameDecls) / sizeof(gameDecls[0]));
|
||||||
|
|
||||||
MetaDataDecl folderDecls[] = {
|
MetaDataDecl folderDecls[] = {
|
||||||
{"name", MD_STRING, "", false},
|
{"name", MD_STRING, "", false, "name", "enter game name"},
|
||||||
{"desc", MD_MULTILINE_STRING, "", false},
|
{"desc", MD_MULTILINE_STRING, "", false, "description", "enter description"},
|
||||||
{"image", MD_PATH, "", false},
|
{"image", MD_PATH, "", false, "image", "enter path to image"},
|
||||||
{"thumbnail", MD_PATH, "", false},
|
{"thumbnail", MD_PATH, "", false, "thumbnail", "enter path to thumbnail"},
|
||||||
|
{"video", MD_PATH, "", false, "video", "enter path to video"},
|
||||||
|
{"marquee", MD_PATH, "", false, "marquee", "enter path to marquee"},
|
||||||
|
{"rating", MD_RATING, "0.000000", false, "rating", "enter rating"},
|
||||||
|
{"releasedate", MD_DATE, "not-a-date-time", false, "release date", "enter release date"},
|
||||||
|
{"developer", MD_STRING, "unknown", false, "developer", "enter game developer"},
|
||||||
|
{"publisher", MD_STRING, "unknown", false, "publisher", "enter game publisher"},
|
||||||
|
{"genre", MD_STRING, "unknown", false, "genre", "enter game genre"},
|
||||||
|
{"players", MD_INT, "1", false, "players", "enter number of players"}
|
||||||
};
|
};
|
||||||
const std::vector<MetaDataDecl> folderMDD(folderDecls, folderDecls + sizeof(folderDecls) / sizeof(folderDecls[0]));
|
const std::vector<MetaDataDecl> folderMDD(folderDecls, folderDecls + sizeof(folderDecls) / sizeof(folderDecls[0]));
|
||||||
|
|
||||||
|
|
|
@ -74,10 +74,22 @@ void GuiGamelistOptions::openMetaDataEd()
|
||||||
ScraperSearchParams p;
|
ScraperSearchParams p;
|
||||||
p.game = file;
|
p.game = file;
|
||||||
p.system = file->getSystem();
|
p.system = file->getSystem();
|
||||||
mWindow->pushGui(new GuiMetaDataEd(mWindow, &file->metadata, file->metadata.getMDD(), p, file->getPath().filename().string(),
|
|
||||||
std::bind(&IGameListView::onFileChanged, getGamelist(), file, FILE_METADATA_CHANGED), [this, file] {
|
std::function<void()> deleteBtnFunc;
|
||||||
|
|
||||||
|
if (file->getType() == FOLDER)
|
||||||
|
{
|
||||||
|
deleteBtnFunc = NULL;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
deleteBtnFunc = [this, file] {
|
||||||
getGamelist()->remove(file);
|
getGamelist()->remove(file);
|
||||||
}));
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
mWindow->pushGui(new GuiMetaDataEd(mWindow, &file->metadata, file->metadata.getMDD(), p, file->getPath().filename().string(),
|
||||||
|
std::bind(&IGameListView::onFileChanged, getGamelist(), file, FILE_METADATA_CHANGED), deleteBtnFunc));
|
||||||
}
|
}
|
||||||
|
|
||||||
void GuiGamelistOptions::jumpToLetter()
|
void GuiGamelistOptions::jumpToLetter()
|
||||||
|
|
|
@ -192,14 +192,15 @@ void DetailedGameListView::updateInfoPanel()
|
||||||
mDescription.setText(file->metadata.get("desc"));
|
mDescription.setText(file->metadata.get("desc"));
|
||||||
mDescContainer.reset();
|
mDescContainer.reset();
|
||||||
|
|
||||||
if(file->getType() == GAME)
|
|
||||||
{
|
|
||||||
mRating.setValue(file->metadata.get("rating"));
|
mRating.setValue(file->metadata.get("rating"));
|
||||||
mReleaseDate.setValue(file->metadata.get("releasedate"));
|
mReleaseDate.setValue(file->metadata.get("releasedate"));
|
||||||
mDeveloper.setValue(file->metadata.get("developer"));
|
mDeveloper.setValue(file->metadata.get("developer"));
|
||||||
mPublisher.setValue(file->metadata.get("publisher"));
|
mPublisher.setValue(file->metadata.get("publisher"));
|
||||||
mGenre.setValue(file->metadata.get("genre"));
|
mGenre.setValue(file->metadata.get("genre"));
|
||||||
mPlayers.setValue(file->metadata.get("players"));
|
mPlayers.setValue(file->metadata.get("players"));
|
||||||
|
|
||||||
|
if(file->getType() == GAME)
|
||||||
|
{
|
||||||
mLastPlayed.setValue(file->metadata.get("lastplayed"));
|
mLastPlayed.setValue(file->metadata.get("lastplayed"));
|
||||||
mPlayCount.setValue(file->metadata.get("playcount"));
|
mPlayCount.setValue(file->metadata.get("playcount"));
|
||||||
}
|
}
|
||||||
|
|
|
@ -258,14 +258,15 @@ void VideoGameListView::updateInfoPanel()
|
||||||
mDescription.setText(file->metadata.get("desc"));
|
mDescription.setText(file->metadata.get("desc"));
|
||||||
mDescContainer.reset();
|
mDescContainer.reset();
|
||||||
|
|
||||||
if(file->getType() == GAME)
|
|
||||||
{
|
|
||||||
mRating.setValue(file->metadata.get("rating"));
|
mRating.setValue(file->metadata.get("rating"));
|
||||||
mReleaseDate.setValue(file->metadata.get("releasedate"));
|
mReleaseDate.setValue(file->metadata.get("releasedate"));
|
||||||
mDeveloper.setValue(file->metadata.get("developer"));
|
mDeveloper.setValue(file->metadata.get("developer"));
|
||||||
mPublisher.setValue(file->metadata.get("publisher"));
|
mPublisher.setValue(file->metadata.get("publisher"));
|
||||||
mGenre.setValue(file->metadata.get("genre"));
|
mGenre.setValue(file->metadata.get("genre"));
|
||||||
mPlayers.setValue(file->metadata.get("players"));
|
mPlayers.setValue(file->metadata.get("players"));
|
||||||
|
|
||||||
|
if(file->getType() == GAME)
|
||||||
|
{
|
||||||
mLastPlayed.setValue(file->metadata.get("lastplayed"));
|
mLastPlayed.setValue(file->metadata.get("lastplayed"));
|
||||||
mPlayCount.setValue(file->metadata.get("playcount"));
|
mPlayCount.setValue(file->metadata.get("playcount"));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue