MCPcopy Create free account
hub / github.com/DialmasterOrg/Youtarr / getJobDataValue

Method getJobDataValue

server/modules/downloadModule.js:44–58  ·  view source on GitHub ↗

* Safely read a property from job payloads (handles queued jobs where data is nested) * @param {Object} jobData - job payload (direct invocation or queued job) * @param {string} key - property name to resolve * @returns {*|undefined} resolved value if found

(jobData, key)

Source from the content-addressed store, hash-verified

42 * @returns {*|undefined} resolved value if found
43 */
44 getJobDataValue(jobData, key) {
45 if (!jobData) {
46 return undefined;
47 }
48
49 if (Object.prototype.hasOwnProperty.call(jobData, key)) {
50 return jobData[key];
51 }
52
53 if (jobData.data && Object.prototype.hasOwnProperty.call(jobData.data, key)) {
54 return jobData.data[key];
55 }
56
57 return undefined;
58 }
59
60 /**
61 * Set a property on both the job wrapper and nested data (if present)

Callers 7

getOverrideSettingsMethod · 0.95
registerJobWithRunMethod · 0.95
enqueueAutoRetryJobMethod · 0.95
doSpecificDownloadsMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected