Module:YouTubeSubscribers and Module:YouTubeSubscribers/sandbox: Difference between pages
(Difference between pages)
imported>Tom.Reding m Improve readability of long, compound if-statements |
imported>Wbm1058 424 Failed Dependency – the request failed because it depended on another request and that request failed |
||
| Line 108: | Line 108: | ||
end | end | ||
local pointInTime = pointsInTime[1] | local pointInTime = pointsInTime[1] | ||
if pointInTime and | if pointInTime and pointInTime['datavalue'] and pointInTime['datavalue']['value'] and pointInTime['datavalue']['value']['time'] then | ||
return parseDate(pointInTime['datavalue']['value']['time']) | return parseDate(pointInTime['datavalue']['value']['time']) | ||
end | end | ||
| Line 189: | Line 185: | ||
if #chanIds == 1 then | if #chanIds == 1 then | ||
local chan = chanIds[1] | local chan = chanIds[1] | ||
if chan and | if chan and chan["mainsnak"] and chan["mainsnak"]["datavalue"] and chan["mainsnak"]["datavalue"]["value"] then | ||
return chan["mainsnak"]["datavalue"]["value"] | return chan["mainsnak"]["datavalue"]["value"] | ||
end | end | ||
| Line 250: | Line 242: | ||
if chanId then | if chanId then | ||
local s = newestMatching(e, SUB_COUNT_PID, YT_CHAN_ID_PID, chanId) | local s = newestMatching(e, SUB_COUNT_PID, YT_CHAN_ID_PID, chanId) | ||
if s and | if s and s["mainsnak"] and s['mainsnak']["datavalue"] and s['mainsnak']["datavalue"]["value"] and s['mainsnak']["datavalue"]['value']['amount'] then | ||
subCount = s['mainsnak']["datavalue"]['value']['amount'] | subCount = s['mainsnak']["datavalue"]['value']['amount'] | ||
end | end | ||