fix: fix order of partial match

the string in the profile needs to be the end of the identified string, not the other way around
This commit is contained in:
PancakeTAS 2025-12-25 05:00:30 +01:00
parent 2a13914b55
commit 991056abc1
No known key found for this signature in database
2 changed files with 6 additions and 3 deletions

View file

@ -4,10 +4,10 @@
**lsfg-vk** is a Vulkan layer that hooks into Vulkan applications and generates additional frames using Lossless Scaling's frame generation algorithm.
>[!CAUTION]
>You are reading the README for the upcoming version 2.0 of lsfg-vk. For the stable version 1.x, [please read here](https://github.com/PancakeTAS/lsfg-vk/tree/ff1a0f72a7d6d08b84d58b7b4dc5f05c9f904f98)
> You are reading the README for the upcoming version 2.0 of lsfg-vk. For the stable version 1.x, [please read here](https://github.com/PancakeTAS/lsfg-vk/tree/ff1a0f72a7d6d08b84d58b7b4dc5f05c9f904f98)
## Installation
>[!INFO]
>[!TIP]
> If you are on a Steam Deck or similar handheld, consider using the [Decky plugin for lsfg-vk](https://github.com/xXJSONDeruloXx/decky-lsfg-vk). This is an easy way to install and configure lsfg-vk on the Steam Deck.
> Please keep in mind that it is not officially supported and support questions should be directed to the plugin's repository & discord.

View file

@ -6,6 +6,7 @@
#include <array>
#include <cstdlib>
#include <fstream>
#include <iostream>
#include <optional>
#include <string>
#include <unistd.h>
@ -36,7 +37,7 @@ namespace {
std::optional<GameConf> matchEndsWithId(const std::vector<GameConf>& profiles, const std::string& id) {
for (const auto& profile : profiles)
for (const auto& activation : profile.active_in)
if (activation.ends_with(id))
if (id.ends_with(activation))
return profile;
return std::nullopt;
}
@ -102,6 +103,8 @@ std::optional<std::pair<IdentType, GameConf>> ls::findProfile(
const ConfigFile& config, const Identification& id) {
const auto& profiles = config.profiles();
std::cerr << "wine exec: " << (id.wine_executable.has_value() ? id.wine_executable.value() : "none") << "\n";
// check for the environment option first
if (std::getenv("LSFGVK_ENV") != nullptr)
return std::make_pair(IdentType::OVERRIDE, profiles.front());