* Find a given scenario based on its unique ID. * @param ci The content info to compare it to. * @param md5sum Whether to look at the md5sum or the id. * @return The filename of the file, else \c std::nullopt. */
| 662 | * @return The filename of the file, else \c std::nullopt. |
| 663 | */ |
| 664 | std::optional<std::string_view> FindScenario(const ContentInfo &ci, bool md5sum) |
| 665 | { |
| 666 | _scanner.Scan(false); |
| 667 | |
| 668 | for (ScenarioIdentifier &id : _scanner) { |
| 669 | if (md5sum ? (id.md5sum == ci.md5sum) |
| 670 | : (id.scenid == ci.unique_id)) { |
| 671 | return id.filename; |
| 672 | } |
| 673 | } |
| 674 | |
| 675 | return std::nullopt; |
| 676 | } |
| 677 | |
| 678 | /** |
| 679 | * Check whether we've got a given scenario based on its unique ID. |
no test coverage detected