mirror of
https://github.com/DeviceFarmer/stf.git
synced 2026-04-18 08:53:23 +02:00
Expose identify functionality. Shows a red screen with important data.
This commit is contained in:
@@ -12,38 +12,39 @@ var aliases = {
|
||||
|
||||
module.exports.applyData = function(device) {
|
||||
var model = device.model
|
||||
var match
|
||||
|
||||
match = deviceData[model]
|
||||
|
||||
if (!match) {
|
||||
if (aliases[model]) {
|
||||
match = deviceData[aliases[model]]
|
||||
}
|
||||
else {
|
||||
if (!match) {
|
||||
model = model.replace(/ /g, '_')
|
||||
match = deviceData[model]
|
||||
if (model) {
|
||||
var match = deviceData[model]
|
||||
|
||||
if (!match) {
|
||||
if (aliases[model]) {
|
||||
match = deviceData[aliases[model]]
|
||||
}
|
||||
else {
|
||||
if (!match) {
|
||||
model = model.replace(/_/g, '')
|
||||
model = model.replace(/ /g, '_')
|
||||
match = deviceData[model]
|
||||
|
||||
if (!match) {
|
||||
model = model.replace(/_/g, '')
|
||||
match = deviceData[model]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (match) {
|
||||
device.name = match.name.id
|
||||
device.releasedAt = match.date
|
||||
device.image = match.image.s.replace(/^small\//, '')
|
||||
}
|
||||
else {
|
||||
log.warn(
|
||||
'Device database does not have a match for device "%s" (model "%s")'
|
||||
, device.serial
|
||||
, device.model
|
||||
)
|
||||
if (match) {
|
||||
device.name = match.name.id
|
||||
device.releasedAt = match.date
|
||||
device.image = match.image.s.replace(/^small\//, '')
|
||||
}
|
||||
else {
|
||||
log.warn(
|
||||
'Device database does not have a match for device "%s" (model "%s")'
|
||||
, device.serial
|
||||
, device.model
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
return device
|
||||
|
||||
Reference in New Issue
Block a user