mirror of
https://github.com/sebastiandine/Card-Collection-Manager-3.git
synced 2026-08-28 23:01:09 +00:00
patch: Patch/ygo 25th set 2 (#14)
This commit is contained in:
@@ -352,11 +352,14 @@ private:
|
||||
failed.reserve(static_cast<std::size_t>(paths.size()));
|
||||
|
||||
for (const auto& path : paths) {
|
||||
const std::string setNameForImage = (game_ == Game::YuGiOh && !card_.set.id.empty())
|
||||
? card_.set.id
|
||||
: card_.set.name;
|
||||
auto added = imageService_.addImage(game_,
|
||||
std::filesystem::path(path.ToStdString()),
|
||||
mode_ == EditMode::Create,
|
||||
card_.id,
|
||||
card_.set.name,
|
||||
setNameForImage,
|
||||
card_.name,
|
||||
card_.images);
|
||||
if (!added) {
|
||||
|
||||
@@ -113,8 +113,11 @@ void YuGiOhGameView::onAddCard(wxWindow* parentWindow) {
|
||||
|
||||
YuGiOhCard persisted = dlg.card();
|
||||
persisted.id = added.value();
|
||||
const std::string setNameForImage = persisted.set.id.empty()
|
||||
? persisted.set.name
|
||||
: persisted.set.id;
|
||||
auto normalized = images_.normalizeNamesForPersistedCard(
|
||||
Game::YuGiOh, persisted.id, persisted.set.name, persisted.name, persisted.images);
|
||||
Game::YuGiOh, persisted.id, setNameForImage, persisted.name, persisted.images);
|
||||
if (normalized) {
|
||||
if (normalized.value() != persisted.images) {
|
||||
persisted.images = std::move(normalized).value();
|
||||
|
||||
Reference in New Issue
Block a user