-
-
Notifications
You must be signed in to change notification settings - Fork 130
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[ROMM-994] Autogenerated collections #1562
base: master
Are you sure you want to change the base?
Conversation
SELECT * FROM companies_collection | ||
) combined | ||
GROUP BY collection_type, collection_name | ||
HAVING COUNT(DISTINCT rom_id) > 2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be > 1
or >= 2
instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
imo 2 games don't make a collection, so i set the minimum to 3 games
SELECT * FROM companies | ||
) combined | ||
GROUP BY collection_type, collection_name | ||
HAVING COUNT(DISTINCT rom_id) > 2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same answer!
JSON_ARRAYAGG(DISTINCT rom_id) as rom_ids, | ||
JSON_ARRAYAGG(DISTINCT path_cover_s) as path_covers_s, | ||
JSON_ARRAYAGG(DISTINCT path_cover_l) as path_covers_l | ||
FROM |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should these three fields always match their orderings? e.g. Second rom_id corresponds with second element for the cover paths in the other arrays.
If that's the case, I think we should enforce sorting using something like:
JSON_ARRAYAGG(DISTINCT rom_id ORDER BY rom_id) as rom_ids,
JSON_ARRAYAGG(DISTINCT path_cover_s ORDER BY rom_id) as path_covers_s,
JSON_ARRAYAGG(DISTINCT path_cover_l ORDER BY rom_id) as path_covers_l
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
array_to_json(array_agg(rom_id)) as rom_ids, | ||
array_to_json(array_agg(path_cover_s)) as path_covers_s, | ||
array_to_json(array_agg(path_cover_l)) as path_covers_l |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This differs from MySQL, where we use DISTINCT
within the aggregation. I don't think that's needed as I don't see a way for CTEs to repeat rom_id
values. We should have the same logic for both engines.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i can't seem to figure out how to DISTINCT
in postgres like i did in mysql 🤷🏼
Description
Very excited about this one! This PR creates a virtual database table that collects and groups games based on certain IGDB metadata fields: collections, franchises, genres, companies and modes. The list of virtual
VirtualCollections
can be fetched and filtered by type, and displayed in the home screen and collections sidebar. Editing these virtual collections is not possible, so controls like the collection editor window are hidden.As we add more metadata providers, we can update the virtual table to pull properties outside
igdb_metadata
.TODO
Related Issues
Closes #994
Checklist
Please check all that apply.
Screenshots