Fix duplicate mods and missing downloads for exmod files#7
Open
AgentKush wants to merge 3 commits into
Open
Conversation
Two issues fixed: 1. Duplicate mods: Added deduplication by name+author in fetch_all so duplicate Firestore documents don't produce repeated entries on the mods listing page. 2. Missing downloads: Added :exmod support to preferred_type and download_types. Mods with only an exmod file (not exmodz) were showing no download button because exmod wasn't in the allowed file type list. Also updated the show page EXMOD notice to trigger for both exmod and exmodz files. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Split filter_map chain into variable + separate uniq/sort call - Extract firestore_doc helper method to reduce let count and test length - Remove mod_firestore_obj2 let in favor of inline helper calls Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Makes freeze_time, travel_to, and travel available globally in specs for deterministic time-dependent tests. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes two issues reported on the live site:
1. Duplicate mods on the mods listing page
Mod.fetch_allnow deduplicates by[name, author_slug]before sorting2. Missing download buttons for exmod-only mods
:exmod(without the z) as a supported file type inpreferred_typeanddownload_types:pak,:zip, and:exmodzwere recognized — mods with only:exmodfiles showed no download buttonexmodandexmodzfilesChanges
app/models/mod.rb— Addedexmod?method, added:exmodtopreferred_typeanddownload_types, added.uniqdedup tofetch_allapp/views/mods/show.html.erb— EXMOD notice now checks bothexmodz?andexmod?spec/models/mod_spec.rb— Updated specs for exmod support and added deduplication testCross-fork PR
This needs to be opened as a PR on DonovanMods/project_daedalus (our PAT can't create PRs on upstream).
🤖 Generated with Claude Code