Module:YouTubeSubscribers: Difference between revisions

Content deleted Content added
new error condition
more error messages
Line 181:
end
if not qid then
error("No qid found for page. Please make a Wikidata item for this article.")
end
local e = mw.wikibase.getEntity(qid)
Line 207:
local chanId = getBestYtChanId(e)
if not chanId then
error("Could not find a single best YouTube account for this item. Add a YouTube channel ID or set the rank of one channel ID to preferred.")
end
local s = newestMatching(e, SUB_COUNT_PID, YT_CHAN_ID_PID, chanId)
Line 240:
subCount = s['mainsnak']["datavalue"]['value']['amount']
end
else
error("Could not find a single best YouTube account for this item. Add a YouTube channel ID or set the rank of one channel ID to preferred")
end
if subCount then
return tonumber(subCount)
else
error("Found an associated YouTube channel ID but could not find suba subscriber count")
end
end