Module:Setlist/Songs
Jump to navigation
Jump to search
Documentation for this module may be created at Module:Setlist/Songs/doc
local songs = {
["Implicit Demand For Proof"] = {"Twenty One Pilots"},
["Fall Away"] = {"Twenty One Pilots"},
["The Pantaloon"] = {"Twenty One Pilots"},
["Addict With A Pen"] = {"Twenty One Pilots"},
["Friend, Please"] = {"Twenty One Pilots"},
["March To The Sea"] = {"Twenty One Pilots"},
["Johnny Boy"] = {"Twenty One Pilots"},
["Oh Ms Believer"] = {"Twenty One Pilots"},
["Air Catcher"] = {"Twenty One Pilots"},
["Trapdoor"] = {"Twenty One Pilots"},
["A Car, A Torch, A Death"] = {"Twenty One Pilots"},
["Taxi Cab"] = {"Twenty One Pilots"},
["Before You Start Your Day"] = {"Twenty One Pilots"},
["Isle Of Flightless Birds"] = {"Twenty One Pilots"},
["Guns For Hands"] = {"Regional At Best", "Vessel"},
["Holding On To You"] = {"Regional At Best", "Vessel"},
["Ode To Sleep"] = {"Regional At Best", "Vessel"},
["Slowtown"] = {"Regional At Best"},
["Car Radio"] = {"Regional At Best", "Vessel"},
["Forest"] = {"Regional At Best"},
["Glowing Eyes"] = {"Regional At Best"},
["Kitchen Sink"] = {"Regional At Best"},
["Anathema"] = {"Regional At Best"},
["Lovely"] = {"Regional At Best"},
["Ruby"] = {"Regional At Best"},
["Trees"] = {"Regional At Best", "Vessel"},
["Be Concerned"] = {"Regional At Best"},
["Clear"] = {"Regional At Best"},
["Migraine"] = {"Vessel"},
["House Of Gold"] = {"Vessel"},
["Semi-Automatic"] = {"Vessel"},
["Screen"] = {"Vessel"},
["The Run And Go"] = {"Vessel"},
["Fake You Out"] = {"Vessel"},
["Truce"] = {"Vessel"},
["Heavydirtysoul"] = {"Blurryface"},
["Stressed Out"] = {"Blurryface"},
["Ride"] = {"Blurryface"},
["Fairly Local"] = {"Blurryface"},
["Tear In My Heart"] = {"Blurryface"},
["Lane Boy"] = {"Blurryface"},
["The Judge"] = {"Blurryface"},
["Doubt"] = {"Blurryface"},
["Polarize"] = {"Blurryface"},
["We Don't Believe What's On TV"] = {"Blurryface"},
["Message Man"] = {"Blurryface"},
["Hometown"] = {"Blurryface"},
["Not Today"] = {"Blurryface"},
["Goner"] = {"Blurryface"},
["Jumpsuit"] = {"Trench"},
["Levitate"] = {"Trench"},
["Morph"] = {"Trench"},
["My Blood"] = {"Trench"},
["Chlorine"] = {"Trench"},
["Smithereens"] = {"Trench"},
["Neon Gravestones"] = {"Trench"},
["The Hype"] = {"Trench"},
["Nico And The Niners"] = {"Trench"},
["Cut My Lip"] = {"Trench"},
["Bandito"] = {"Trench"},
["Pet Cheetah"] = {"Trench"},
["Legend"] = {"Trench"},
["Leave The City"] = {"Trench"},
["Good Day"] = {"Scaled And Icy"},
["Choker"] = {"Scaled And Icy"},
["Shy Away"] = {"Scaled And Icy"},
["The Outside"] = {"Scaled And Icy"},
["Saturday"] = {"Scaled And Icy"},
["Never Take It"] = {"Scaled And Icy"},
["Mulberry Street"] = {"Scaled And Icy"},
["Formidable"] = {"Scaled And Icy"},
["Bounce Man"] = {"Scaled And Icy"},
["No Chances"] = {"Scaled And Icy"},
["Redecorate"] = {"Scaled And Icy"},
["Overcompensate"] = {"Clancy"},
["Next Semester"] = {"Clancy"},
["Backslide"] = {"Clancy"},
["Midwest Indigo"] = {"Clancy"},
["Routines In The Night"] = {"Clancy"},
["Vignette"] = {"Clancy"},
["The Craving (Jenna's Version)"] = {"Clancy"},
["Lavish"] = {"Clancy"},
["Navigating"] = {"Clancy"},
["Snap Back"] = {"Clancy"},
["Oldies Station"] = {"Clancy"},
["At The Risk Of Feeling Dumb"] = {"Clancy"},
["Paladin Strait"] = {"Clancy"},
["Time To Say Goodbye"] = {"Johnny Boy"}
}
-- Определяем цвета альбомов
local albumColors = {
["Twenty One Pilots"] = "#87B22A",
["Regional At Best"] = "#21ABC6",
["Vessel"] = "#d5d8dd",
["Blurryface"] = "#dc4747",
["Trench"] = "#ffcc4d",
["Scaled And Icy"] = "#b3e7fa",
["Johnny Boy"] = "#CECECE",
}
-- Определяем ссылки для альбомов
local albumLinks = {
["Twenty One Pilots"] = "Twenty One Pilots (album)",
["Regional At Best"] = "Regional At Best",
["Vessel"] = "Vessel (album)",
["Blurryface"] = "Blurryface (album)",
["Trench"] = "Trench (album)",
["Scaled And Icy"] = "Scaled And Icy",
["Johnny Boy"] = "Johnny Boy",
}
-- Вспомогательная функция для проверки наличия элемента в таблице
local function tableContains(table, element)
for _, value in ipairs(table) do
if value == element then
return true
end
end
return false
end
-- Функция для фильтрации песен на основе года в названии страницы
local function filterSongsByPageName(songs, pageName)
local filteredSongs = {}
-- Проверяем, заканчивается ли название страницы на .2009, .2010, .2011 или .2012
local isPre2013 = pageName:match("%.20(09|10|11|12)$")
for song, albums in pairs(songs) do
local filteredAlbums = {}
for _, album in ipairs(albums) do
if isPre2013 then
-- До 2013 года: песни из Vessel и Regional At Best показываем только в Regional At Best
if album == "Vessel" and tableContains(albums, "Regional At Best") then
-- Пропускаем Vessel, если песня есть в Regional At Best
elseif album == "Regional At Best" then
table.insert(filteredAlbums, album)
else
table.insert(filteredAlbums, album)
end
else
-- После 2012 года: песни из Regional At Best и Vessel показываем только в Vessel
if album == "Regional At Best" and tableContains(albums, "Vessel") then
-- Пропускаем Regional At Best, если песня есть в Vessel
elseif album == "Vessel" then
table.insert(filteredAlbums, album)
else
table.insert(filteredAlbums, album)
end
end
end
filteredSongs[song] = filteredAlbums
end
return filteredSongs
end
-- Основная функция для возврата данных
local function getData(frame)
-- Получаем название текущей страницы
local pageName = frame:getParent():getTitle()
local filteredSongs = filterSongsByPageName(songs, pageName)
return {
songs = filteredSongs,
albumColors = albumColors,
albumLinks = albumLinks,
}
end
return {
getData = getData,
songs = songs,
albumColors = albumColors,
albumLinks = albumLinks,
}