Icarus-Mod-Tools 2.5.1 → 2.5.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +8 -0
- data/Gemfile.lock +1 -1
- data/lib/icarus/mod/firestore.rb +9 -1
- data/lib/icarus/mod/tools/baseinfo.rb +3 -1
- data/lib/icarus/mod/tools/sync/mods.rb +2 -2
- data/lib/icarus/mod/tools/sync/tools.rb +1 -1
- data/lib/icarus/mod/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 791e5af8d7af9b24c8fe53d04fb97e39b14e7ac0773ce682783aeffebd4b2d85
|
|
4
|
+
data.tar.gz: 7ceede257ab9a52c15e708cf1e346c48b051a0c1c66dd781281eb3d1389ee627
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 705e7a9fb7037c1b2f36ea52e883832c56c9720c605c2d88f25c44d8483e500ef1a962d64b0774501a90b5d00495414f24acbac27eda58d4cf2e72d4024e0e61
|
|
7
|
+
data.tar.gz: 54b2d0f837368e87fc3de253a1bdfd6bb0af60da18b145158b47950a4c1b177fd0fdfab605c96cf1309d22e1f0d7f5a74f9f371d2e53b8cbaec6932343bade5b
|
data/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,14 @@ All notable changes to this project will be documented in this file.
|
|
|
4
4
|
|
|
5
5
|
## History (reverse chronological order)
|
|
6
6
|
|
|
7
|
+
### v2.5.2 - 2026-02-09
|
|
8
|
+
|
|
9
|
+
- Fix duplicate entries created during sync operations
|
|
10
|
+
- Update Firestore cache after creating new documents to prevent duplicate creation within the same sync run
|
|
11
|
+
- Deduplicate info arrays by name+author before processing (handles duplicate/equivalent modinfo URLs)
|
|
12
|
+
- Strip empty file entries (e.g., `pak: ""`) from database writes
|
|
13
|
+
- Fix `id=` setter on Baseinfo (was silently no-op via method_missing, now uses attr_accessor)
|
|
14
|
+
|
|
7
15
|
### v2.5.1 - 2026-01-31
|
|
8
16
|
|
|
9
17
|
- Fix `imt remove repo` failing to find repositories stored as full URLs
|
data/Gemfile.lock
CHANGED
data/lib/icarus/mod/firestore.rb
CHANGED
|
@@ -106,7 +106,15 @@ module Icarus
|
|
|
106
106
|
|
|
107
107
|
return @client.doc("#{collections.send(type)}/#{doc_id}").set(payload.to_h, merge:) if doc_id
|
|
108
108
|
|
|
109
|
-
@client.col(collections.send(type)).add(payload.to_h)
|
|
109
|
+
doc_ref = @client.col(collections.send(type)).add(payload.to_h)
|
|
110
|
+
|
|
111
|
+
# Update cache to prevent duplicate creation within the same sync run
|
|
112
|
+
payload.id = doc_ref.document_id
|
|
113
|
+
cache_var = :"@#{type}"
|
|
114
|
+
cached_collection = instance_variable_get(cache_var)
|
|
115
|
+
cached_collection&.push(payload)
|
|
116
|
+
|
|
117
|
+
doc_ref
|
|
110
118
|
end
|
|
111
119
|
|
|
112
120
|
def pluralize(type)
|
|
@@ -5,7 +5,8 @@ module Icarus
|
|
|
5
5
|
module Tools
|
|
6
6
|
# Base class for Modinfo and Toolinfo
|
|
7
7
|
class Baseinfo
|
|
8
|
-
attr_reader :data
|
|
8
|
+
attr_reader :data
|
|
9
|
+
attr_accessor :id, :created_at, :updated_at
|
|
9
10
|
|
|
10
11
|
HASHKEYS = %i[name author version compatibility description files imageURL readmeURL].freeze
|
|
11
12
|
|
|
@@ -78,6 +79,7 @@ module Icarus
|
|
|
78
79
|
db_hash = HASHKEYS.each_with_object({}) { |key, hash| hash[key] = @data[key] }
|
|
79
80
|
|
|
80
81
|
db_hash[:version] = "1.0" if version.nil?
|
|
82
|
+
db_hash[:files] = db_hash[:files]&.reject { |_, url| url.nil? || url.to_s.strip.empty? }
|
|
81
83
|
|
|
82
84
|
db_hash
|
|
83
85
|
end
|
|
@@ -21,14 +21,14 @@ module Icarus
|
|
|
21
21
|
|
|
22
22
|
def info_array
|
|
23
23
|
@info_array ||= @firestore.modinfo.map do |url|
|
|
24
|
-
retrieve_from_url(url)[:mods].map { |mod| Icarus::Mod::Tools::Modinfo.new(mod) if
|
|
24
|
+
retrieve_from_url(url)[:mods].map { |mod| Icarus::Mod::Tools::Modinfo.new(mod) if /[a-z0-9]+/i.match?(mod[:name]) }
|
|
25
25
|
rescue Icarus::Mod::Tools::Sync::RequestFailed
|
|
26
26
|
warn "Skipped; Failed to retrieve #{url}"
|
|
27
27
|
next
|
|
28
28
|
rescue JSON::ParserError => e
|
|
29
29
|
warn "Skipped; Invalid JSON in #{url}: #{e.message}"
|
|
30
30
|
next
|
|
31
|
-
end.flatten.compact
|
|
31
|
+
end.flatten.compact.uniq { |mod| [mod.name, mod.author] }
|
|
32
32
|
end
|
|
33
33
|
|
|
34
34
|
def find(modinfo)
|
data/lib/icarus/mod/version.rb
CHANGED