File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ namespace content {
1414
1515 Task<PreparationResult> MetadataSubIngestor::prepare () {
1616 const auto docsRoot = project_.getRootDirectory ();
17- const auto workbenchesFile = docsRoot / " .data " / " workbenches.json " ;
17+ const auto workbenchesFile = project_. getFormat (). getWorkbenchesPath () ;
1818
1919 if (exists (workbenchesFile)) {
2020 const ProjectFileIssueCallback fileIssues{issues_, workbenchesFile};
Original file line number Diff line number Diff line change @@ -360,10 +360,21 @@ namespace service {
360360 JOIN project_version ver ON pitem.version_id = ver.id \
361361 JOIN item ON pitem.item_id = item.id \
362362 LEFT JOIN project_item_page pip ON pitem.id = pip.item_id \
363- WHERE NOT ri.input AND EXISTS ( \
364- SELECT 1 FROM recipe_ingredient_item ri_sub \
365- JOIN item i ON ri_sub.item_id = i.id \
366- WHERE ri_sub.recipe_id = r.id AND i.loc = $1 AND ri_sub.input)" ;
363+ WHERE NOT ri.input AND ( \
364+ EXISTS ( \
365+ SELECT 1 FROM recipe_ingredient_item ri_sub \
366+ JOIN item i ON ri_sub.item_id = i.id \
367+ WHERE ri_sub.recipe_id = r.id AND i.loc = $1 AND ri_sub.input \
368+ ) \
369+ OR EXISTS( \
370+ SELECT 1 FROM recipe_ingredient_tag rt_sub \
371+ JOIN project_tag pt ON pt.tag_id = rt_sub.tag_id \
372+ JOIN tag_item_flat flat ON flat.parent = pt.id \
373+ JOIN project_item pit on pit.id = flat.child \
374+ JOIN item i ON pit.item_id = i.id \
375+ WHERE rt_sub.recipe_id = r.id AND i.loc = $1 AND rt_sub.input \
376+ ) \
377+ )" ;
367378
368379 const auto [res, err] = co_await handleDatabaseOperation<std::vector<ContentUsage>>(
369380 [item](const DbClientPtr &client) -> Task<std::vector<ContentUsage>> {
Original file line number Diff line number Diff line change 99#define CONTENT_DIR_PATH " .content"
1010#define FOLDER_META_FILE " _meta.json"
1111#define PROPERTIES_PATH " .data/properties.json"
12+ #define WORKBENCHES_PATH " .data/workbenches.json"
1213#define WIKI_META_FILE " sinytra-wiki.json"
1314
1415namespace fs = std::filesystem;
@@ -67,6 +68,10 @@ namespace service {
6768 return getLocalizedFilePath (PROPERTIES_PATH);
6869 }
6970
71+ fs::path ProjectFormat::getWorkbenchesPath () const {
72+ return root_ / WORKBENCHES_PATH;
73+ }
74+
7075 fs::path ProjectFormat::getAssetPath (const ResourceLocation &location) const {
7176 const auto ext = location.path_ .find (' .' ) != std::string::npos ? " " : " .png" ;
7277 const auto path = ASSETS_DIR_PATH " /" + location.namespace_ + " /" + location.path_ + ext;
Original file line number Diff line number Diff line change @@ -22,6 +22,7 @@ namespace service {
2222 std::filesystem::path getLocalizedFilePath (const std::string &path) const ;
2323 std::filesystem::path getFolderMetaFilePath (const std::filesystem::path &dir) const ;
2424 std::filesystem::path getItemPropertiesPath () const ;
25+ std::filesystem::path getWorkbenchesPath () const ;
2526 std::filesystem::path getAssetPath (const ResourceLocation &location) const ;
2627 std::filesystem::path getLanguageFilePath (const std::string &namespace_) const ;
2728 private:
You can’t perform that action at this time.
0 commit comments