// generates the nested data structure to represent trailers public List <AppTrailer> SetupTrailersFor(DetailsValue row) { if (row == null || row.displayFamilies == null) { return(null); } var displayFamilies = row?.displayFamilies?.value; if (displayFamilies == null) { return(null); } List <AppTrailer> result = new List <AppTrailer>(); displayFamilies.ForEach(displayFamily => { displayFamily?.trailers?.value.ForEach(trailer => { AppTrailer trailerData = trailer.value; trailerData.deviceType = displayFamily.name; trailerData.language = row.language; result.Add(trailerData); }); }); return(result); }
// generates the nested data structure to represent screenshots public List <AppScreenshot> SetupMessagesScreenshotsFor(DetailsValue dataDetails) { if (dataDetails == null || dataDetails.displayFamilies == null) { return(null); } var displayFamilies = dataDetails?.displayFamilies?.value; if (displayFamilies == null) { return(null); } var result = new List <AppScreenshot>(); foreach (var displayFamily in displayFamilies) { var displayFamilyScreenshots = displayFamily?.messagesScreenshots; if (displayFamilyScreenshots == null) { continue; } displayFamilyScreenshots?.value.ForEach(screenshot => { var screenshotData = screenshot.value; var data = JObject.FromObject(screenshotData).ToObject <AppScreenshot>(); data.deviceType = displayFamily.name; data.language = dataDetails.language; data.isImessage = true; // to identify imessage screenshots later on (e.g: during download) result.Add(data); }); } ; return(result); }
// generates the nested data structure to represent screenshots public List <AppScreenshot> SetupScreenshotsFor(DetailsValue dataDetails) { if (dataDetails == null || dataDetails.displayFamilies == null) { return(null); } var displayFamilies = dataDetails?.displayFamilies?.value; if (displayFamilies == null) { return(null); } var result = new List <AppScreenshot>(); displayFamilies.ForEach(displayFamily => { // { // "name": "iphone6Plus", // "scaled": { // "value": false, // "isEditable": false, // "isRequired": false, // "errorKeys": null // }, // "screenshots": { // "value": [{ // "value": { // "assetToken": "Purple62/v4/08/0a/04/080a0430-c2cc-2577-f491-9e0a09c58ffe/mzl.pbcpzqyg.jpg", // "sortOrder": 1, // "type": null, // "originalFileName": "ios-414-1.jpg" // }, // "isEditable": true, // "isRequired": false, // "errorKeys": null // }, { // "value": { // "assetToken": "Purple71/v4/de/81/aa/de81aa10-64f6-332e-c974-9ee46adab675/mzl.cshkjvwl.jpg", // "sortOrder": 2, // "type": null, // "originalFileName": "ios-414-2.jpg" // }, // "isEditable": true, // "isRequired": false, // "errorKeys": null // }], // "messagesScaled": { // "value": false, // "isEditable": false, // "isRequired": false, // "errorKeys": null // }, // "messagesScreenshots": { // "value": [{ // "value": { // "assetToken": "Purple62/v4/08/0a/04/080a0430-c2cc-2577-f491-9e0a09c58ffe/mzl.pbcpzqyg.jpg", // "sortOrder": 1, // "type": null, // "originalFileName": "ios-414-1.jpg" // }, // "isEditable": true, // "isRequired": false, // "errorKeys": null // }, { // "value": { // "assetToken": "Purple71/v4/de/81/aa/de81aa10-64f6-332e-c974-9ee46adab675/mzl.cshkjvwl.jpg", // "sortOrder": 2, // "type": null, // "originalFileName": "ios-414-2.jpg" // }, // "isEditable": true, // "isRequired": false, // "errorKeys": null // }], // "isEditable": true, // "isRequired": false, // "errorKeys": null // }, // "trailer": { // "value": null, // "isEditable": true, // "isRequired": false, // "errorKeys": null // } // } displayFamily?.screenshots?.value.ForEach(screenshot => { var screenshotData = screenshot.value; var data = JObject.FromObject(screenshotData).ToObject <AppScreenshot>(); data.deviceType = displayFamily.name; data.language = dataDetails.language; result.Add(data); }); }); return(result); }