MCPcopy Create free account
hub / github.com/FSGModding/FSG_Mod_Assistant / #addMod

Method #addMod

lib/modCheckLib.js:1081–1103  ·  view source on GitHub ↗
(collectKey, thisFile)

Source from the content-addressed store, hash-verified

1079 }
1080
1081 async #addMod(collectKey, thisFile) {
1082 const thisFileStats = this.#fileStats(collectKey, thisFile)
1083
1084 // Check cache
1085 const modInCache = this.#cacheHit(thisFileStats)
1086 if ( modInCache ) {
1087 // this.#log.debug(`mod-${modInCache.uuid}`, 'Adding mod FROM cache', modInCache.fileDetail.shortName)
1088 this.#addModToData(collectKey, modInCache)
1089 return
1090 }
1091
1092 this.#threadPool[this.#getCurrentThread()].send({
1093 type : 'mod',
1094 data : {
1095 collectKey : collectKey,
1096 date : (this.#useSyncSafeMode) ? thisFileStats.birthDate.toISOString() : thisFileStats.date.toISOString(),
1097 filePath : thisFileStats.fullPath,
1098 isFolder : thisFileStats.isFolder,
1099 md5Pre : thisFileStats.hashString,
1100 size : thisFileStats.size,
1101 },
1102 })
1103 }
1104
1105 /**
1106 * Get version of a collection

Callers 1

processModsMethod · 0.95

Calls 4

#fileStatsMethod · 0.95
#cacheHitMethod · 0.95
#addModToDataMethod · 0.95
#getCurrentThreadMethod · 0.95

Tested by

no test coverage detected