My Little Pony Friendship is Magic Wiki
(record highest index to know when to return N/A)
(Hope I'm doing this right...)
(43 intermediate revisions by 4 users not shown)
Line 1: Line 1:
--Make sure to be consistent with the existing formatting
+
--Make sure to be consistent with the existing formatting and check for errors before saving!
 
--If a title contains double quotes ("), they need to be escaped with a backslash.
--and check for errors before saving!
 
  +
--Include "TBA" for an upcoming episode, but do not include "N/A" for a nonexistent one.
--If a title contains double quotes, they need to be escaped with a backslash.
 
  +
  +
--For non-episode media, you must include the next number in sequence, even if there is no alias to use,
  +
-- and it must be first in the list.
  +
--To create different sequences, start each one after a multiple of 100 (1, 101, 201...).
  +
-- There is no 100, 200, etc.
  +
--If an item is standalone, use 0.
 
local data = {
 
local data = {
--Episodes in release order
+
--Number of seasons in PonyLife
  +
lastEpisodeSeasonPonyLife = 2,
  +
--Pony Life episodes in release order
  +
ponylife = {
  +
"Princess Probz",--1 (season 1)
  +
"The Best of the Worst",
  +
"How Applejack Got Her Hat Back",
  +
"Cute-pocalypse Meow",
  +
"Bad Thing No. 3",
  +
"Pinkie Pie: Hyper-Helper",
  +
"The Trail Less Trotten; Death of a Sales-Pony",
  +
"Bighoof Walking; The Fluttershy Effect",
  +
"The Fast and the Furriest; Disappearing Act",
  +
"Badge of Shame; Discord's Peak",
  +
"A Camping We Will Go; Campfire Stories",
  +
"Friendship Gems; Dol-FIN-ale",
  +
"Potion Mystery; Sick Day",
  +
"Meet Potion Nova!; Pony Surfin' Safari",
  +
"All Bottled Up; All That Jitters",
  +
"I, Cookie; Keynote Pie",
  +
"Ponies of the Moment; One Click Wonder",
  +
"Zound Off; Unboxing Day",
  +
"Don't Look a GIF Horse in the Mouth; The Root of It",
  +
"The Mysterious Voice; The 5 Habits of Highly Effective Ponies",
  +
"Game Knight; Director Spike's Mockumentary",
  +
"Whoof-dunnit; Dear Tabby",
  +
"Pie vs. Pie; Superb Six",
  +
"The Debut Taunt; Flutterdash",
  +
"The Rarity Report; The Great Divide",
  +
"The Great Collide; Sportacular Spectacular Musical Musak-ular",
  +
"Cute Impact; The Crystal Capturing Contraption",--27 (season 2)
  +
"The Comet Section; Cotton Candy-Colored Glasses",
  +
"Close Encounters of the Balloon Kind; The Tiara of Truth",
  +
"Terrorarium; Bubble Trouble",
  +
"Time After Time Capsule; The Great Cowgirl Hat Robbery",
  +
"Planet of the Apps; Back to the Present",
  +
"Magical Mare-story Tour; Life of Pie",
  +
"The Rarest of Occasions; Portal Combat",
  +
"What Goes Updo; Communication Shakedown",
  +
"Lolly-Pop; Little Miss Fortune",
  +
"Playwright or Wrong; The Shows Must Go On",
  +
"The De-Stress Ball; Mad Props",
  +
"Magic is Ahoof; Journey to the Center of the 'Cord",
  +
"One Last Wish; Wild Heart Beats",
  +
},
  +
--FiM episodes in release order
 
episodes = {
 
episodes = {
"Friendship is Magic, part 1",
+
"Friendship is Magic, part 1",--1 (season 1)
 
"Friendship is Magic, part 2",
 
"Friendship is Magic, part 2",
 
"The Ticket Master",
 
"The Ticket Master",
Line 31: Line 82:
 
"Party of One",
 
"Party of One",
 
"The Best Night Ever",
 
"The Best Night Ever",
"The Return of Harmony Part 1",
+
"The Return of Harmony Part 1",--27 (season 2)
 
"The Return of Harmony Part 2",
 
"The Return of Harmony Part 2",
 
"Lesson Zero",
 
"Lesson Zero",
Line 57: Line 108:
 
"A Canterlot Wedding - Part 1",
 
"A Canterlot Wedding - Part 1",
 
"A Canterlot Wedding - Part 2",
 
"A Canterlot Wedding - Part 2",
"The Crystal Empire - Part 1",
+
"The Crystal Empire - Part 1",--53 (season 3)
 
"The Crystal Empire - Part 2",
 
"The Crystal Empire - Part 2",
 
"Too Many Pinkie Pies",
 
"Too Many Pinkie Pies",
Line 70: Line 121:
 
"Games Ponies Play",
 
"Games Ponies Play",
 
"Magical Mystery Cure",
 
"Magical Mystery Cure",
"Princess Twilight Sparkle - Part 1",
+
"Princess Twilight Sparkle - Part 1",--66 (season 4)
 
"Princess Twilight Sparkle - Part 2",
 
"Princess Twilight Sparkle - Part 2",
 
"Castle Mane-ia",
 
"Castle Mane-ia",
Line 96: Line 147:
 
"Twilight's Kingdom - Part 1",
 
"Twilight's Kingdom - Part 1",
 
"Twilight's Kingdom - Part 2",
 
"Twilight's Kingdom - Part 2",
"The Cutie Map - Part 1",
+
"The Cutie Map - Part 1",--92 (season 5)
 
"The Cutie Map - Part 2",
 
"The Cutie Map - Part 2",
 
"Castle Sweet Castle",
 
"Castle Sweet Castle",
Line 122: Line 173:
 
"The Cutie Re-Mark - Part 1",
 
"The Cutie Re-Mark - Part 1",
 
"The Cutie Re-Mark - Part 2",
 
"The Cutie Re-Mark - Part 2",
"The Crystalling - Part 1",
+
"The Crystalling - Part 1",--118 (season 6)
 
"The Crystalling - Part 2",
 
"The Crystalling - Part 2",
 
"The Gift of the Maud Pie",
 
"The Gift of the Maud Pie",
Line 148: Line 199:
 
"To Where and Back Again - Part 1",
 
"To Where and Back Again - Part 1",
 
"To Where and Back Again - Part 2",
 
"To Where and Back Again - Part 2",
"Celestial Advice",
+
"Celestial Advice",--144 (season 7)
 
"All Bottled Up",
 
"All Bottled Up",
 
"A Flurry of Emotions",
 
"A Flurry of Emotions",
Line 174: Line 225:
 
"Shadow Play - Part 1",
 
"Shadow Play - Part 1",
 
"Shadow Play - Part 2",
 
"Shadow Play - Part 2",
"School Daze - Part 1",
+
"School Daze - Part 1",--170 (season 8)
 
"School Daze - Part 2",
 
"School Daze - Part 2",
 
"The Maud Couple",
 
"The Maud Couple",
Line 201: Line 252:
 
"School Raze - Part 2",
 
"School Raze - Part 2",
 
"My Little Pony Best Gift Ever",
 
"My Little Pony Best Gift Ever",
"The Beginning of the End - Part 1",
+
"The Beginning of the End - Part 1",--197 (season 9)
 
"The Beginning of the End - Part 2",
 
"The Beginning of the End - Part 2",
 
"Uprooted",
 
"Uprooted",
Line 227: Line 278:
 
"The Ending of the End - Part 2",
 
"The Ending of the End - Part 2",
 
"The Last Problem",
 
"The Last Problem",
"A-Dressing Memories",
+
"A-Dressing Memories",--223 (season 9 clip show)
 
"Cakes for the Memories",
 
"Cakes for the Memories",
 
"Memnagerie",
 
"Memnagerie",
Line 234: Line 285:
 
"Memories and More",
 
"Memories and More",
 
},
 
},
--Note: brackets denote a string key
+
--Note: in Lua, brackets denote a string key.
  +
--The key must match the page title exactly.
 
aliases = {
 
aliases = {
 
["My Little Pony Equestria Girls"] = {
 
["My Little Pony Equestria Girls"] = {
'eg', 'mlpeg', 'equestria girls'
+
{1, 'Film'}, 'eg', 'mlpeg', 'equestria girls'
 
},
 
},
 
["My Little Pony Equestria Girls: Rainbow Rocks/Animated shorts"] = {
 
["My Little Pony Equestria Girls: Rainbow Rocks/Animated shorts"] = {
'rrshorts'
+
{2, 'Shorts'}, 'rrshorts'
 
},
 
},
 
["My Little Pony Equestria Girls: Rainbow Rocks"] = {
 
["My Little Pony Equestria Girls: Rainbow Rocks"] = {
'egrr', 'mlpegrr', 'rainbow rocks'
+
{3, 'Film'}, 'egrr', 'mlpegrr', 'rainbow rocks'
 
},
 
},
 
["My Little Pony Equestria Girls: Friendship Games/Animated shorts"] = {
 
["My Little Pony Equestria Girls: Friendship Games/Animated shorts"] = {
'fgshorts'
+
{4, 'Shorts'}, 'fgshorts'
 
},
 
},
 
["My Little Pony Equestria Girls: Friendship Games"] = {
 
["My Little Pony Equestria Girls: Friendship Games"] = {
'egfg', 'mlpegfg', 'friendship games'
+
{5, 'Film'}, 'egfg', 'mlpegfg', 'friendship games'
 
},
 
},
 
["My Little Pony Equestria Girls: Legend of Everfree"] = {
 
["My Little Pony Equestria Girls: Legend of Everfree"] = {
'loe', 'egloe', 'mlpegloe', 'legend of everfree'
+
{6, 'Film'}, 'loe', 'egloe', 'mlpegloe', 'legend of everfree'
 
},
 
},
 
["My Little Pony Equestria Girls: Dance Magic"] = {
 
["My Little Pony Equestria Girls: Dance Magic"] = {
'special1', 'egs1', 'dance magic'
+
{7, 'Special'}, 'special1', 'egs1', 'dance magic'
 
},
 
},
 
["My Little Pony Equestria Girls: Movie Magic"] = {
 
["My Little Pony Equestria Girls: Movie Magic"] = {
'special2', 'egs2', 'movie magic'
+
{8, 'Special'}, 'special2', 'egs2', 'movie magic'
 
},
 
},
 
["My Little Pony Equestria Girls: Mirror Magic"] = {
 
["My Little Pony Equestria Girls: Mirror Magic"] = {
'special3', 'egs3', 'mirror magic'
+
{9, 'Special'}, 'special3', 'egs3', 'mirror magic'
 
},
 
},
 
["My Little Pony Equestria Girls: Summertime Shorts"] = {
 
["My Little Pony Equestria Girls: Summertime Shorts"] = {
'ssshorts'
+
{10, 'Shorts'}, 'ssshorts'
 
},
 
},
 
["My Little Pony Equestria Girls: Better Together (season 1)"] = {
 
["My Little Pony Equestria Girls: Better Together (season 1)"] = {
'egbt1'
+
{11, 'Shorts'}, 'egbt1'
 
},
 
},
 
["My Little Pony Equestria Girls: Better Together (season 2)"] = {
 
["My Little Pony Equestria Girls: Better Together (season 2)"] = {
'egbt2'
+
{12, 'Shorts'}, 'egbt2'
 
},
 
},
 
["My Little Pony Equestria Girls: Choose Your Own Ending (season 1)"] = {
 
["My Little Pony Equestria Girls: Choose Your Own Ending (season 1)"] = {
'egcyoe1', 'cyoe1'
+
{13, 'Shorts'}, 'egcyoe1', 'cyoe1'
 
},
 
},
 
["My Little Pony Equestria Girls: Choose Your Own Ending (season 2)"] = {
 
["My Little Pony Equestria Girls: Choose Your Own Ending (season 2)"] = {
'egcyoe2', 'cyoe2'
+
{14, 'Shorts'}, 'egcyoe2', 'cyoe2'
 
},
 
},
 
["My Little Pony Equestria Girls: Forgotten Friendship"] = {
 
["My Little Pony Equestria Girls: Forgotten Friendship"] = {
'egff'
+
{15, 'Special'}, 'egff'
 
},
 
},
 
["My Little Pony Equestria Girls: Rollercoaster of Friendship"] = {
 
["My Little Pony Equestria Girls: Rollercoaster of Friendship"] = {
'egrof'
+
{16, 'Special'}, 'egrof'
 
},
 
},
 
["My Little Pony Equestria Girls: Spring Breakdown"] = {
 
["My Little Pony Equestria Girls: Spring Breakdown"] = {
'egsb'
+
{17, 'Special'}, 'egsb'
 
},
 
},
 
["My Little Pony Equestria Girls: Sunset's Backstage Pass"] = {
 
["My Little Pony Equestria Girls: Sunset's Backstage Pass"] = {
'egsbp'
+
{18, 'Special'}, 'egsbp'
 
},
 
},
 
["My Little Pony Equestria Girls: Holidays Unwrapped"] = {
 
["My Little Pony Equestria Girls: Holidays Unwrapped"] = {
'eghu'
+
{19, 'Special'}, 'eghu'
 
},
 
},
 
["My Little Pony The Movie"] = {
 
["My Little Pony The Movie"] = {
'movie', 'mlptm', 'mlpmovie'
+
{0, 'Film'}, 'movie', 'mlptm', 'mlpmovie'
 
},
 
},
 
["My Little Pony Best Gift Ever"] = {
 
["My Little Pony Best Gift Ever"] = {
'bge', 'mlpbge'
+
{101, 'Special'}, 'bge', 'mlpbge'
 
},
 
},
 
["My Little Pony: Rainbow Roadtrip"] = {
 
["My Little Pony: Rainbow Roadtrip"] = {
'mlprr'
+
{0, 'Special'}, 'mlprr'
 
},
 
},
 
["My Little Pony Friendship is Magic/Animated shorts"] = {
 
["My Little Pony Friendship is Magic/Animated shorts"] = {
'fimshorts'
+
{102, 'Shorts'}, 'fimshorts'
  +
},
  +
["My Little Pony: A New Generation"] = {
  +
{0, 'Film'}, 'movie2', 'mlpang', 'mlpmovie2', 'g5movie', 'a new generation'
  +
},
  +
["My Little Pony Live"] = {
  +
{0, 'Musical'}, 'mlplive'
 
},
 
},
 
},
 
},
  +
--Do not edit below here
 
lookup = {},
 
lookup = {},
lastEpisode = 0
+
lastEpisode = 0,
  +
lastEpisodePonyLife = 0,
  +
lastEpisodeSeason = 9,
 
}
 
}
   
--Construct reverse index and add it as data.reverse
+
--Construct reverse index and add it as data.lookup
local ri = {episodes = {}, aliases = {}}
+
local ri = {ponylife = {}, episodes = {}, aliases = {}, aliasindex = {}}
 
--episodes: index-value
 
--episodes: index-value
  +
-- FiM
 
for i, ep in ipairs(data.episodes) do
 
for i, ep in ipairs(data.episodes) do
 
ri.episodes[ep] = i
 
ri.episodes[ep] = i
 
data.lastEpisode = i
 
data.lastEpisode = i
  +
end
  +
-- Pony Life
  +
for ipl, eppl in ipairs(data.ponylife) do
  +
ri.ponylife[eppl] = ipl
  +
data.lastEpisodePonyLife = ipl
 
end
 
end
 
--aliases: key-value (table of strings)
 
--aliases: key-value (table of strings)
  +
-- also generates index-based lookup
  +
-- Note: to retrieve the index for an item, use data.aliases[name][1][1]
 
for k, as in pairs(data.aliases) do
 
for k, as in pairs(data.aliases) do
 
for j, a in ipairs(as) do
 
for j, a in ipairs(as) do
ri.aliases[a] = k
+
if j ~= 1 then
  +
ri.aliases[a] = k
  +
elseif a[1] ~= 0 then
  +
ri.aliasindex[a[1]] = k
  +
end
 
end
 
end
 
end
 
end

Revision as of 14:38, 24 September 2021

Documentation for this module may be created at Module:Nameconvert/list/doc

--Make sure to be consistent with the existing formatting and check for errors before saving!
--If a title contains double quotes ("), they need to be escaped with a backslash.
--Include "TBA" for an upcoming episode, but do not include "N/A" for a nonexistent one.

--For non-episode media, you must include the next number in sequence, even if there is no alias to use,
--  and it must be first in the list.
--To create different sequences, start each one after a multiple of 100 (1, 101, 201...).
--  There is no 100, 200, etc.
--If an item is standalone, use 0.
local data = {
    --Number of seasons in PonyLife
    lastEpisodeSeasonPonyLife = 2,
    --Pony Life episodes in release order
    ponylife = {
        "Princess Probz",--1 (season 1)
        "The Best of the Worst",
        "How Applejack Got Her Hat Back",
        "Cute-pocalypse Meow",
        "Bad Thing No. 3",
        "Pinkie Pie: Hyper-Helper",
        "The Trail Less Trotten; Death of a Sales-Pony",
        "Bighoof Walking; The Fluttershy Effect",
        "The Fast and the Furriest; Disappearing Act",
        "Badge of Shame; Discord's Peak",
        "A Camping We Will Go; Campfire Stories",
        "Friendship Gems; Dol-FIN-ale",
        "Potion Mystery; Sick Day",
        "Meet Potion Nova!; Pony Surfin' Safari",
        "All Bottled Up; All That Jitters",
        "I, Cookie; Keynote Pie",
        "Ponies of the Moment; One Click Wonder",
        "Zound Off; Unboxing Day",
        "Don't Look a GIF Horse in the Mouth; The Root of It",
        "The Mysterious Voice; The 5 Habits of Highly Effective Ponies",
        "Game Knight; Director Spike's Mockumentary",
        "Whoof-dunnit; Dear Tabby",
        "Pie vs. Pie; Superb Six",
        "The Debut Taunt; Flutterdash",
        "The Rarity Report; The Great Divide",
        "The Great Collide; Sportacular Spectacular Musical Musak-ular",
        "Cute Impact; The Crystal Capturing Contraption",--27 (season 2)
        "The Comet Section; Cotton Candy-Colored Glasses",
        "Close Encounters of the Balloon Kind; The Tiara of Truth",
        "Terrorarium; Bubble Trouble",
        "Time After Time Capsule; The Great Cowgirl Hat Robbery",
        "Planet of the Apps; Back to the Present",
        "Magical Mare-story Tour; Life of Pie",
        "The Rarest of Occasions; Portal Combat",
        "What Goes Updo; Communication Shakedown",
        "Lolly-Pop; Little Miss Fortune",
        "Playwright or Wrong; The Shows Must Go On",
        "The De-Stress Ball; Mad Props",
        "Magic is Ahoof; Journey to the Center of the 'Cord",
        "One Last Wish; Wild Heart Beats",
    },
    --FiM episodes in release order
    episodes = {
        "Friendship is Magic, part 1",--1 (season 1)
        "Friendship is Magic, part 2",
        "The Ticket Master",
        "Applebuck Season",
        "Griffon the Brush Off",
        "Boast Busters",
        "Dragonshy",
        "Look Before You Sleep",
        "Bridle Gossip",
        "Swarm of the Century",
        "Winter Wrap Up",
        "Call of the Cutie",
        "Fall Weather Friends",
        "Suited For Success",
        "Feeling Pinkie Keen",
        "Sonic Rainboom",
        "Stare Master",
        "The Show Stoppers",
        "A Dog and Pony Show",
        "Green Isn't Your Color",
        "Over a Barrel",
        "A Bird in the Hoof",
        "The Cutie Mark Chronicles",
        "Owl's Well That Ends Well",
        "Party of One",
        "The Best Night Ever",
        "The Return of Harmony Part 1",--27 (season 2)
        "The Return of Harmony Part 2",
        "Lesson Zero",
        "Luna Eclipsed",
        "Sisterhooves Social",
        "The Cutie Pox",
        "May the Best Pet Win!",
        "The Mysterious Mare Do Well",
        "Sweet and Elite",
        "Secret of My Excess",
        "Hearth's Warming Eve",
        "Family Appreciation Day",
        "Baby Cakes",
        "The Last Roundup",
        "The Super Speedy Cider Squeezy 6000",
        "Read It and Weep",
        "Hearts and Hooves Day",
        "A Friend in Deed",
        "Putting Your Hoof Down",
        "It's About Time",
        "Dragon Quest",
        "Hurricane Fluttershy",
        "Ponyville Confidential",
        "MMMystery on the Friendship Express",
        "A Canterlot Wedding - Part 1",
        "A Canterlot Wedding - Part 2",
        "The Crystal Empire - Part 1",--53 (season 3)
        "The Crystal Empire - Part 2",
        "Too Many Pinkie Pies",
        "One Bad Apple",
        "Magic Duel",
        "Sleepless in Ponyville",
        "Wonderbolts Academy",
        "Apple Family Reunion",
        "Spike at Your Service",
        "Keep Calm and Flutter On",
        "Just for Sidekicks",
        "Games Ponies Play",
        "Magical Mystery Cure",
        "Princess Twilight Sparkle - Part 1",--66 (season 4)
        "Princess Twilight Sparkle - Part 2",
        "Castle Mane-ia",
        "Daring Don't",
        "Flight to the Finish",
        "Power Ponies",
        "Bats!",
        "Rarity Takes Manehattan",
        "Pinkie Apple Pie",
        "Rainbow Falls",
        "Three's A Crowd",
        "Pinkie Pride",
        "Simple Ways",
        "Filli Vanilli",
        "Twilight Time",
        "It Ain't Easy Being Breezies",
        "Somepony to Watch Over Me",
        "Maud Pie (episode)",
        "For Whom the Sweetie Belle Toils",
        "Leap of Faith",
        "Testing Testing 1, 2, 3",
        "Trade Ya!",
        "Inspiration Manifestation",
        "Equestria Games",
        "Twilight's Kingdom - Part 1",
        "Twilight's Kingdom - Part 2",
        "The Cutie Map - Part 1",--92 (season 5)
        "The Cutie Map - Part 2",
        "Castle Sweet Castle",
        "Bloom & Gloom",
        "Tanks for the Memories",
        "Appleoosa's Most Wanted",
        "Make New Friends but Keep Discord",
        "The Lost Treasure of Griffonstone",
        "Slice of Life",
        "Princess Spike",
        "Party Pooped",
        "Amending Fences",
        "Do Princesses Dream of Magic Sheep?",
        "Canterlot Boutique",
        "Rarity Investigates!",
        "Made in Manehattan",
        "Brotherhooves Social",
        "Crusaders of the Lost Mark",
        "The One Where Pinkie Pie Knows",
        "Hearthbreakers",
        "Scare Master",
        "What About Discord?",
        "The Hooffields and McColts",
        "The Mane Attraction",
        "The Cutie Re-Mark - Part 1",
        "The Cutie Re-Mark - Part 2",
        "The Crystalling - Part 1",--118 (season 6)
        "The Crystalling - Part 2",
        "The Gift of the Maud Pie",
        "On Your Marks",
        "Gauntlet of Fire",
        "No Second Prances",
        "Newbie Dash",
        "A Hearth's Warming Tail",
        "The Saddle Row Review",
        "Applejack's \"Day\" Off",
        "Flutter Brutter",
        "Spice Up Your Life",
        "Stranger Than Fan Fiction",
        "The Cart Before the Ponies",
        "28 Pranks Later",
        "The Times They Are A Changeling",
        "Dungeons & Discords",
        "Buckball Season",
        "The Fault in Our Cutie Marks",
        "Viva Las Pegasus",
        "Every Little Thing She Does",
        "P.P.O.V. (Pony Point of View)",
        "Where the Apple Lies",
        "Top Bolt",
        "To Where and Back Again - Part 1",
        "To Where and Back Again - Part 2",
        "Celestial Advice",--144 (season 7)
        "All Bottled Up",
        "A Flurry of Emotions",
        "Rock Solid Friendship",
        "Fluttershy Leans In",
        "Forever Filly",
        "Parental Glideance",
        "Hard to Say Anything",
        "Honest Apple",
        "A Royal Problem",
        "Not Asking for Trouble",
        "Discordant Harmony",
        "The Perfect Pear",
        "Fame and Misfortune",
        "Triple Threat",
        "Campfire Tales",
        "To Change a Changeling",
        "Daring Done?",
        "It Isn't the Mane Thing About You",
        "A Health of Information",
        "Marks and Recreation",
        "Once Upon a Zeppelin",
        "Secrets and Pies",
        "Uncommon Bond",
        "Shadow Play - Part 1",
        "Shadow Play - Part 2",
        "School Daze - Part 1",--170 (season 8)
        "School Daze - Part 2",
        "The Maud Couple",
        "Fake It 'Til You Make It",
        "Grannies Gone Wild",
        "Surf and or Turf",
        "Horse Play",
        "The Parent Map",
        "Non-Compete Clause",
        "The Break Up Break Down",
        "Molt Down",
        "Marks for Effort",
        "The Mean 6",
        "A Matter of Principals",
        "The Hearth's Warming Club",
        "Friendship University",
        "The End in Friend",
        "Yakity-Sax",
        "Road to Friendship",
        "The Washouts",
        "A Rockhoof and a Hard Place",
        "What Lies Beneath",
        "Sounds of Silence",
        "Father Knows Beast",
        "School Raze - Part 1",
        "School Raze - Part 2",
        "My Little Pony Best Gift Ever",
        "The Beginning of the End - Part 1",--197 (season 9)
        "The Beginning of the End - Part 2",
        "Uprooted",
        "Sparkle's Seven",
        "The Point of No Return",
        "Common Ground",
        "She's All Yak",
        "Frenemies",
        "Sweet and Smoky",
        "Going to Seed",
        "Student Counsel",
        "The Last Crusade",
        "Between Dark and Dawn",
        "The Last Laugh",
        "2, 4, 6, Greaaat",
        "A Trivial Pursuit",
        "The Summer Sun Setback",
        "She Talks to Angel",
        "Dragon Dropped",
        "A Horse Shoe-In",
        "Daring Doubt",
        "Growing Up is Hard to Do",
        "The Big Mac Question",
        "The Ending of the End - Part 1",
        "The Ending of the End - Part 2",
        "The Last Problem",
        "A-Dressing Memories",--223 (season 9 clip show)
        "Cakes for the Memories",
        "Memnagerie",
        "Deep Tissue Memories",
        "Harvesting Memories",
        "Memories and More",
    },
    --Note: in Lua, brackets denote a string key.
    --The key must match the page title exactly.
    aliases = {
        ["My Little Pony Equestria Girls"] = {
            {1, 'Film'}, 'eg', 'mlpeg', 'equestria girls'
        },
        ["My Little Pony Equestria Girls: Rainbow Rocks/Animated shorts"] = {
            {2, 'Shorts'}, 'rrshorts'
        },
        ["My Little Pony Equestria Girls: Rainbow Rocks"] = {
            {3, 'Film'}, 'egrr', 'mlpegrr', 'rainbow rocks'
        },
        ["My Little Pony Equestria Girls: Friendship Games/Animated shorts"] = {
            {4, 'Shorts'}, 'fgshorts'
        },
        ["My Little Pony Equestria Girls: Friendship Games"] = {
            {5, 'Film'}, 'egfg', 'mlpegfg', 'friendship games'
        },
        ["My Little Pony Equestria Girls: Legend of Everfree"] = {
            {6, 'Film'}, 'loe', 'egloe', 'mlpegloe', 'legend of everfree'
        },
        ["My Little Pony Equestria Girls: Dance Magic"] = {
            {7, 'Special'}, 'special1', 'egs1', 'dance magic'
        },
        ["My Little Pony Equestria Girls: Movie Magic"] = {
            {8, 'Special'}, 'special2', 'egs2', 'movie magic'
        },
        ["My Little Pony Equestria Girls: Mirror Magic"] = {
            {9, 'Special'}, 'special3', 'egs3', 'mirror magic'
        },
        ["My Little Pony Equestria Girls: Summertime Shorts"] = {
            {10, 'Shorts'}, 'ssshorts'
        },
        ["My Little Pony Equestria Girls: Better Together (season 1)"] = {
            {11, 'Shorts'}, 'egbt1'
        },
        ["My Little Pony Equestria Girls: Better Together (season 2)"] = {
            {12, 'Shorts'}, 'egbt2'
        },
        ["My Little Pony Equestria Girls: Choose Your Own Ending (season 1)"] = {
            {13, 'Shorts'}, 'egcyoe1', 'cyoe1'
        },
        ["My Little Pony Equestria Girls: Choose Your Own Ending (season 2)"] = {
            {14, 'Shorts'}, 'egcyoe2', 'cyoe2'
        },
        ["My Little Pony Equestria Girls: Forgotten Friendship"] = {
            {15, 'Special'}, 'egff'
        },
        ["My Little Pony Equestria Girls: Rollercoaster of Friendship"] = {
            {16, 'Special'}, 'egrof'
        },
        ["My Little Pony Equestria Girls: Spring Breakdown"] = {
            {17, 'Special'}, 'egsb'
        },
        ["My Little Pony Equestria Girls: Sunset's Backstage Pass"] = {
            {18, 'Special'}, 'egsbp'
        },
        ["My Little Pony Equestria Girls: Holidays Unwrapped"] = {
            {19, 'Special'}, 'eghu'
        },
        ["My Little Pony The Movie"] = {
            {0, 'Film'}, 'movie', 'mlptm', 'mlpmovie'
        },
        ["My Little Pony Best Gift Ever"] = {
            {101, 'Special'}, 'bge', 'mlpbge'
        },
        ["My Little Pony: Rainbow Roadtrip"] = {
            {0, 'Special'}, 'mlprr'
        },
        ["My Little Pony Friendship is Magic/Animated shorts"] = {
            {102, 'Shorts'}, 'fimshorts'
        },
        ["My Little Pony: A New Generation"] = {
            {0, 'Film'}, 'movie2', 'mlpang', 'mlpmovie2', 'g5movie', 'a new generation'
        },
        ["My Little Pony Live"] = {
            {0, 'Musical'}, 'mlplive'
        },
    },
    --Do not edit below here
    lookup = {},
    lastEpisode = 0,
    lastEpisodePonyLife = 0,
    lastEpisodeSeason = 9,
}

--Construct reverse index and add it as data.lookup
local ri = {ponylife = {}, episodes = {}, aliases = {}, aliasindex = {}}
--episodes: index-value
--  FiM
for i, ep in ipairs(data.episodes) do
    ri.episodes[ep] = i
    data.lastEpisode = i
end
--  Pony Life
for ipl, eppl in ipairs(data.ponylife) do
    ri.ponylife[eppl] = ipl
    data.lastEpisodePonyLife = ipl
end
--aliases: key-value (table of strings)
--  also generates index-based lookup
--  Note: to retrieve the index for an item, use data.aliases[name][1][1]
for k, as in pairs(data.aliases) do
    for j, a in ipairs(as) do
        if j ~= 1 then
            ri.aliases[a] = k
        elseif a[1] ~= 0 then
            ri.aliasindex[a[1]] = k
        end
    end
end
data.lookup = ri

return data