TDAW get similar request and tests.

This commit is contained in:
mjrode
2019-03-03 01:46:46 -06:00
parent 6645729479
commit e5b04f61db
13 changed files with 247 additions and 21 deletions
+2
View File
@@ -2,6 +2,7 @@ import express from 'express';
import {json, urlencoded} from 'body-parser';
import {sequelize} from './db/models';
import plex from './routes/plex.route';
import tdaw from './routes/tdaw.route';
export default () => {
const server = express();
@@ -18,6 +19,7 @@ export default () => {
// Set up routes
server.use('/plex', plex);
server.use('/tdaw', tdaw);
return server;
};
+5 -1
View File
@@ -3,7 +3,11 @@ import helpers from '../helpers';
const similarMedia = async (req, res) => {
try {
const response = await tdawApi.similarMedia();
console.log('I MADE IT');
const {mediaName} = req.query;
const {mediaType} = req.query;
console.log(mediaName, mediaType);
const response = await tdawApi.similarMedia(mediaName, mediaType);
res.json(response);
} catch (error) {
helpers.handleError(res, tdawApi.name);
+7 -5
View File
@@ -1,25 +1,27 @@
import config from '../../../config';
import helpers from '../helpers';
const mediaUrl = function(mediaName, type) {
const tdawMediaUrl = function(mediaName, mediaType) {
return {
host: config.tdaw.tdawApiUrl,
queryParams: {
q: mediaName,
k: config.tdaw.token,
info: 1,
type,
mediaType,
},
};
};
const similarMedia = async function() {
const similarMedia = async function(mediaName, mediaType) {
try {
const urlParams = mediaUrl();
const urlParams = tdawMediaUrl(mediaName, mediaType);
const mediaUrl = helpers.buildUrl(urlParams);
console.log(mediaUrl);
const response = await helpers.request(mediaUrl);
return response;
} catch (error) {
console.log(error);
return {
code: error.status,
message: error.statusText,
@@ -28,4 +30,4 @@ const similarMedia = async function() {
}
};
export default {similarMedia, mediaUrl};
export default {similarMedia, tdawMediaUrl};
+200
View File
@@ -0,0 +1,200 @@
export default {
newGirl: {
Similar: {
Info: [
{
Name: 'New Girl',
Type: 'show',
wTeaser:
'\nNew Girl is an American television sitcom that premiered on Fox on September 20, 2011. Developed by Elizabeth Meriwether under the working title Chicks & Dicks, the series revolves around a kooky teacher, Jess (Zooey Deschanel), after she moves into a Los Angeles loft with three men, Nick (Jake Johnson), Schmidt (Max Greenfield), and Winston (Lamorne Morris); Jess\' best friend Cece (Hannah Simone) is also part of the series. The show combines comedy and drama elements as the characters, who are in their early thirties, deal with maturing relationships and career choices.\nProduced in Los Angeles as a single-camera comedy, New Girl is an ensemble show aimed at a general audience. Most episodes are anchored around Jess, who according to series creator, Meriwether, would have played a side character on other shows. The show\'s first marketing push was on Zooey Deschanel and the promotional tagline "Simply Adorkable", a portmanteau of "adorable" and "dork". The producers rejected early criticism of Jess\'s girlishness, insisting that Jess was not meant to be emblematic of all women. Instead, they aim to portray realistic, emotionally driven characters, and to approach the show from that angle rather than simply firing off punchlines.\n',
wUrl: 'http://en.wikipedia.org/wiki/The_New_Girl_(TV_series)',
yUrl: 'https://www.youtube-nocookie.com/embed/h8Hfph2wXIY',
yID: 'h8Hfph2wXIY',
},
],
Results: [
{
Name: 'Happy Endings',
Type: 'show',
wTeaser:
"Happy Endings is an American sitcom television series that ran on ABC from April 13, 2011, to May 3, 2013. The single-camera ensemble comedy originally aired as a mid-season replacement with a one-hour premiere of two back-to-back episodes starting at 9:30 pm ET/PT. In the weeks that followed, the show continued to air back-to-back episodes that began airing at 10 pm ET/PT. The show was created by David Caspe, who along with Jonathan Groff (previously a showrunner on Scrubs) served as the show's executive producers and showrunners.\nOn May 10, 2013, Happy Endings was canceled by ABC after three seasons. ABC's erratic scheduling of the third season, perhaps causing the season's lower ratings and subsequent cancellation, was called one of the \"worst TV decisions\" of the 201213 television season by the pop-culture website Vulture.",
wUrl: 'http://en.wikipedia.org/wiki/Happy_Endings_(TV_series)',
yUrl: 'https://www.youtube-nocookie.com/embed/MrQhBQT16hw',
yID: 'MrQhBQT16hw',
},
{
Name: 'The Mindy Project',
Type: 'show',
wTeaser:
"\nThe Mindy Project is an American romantic comedy television series that premiered on Fox on September 25, 2012. It then began airing on Hulu on September 15, 2015. The series, created by and starring Mindy Kaling, was co-produced by Universal Television and 3 Arts Entertainment.\nOn March 29, 2017, The Mindy Project was renewed for a sixth and final season, which premiered on September 12, 2017, and concluded on November 14, 2017.The series follows obstetrician/gynecologist Mindy Lahiri (Mindy Kaling) as she tries to balance her personal and professional life, surrounded by quirky co-workers in a small medical practice in New York City. The character was inspired by Kaling's own mother, an OB/GYN. Mindy explores life with the help of her co-workers: Danny Castellano, her best friend and love interest, whose religious sensibilities occasionally cause some tension; Jeremy Reed, an English physician who manages the practice; Peter Prentice, another physician who was a fraternity jock while attending Dartmouth; Morgan Tookers, a wacky, yet loveable registered nurse and an ex-con; Tamra Webb, a blunt nurse; and Beverley, the libidinous older office receptionist.",
wUrl: 'http://en.wikipedia.org/wiki/The_Mindy_Project',
yUrl: 'https://www.youtube-nocookie.com/embed/Xv01_WCOz8k',
yID: 'Xv01_WCOz8k',
},
{
Name: 'Up All Night',
Type: 'show',
wTeaser:
"\nUp All Night is an American sitcom created by Emily Spivey that ran on NBC from September 14, 2011 to December 13, 2012. The show stars Christina Applegate, Will Arnett, Jennifer Hall, Luka Jones, and Maya Rudolph.The series follows Reagan (Christina Applegate), a producer on her best friend Ava's (Maya Rudolph) talk show, and Chris (Will Arnett), Reagan's supportive, stay-at-home husband, as they try to adjust to life with their newborn baby Amy.\nThe second season focuses on the cancellation of Ava's talk show, and Chris starting a business with Reagan's brother Scott (Luka Jones). Reagan also struggles to adjust to her new role as a stay-at-home mother.\nThe series was based on creator Emily Spivey's life when she went back to working on Saturday Night Live after giving birth to a baby boy. Due to the nature of her job, she was required to take care of the baby and work late nights. She decided she wanted to make a show based on those extremes. NBC executives were \"supportive and excited\" for the new series. On February 1, 2011, Up All Night received a pilot order, written by creator Spivey and directed by James Griffiths, under the title Alpha Mom. The series was officially picked up for 13 episodes at the NBC upfronts on May 15, 2011 under its final title, Up All Night.",
wUrl: 'https://en.wikipedia.org/wiki/Up_All_Night_(TV_series)',
yUrl: 'https://www.youtube-nocookie.com/embed/t9QtXGirWf0',
yID: 't9QtXGirWf0',
},
{
Name: 'Suburgatory',
Type: 'show',
wTeaser:
'Suburgatory is an American sitcom television series created by Emily Kapnek, creator of Nickelodeon\'s As Told by Ginger, that aired on ABC from September 28, 2011 to May 14, 2014. The series originally aired on Wednesday nights at 8:30/7:30 Central following The Middle. The title is a portmanteau, devised by former CNN Senior Producer Linda Keenan, of the words "suburban" and "purgatory". On May 9, 2014, Suburgatory was canceled by ABC after three seasons.The series follows George Altman, a single father who decides to get away from New York City to the suburbs so he can give his teenage daughter, Tessa, a better life. However, their move to the suburbs has the daughter wondering if they just entered the world of The Stepford Wives after they see how eerily perfect their new locale is, right down to the neighbors who welcome them into the cul-de-sac.\n',
wUrl: 'http://en.wikipedia.org/wiki/Suburgatory',
yUrl: 'https://www.youtube-nocookie.com/embed/f8KQCgeiXps',
yID: 'f8KQCgeiXps',
},
{
Name: '2 Broke Girls',
Type: 'show',
wTeaser:
"\n2 Broke Girls is an American television sitcom that aired on CBS from September 19, 2011 to April 17, 2017. The series was produced for Warner Bros. Television and created by Michael Patrick King and Whitney Cummings. Set in the Williamsburg neighborhood of Brooklyn, New York City, the show's plot follows the lives of friends Max Black (Kat Dennings) and Caroline Channing (Beth Behrs). Whereas Caroline was raised as the daughter of a billionaire, Max grew up in poverty, resulting in differing perspectives on life, although together they work in a local diner while attempting to raise funds to start a cupcake business.\nSince its debut, the series has received a polarized response from critics and audiences alike. The on-screen chemistry between the two lead characters has been praised, while others have condemned the show's reliance on sexualized humor and stereotypes. It was nominated for three 2012 Emmy Awards, winning for Art Direction. During the course of the series, 138 episodes of 2 Broke Girls aired over six seasons.",
wUrl: 'http://en.wikipedia.org/wiki/2_Broke_Girls',
yUrl: 'https://www.youtube-nocookie.com/embed/aUkwxpMVW9M',
yID: 'aUkwxpMVW9M',
},
{
Name: 'Whitney',
Type: 'show',
wTeaser:
'Whitney is an American sitcom that ran on NBC from September 22, 2011, to March 27, 2013. The series originally aired in the 9:30 pm (E/P)/8:30 pm (C) Thursday night timeslot. The show stars Whitney Cummings and is based on her real-life experience and her comedy routines. On September 25, 2011, the pilot of Whitney was multipurposed on various Universal Television networks, including Oxygen, E!, Style, and Bravo.\nOn May 9, 2013, Whitney was canceled by NBC after two seasons.The series follows Whitney Cummings, as she portrays a fictionalized version of herself, and her very supportive live-in boyfriend, Alex. Even though the two have decided that they will not commit to marriage, she does question how committed they are in their 3-year relationship and tries to go as far to prove a point. She begins to fear what she sees as "relationship boredom" and worries what will happen next that could possibly end their relationship. Because of what she sees and hears around her involving other relationships, she uses unconventional methods to keep the romantic flames glowing with Alex, often seeking the help of her close friends. The sitcom is set in Chicago.',
wUrl: 'http://en.wikipedia.org/wiki/Whitney_(TV_series)',
yUrl: 'https://www.youtube-nocookie.com/embed/-NZOLf2CDok',
yID: '-NZOLf2CDok',
},
{
Name: 'The New Normal',
Type: 'show',
wTeaser:
'The New Normal is an American sitcom that aired on NBC from September 10, 2012, to April 2, 2013. The series was created and principally written by Ryan Murphy and Ali Adler. The storyline follows wealthy gay couple Bryan (Andrew Rannells) and David (Justin Bartha), who are living in Los Angeles. Deciding to have a child, they choose a surrogate mother, Goldie Clemmons (Georgia King), who moves into their home with her 9-year-old daughter Shania (Bebe Wood).\nThe series aired Tuesdays at 9:30 pm Eastern/8:30 pm Central after the new comedy series Go On, as part of the 201213 United States network television schedule. On October 2, 2012, NBC commissioned a full season of The New Normal.',
wUrl: 'http://en.wikipedia.org/wiki/The_New_Normal_(TV_series)',
yUrl: 'https://www.youtube-nocookie.com/embed/pgS_7ZSHqE4',
yID: 'pgS_7ZSHqE4',
},
{
Name: 'Cougar Town',
Type: 'show',
wTeaser:
"\nCougar Town is an American television sitcom that ran for 102 episodes over six seasons, from September 23, 2009 until March 31, 2015. The first three seasons aired on ABC, with the series moving to TBS for the last three seasons. The pilot episode was broadcast after Modern Family. ABC officially gave the series a full season pickup on October 8, 2009.The show was created by Bill Lawrence and Kevin Biegel and was produced by Doozer and Coquette Productions in association with ABC Studios. Filming took place at Culver Studios in Culver City, California. The pilot episode achieved 11.28 million viewers. Season 2 premiered on September 22, 2010, with 8.35 million viewers. Season 3, consisting of 15 episodes, was originally slated to premiere in November 2011 but, because of ABC's promotion of the ill-fated Man Up!, it premiered on February 14, 2012. Following the Season 3 finale, it was announced that TBS had purchased the rights to the series for an additional 15-episode season, to air in 2013, with options for additional seasons. On March 25, 2013, TBS renewed the series for a fifth season of 13 episodes, which premiered on January 7, 2014. On May 10, 2014, TBS renewed Cougar Town for a sixth and final season. Season six premiered on January 6, 2015, and the series concluded on March 31, 2015.\n",
wUrl: 'http://en.wikipedia.org/wiki/Cougar_Town',
yUrl: 'https://www.youtube-nocookie.com/embed/PcbSUvT51I8',
yID: 'PcbSUvT51I8',
},
{
Name: 'Raising Hope',
Type: 'show',
wTeaser:
'Raising Hope is an American sitcom that aired from September 21, 2010 to April 4, 2014, on Fox. Following its first season, the show received two nominations at the 63rd Primetime Emmy Awards. Martha Plimpton was nominated for Outstanding Lead Actress in a Comedy Series, and Cloris Leachman was nominated for Outstanding Guest Actress in a Comedy Series.\nPlimpton also won the 2011 Satellite Award for Best Actress in a Comedy Series.\nThe fourth season premiered Friday, November 15, 2013, at 9:00 pm Eastern/8:00 pm Central with back-to-back episodes. On March 10, 2014, Fox canceled Raising Hope, and the series finale aired April 4, 2014.James "Jimmy" Chance is a 23-year-old, living in the surreal fictional town of Natesville, who impregnates a serial killer during a one-night stand. Earning custody of his daughter, Hope, after the mother is sentenced to death, Jimmy relies on his oddball but well-intentioned family for support in raising the child.\n',
wUrl: 'http://en.wikipedia.org/wiki/Raising_Hope',
yUrl: 'https://www.youtube-nocookie.com/embed/LQ81uDSWjGc',
yID: 'LQ81uDSWjGc',
},
{
Name: 'Go On',
Type: 'show',
wTeaser:
"Go On is an American sitcom that aired on NBC from August 8, 2012 to April 11, 2013. The series starred Matthew Perry as Ryan King, a sports talk radio host trying to move on from the death of his wife. Go On was created by Scott Silveri and was given a series order on April 20, 2012. A preview episode aired following the Olympics coverage on August 8. The series premiered on September 11, 2012, in its normal Tuesday timeslot at 9:00 pm Eastern/8:00 pm Central after The Voice.On October 2, 2012, NBC ordered a full season of Go On, to contain 22 episodes. On May 10, 2013, NBC announced that the series had been cancelled after one season.NBC ordered Go On to pilot in January 2012. Matthew Perry was announced as the series' lead actor on March 1. Creator Scott Silveri, who worked with Perry on Friends, claims he subconsciously wrote the part for him.\n",
wUrl: 'https://en.wikipedia.org/wiki/Go_On_(TV_series)',
yUrl: 'https://www.youtube-nocookie.com/embed/oVZevJr-WQ8',
yID: 'oVZevJr-WQ8',
},
{
Name: 'Ben And Kate',
Type: 'show',
wTeaser:
'Ben and Kate is an American single-camera sitcom television series that ran on Fox from September 25, 2012, to January 22, 2013, as part of the 201213 television season. The show was produced by 20th Century Fox Television and Chernin Entertainment. The show was created by Dana Fox who served as an executive producer alongside Peter Chernin, Katherie Pope, and Jake Kasdan.\nThe series focuses on a brother and sister who at first seem to be exact opposites: Ben is an over-the-top dreamer and professional underachiever, while younger sister Kate is a more practical single mother working as a bar manager. After visiting their home in Los Angeles, Ben realizes that his sister needs help with her life and taking care of her six-year-old daughter, Maddie. Because of this, he moves in with Kate so he can discover some of the things he has missed out on and Kate hopes to return the favor by bringing her brother back to reality. Along the way, they are surrounded by their close friends, B.J. and Tommy.\n',
wUrl: 'http://en.wikipedia.org/wiki/Ben_%26_Kate',
yUrl: 'https://www.youtube-nocookie.com/embed/ynHfRA4yF3I',
yID: 'ynHfRA4yF3I',
},
{
Name: 'Rules Of Engagement',
Type: 'show',
wTeaser:
'Rules of Engagement is an American sitcom that ran on CBS from February 5, 2007, to May 20, 2013, originally airing as a mid-season replacement.\nThe series was produced by Adam Sandler\'s Happy Madison Productions in association with CBS Television Studios and Sony Pictures Television (SPT controls the North American rights while CBS controls the international rights).\nAlthough the show received negative reviews throughout its run, it always earned reasonably good ratings, helping the show reach 100 episodes (typically the minimum needed for syndication) over seven seasons.\nTwo couples and their single friend deal with the complications of dating, commitment and marriage. It looks at different relationships in various stages, starring Patrick Warburton and Megyn Price as a long-married couple, Oliver Hudson and Bianca Kajlich as newly engaged sweethearts, and David Spade and Adhir Kalyan (the latter added in season 3) as their still-single friends. They often gather to enjoy a meal and discuss their issues at "The Island Diner".\n',
wUrl: 'http://en.wikipedia.org/wiki/Rules_of_Engagement_(TV_series)',
yUrl: 'https://www.youtube-nocookie.com/embed/TszZJdzf7vE',
yID: 'TszZJdzf7vE',
},
{
Name: "Don't Trust The B---- In Apartment 23",
Type: 'show',
wTeaser:
"Don't Trust the B---- in Apartment 23 is an American television sitcom created by Nahnatchka Khan and starring Krysten Ritter that aired on ABC for two seasons from April 11, 2012 to January 15, 2013. Originally airing as a midseason replacement, ABC renewed the series for a second season with some episodes from its first season aired as part of its second, without regard for continuity. The series starred Ritter as Chloe, an irresponsible party girl who searches for roommates by asking for rent up front and then behaving outrageously until they leave. Her latest roommate, June Colburn (Dreama Walker), however, proves to be harder to drive away, and the women end up forming an unlikely friendship. James Van Der Beek co-starred as a fictionalized version of himself, one of Chloe's friends who is desperate to revive his withering acting career. Liza Lapira, Michael Blaiklock, Eric Andre, and Ray Ford led the supporting cast.\n",
wUrl:
"http://en.wikipedia.org/wiki/Don't_Trust_the_B----_in_Apartment_23",
yUrl: 'https://www.youtube-nocookie.com/embed/ufC-wBO0yZs',
yID: 'ufC-wBO0yZs',
},
{
Name: 'Smash',
Type: 'show',
wTeaser:
'\nSmash is an American musical drama television series created by playwright Theresa Rebeck and developed by Robert Greenblatt for NBC. Steven Spielberg served as one of the executive producers. The series was broadcast in the US by NBC and produced by DreamWorks Television and Universal Television. The series revolves around a fictional New York City theater community and specifically the creation of a new Broadway musical. It features a large ensemble cast, led by Debra Messing, Jack Davenport, Katharine McPhee, Christian Borle, Megan Hilty, and Anjelica Huston.\nThe show debuted on February 6, 2012, and its first season ended on May 14, 2012. Its second season premiered on February 5, 2013, and ended on May 26, 2013. NBC announced a change in their lineup in March 2013 and moved the show to Saturdays starting April 6, 2013. The series was cancelled on May 10, 2013. Second-season executive producer-show runner Josh Safran said the final episode of season two worked as a series finale.',
wUrl: 'https://en.wikipedia.org/wiki/Smash_(U.S._TV_series)',
yUrl: 'https://www.youtube-nocookie.com/embed/5mwHDfl_GIE',
yID: '5mwHDfl_GIE',
},
{
Name: 'Girls',
Type: 'show',
wTeaser:
"\nGirls is an American HBO television series created by and starring Lena Dunham and executive produced by Judd Apatow. Girls is a comedy-drama following the lives of four young women living in New York City. The show's premise and major aspects of the main character—including being cut off financially from her parents, becoming a writer, and making unfortunate decisions—were drawn from Dunham's own life.The first season of Girls was filmed between April and August 2011. The first three episodes were screened at the 2012 SXSW Festival and the series premiered on HBO on April 15, 2012. The second season ran on HBO from January 13, 2013 to March 17, 2013. The third season, which contained 12 episodes as opposed to the previous seasons' 10 episodes, ran from January 12, 2014, to March 23, 2014. The fourth season of the series started filming in April 2014 and premiered on January 11, 2015. The fifth season premiered on February 21, 2016. Girls' sixth and final season concluded on April 16, 2017, culminating in a total of 62 episodes.",
wUrl: 'https://en.wikipedia.org/wiki/Girls_(TV_series)',
yUrl: 'https://www.youtube-nocookie.com/embed/k4tY-2PTFPg',
yID: 'k4tY-2PTFPg',
},
{
Name: 'Hart Of Dixie',
Type: 'show',
wTeaser:
"\nHart of Dixie is an American comedy-drama television series that aired on The CW from September 26, 2011 to March 27, 2015. The series, created by Leila Gerstein, stars Rachel Bilson as Dr. Zoe Hart, a New Yorker who, after her dreams of becoming a heart surgeon fall apart, accepts an offer to work as a general practitioner in the fictional Gulf Coast town of Bluebell, Alabama. The show also stars a pet alligator named Burt Reynolds.\nOn September 26, 2011, Hart of Dixie premiered. The show was scheduled to move back to Mondays in the fall for its third season having been paired with Beauty & the Beast. The show's third season premiered on October 7, 2013.On May 8, 2014, the CW renewed the show for its fourth season. On July 18, 2014, CW president Mark Pedowitz announced that Hart of Dixie would have ten episodes for its fourth season, which premiered on December 15, 2014. On March 14, 2015, Leila Gerstein revealed that season four of Hart of Dixie would be its last. The CW officially cancelled the show on May 7, 2015.",
wUrl: 'http://en.wikipedia.org/wiki/Hart_of_Dixie',
yUrl: 'https://www.youtube-nocookie.com/embed/6P8FguMijIg',
yID: '6P8FguMijIg',
},
{
Name: 'The Middle',
Type: 'show',
wTeaser:
"\nThe Middle is an American sitcom about a lower middle class family living in Indiana facing the day-to-day struggles of home life, work, and raising children. The series premiered on September 30, 2009, on the ABC network and concluded on May 22, 2018. The series features Everybody Loves Raymond actress Patricia Heaton and Scrubs actor Neil Flynn. The Middle was created by former Roseanne and Murphy Brown writers Eileen Heisler and DeAnn Heline of Blackie and Blondie Productions. The show is produced by Warner Bros. Television and Blackie and Blondie Productions. The Middle was praised by television critics and earned numerous award nominations.\nA spin-off of the series centered around Eden Sher's character Sue Heck was set to launch in 2019. However, the pilot was passed on by ABC, and is being shopped to other networks.",
wUrl: 'http://en.wikipedia.org/wiki/The_Middle_(TV_series)',
yUrl: 'https://www.youtube-nocookie.com/embed/_j2po1y6tvE',
yID: '_j2po1y6tvE',
},
{
Name: 'Mom',
Type: 'show',
wTeaser:
'\nMom is an American television sitcom that premiered on CBS on September 23, 2013. The series is created by Chuck Lorre, Eddie Gorodetsky, and Gemma Baker, while the former two also serving as executive producers on the series, along with Nick Bakay. In April 2018, it was renewed for a sixth season, which premiered on September 27, 2018. On February 5, 2019, it was renewed for two additional seasons.Set in Napa, California, it follows dysfunctional daughter/mother duo Christy and Bonnie Plunkett, who, after having been estranged for years while both were struggling with addiction, attempt to pull their lives and their relationship together by trying to stay sober and attending Alcoholics Anonymous. It stars Anna Faris and Allison Janney in the leading roles. Mimi Kennedy, Jaime Pressly, Beth Hall, William Fichtner, Sadie Calvano, Matt Jones, Blake Garrett Rosenthal, Spencer Daniels, Nate Corddry, French Stewart, and Kristen Johnston appear in supporting roles.\n',
wUrl: 'http://en.wikipedia.org/wiki/Mom_(TV_series)',
yUrl: 'https://www.youtube-nocookie.com/embed/tSKzFgS07dI',
yID: 'tSKzFgS07dI',
},
{
Name: 'Melissa & Joey',
Type: 'show',
wTeaser:
"\nMelissa & Joey is an American sitcom television series starring Melissa Joan Hart and Joey Lawrence that aired for four seasons between 2010 and 2015 on ABC Family (now Freeform). The series follows local politician Mel Burke (Hart) and Joe Longo (Lawrence), whom Mel hires to look after her niece (Taylor Spreitler) and nephew (Nick Robinson) after a Ponzi scheme leaves Joe broke.\nThe series originally was picked up for a pilot and season one containing 12 episodes - this premiered August 17, 2010. Then, due to the success of the show, ABC Family renewed it for 18 more episodes on October 8, 2010, which premiered June 29, 2011.\nThe series was renewed by ABC Family for a second season of fifteen episodes, which began airing on May 30, 2012, and ended on August 29, 2012. During the second season, Melissa & Joey ranked as cable TV's #1 telecast at 8 o'clock across target audiences 1834, 1849 and 1234 demographics.",
wUrl: 'http://en.wikipedia.org/wiki/Melissa_%26_Joey',
yUrl: 'https://www.youtube-nocookie.com/embed/H2jUPjQ6Ml4',
yID: 'H2jUPjQ6Ml4',
},
{
Name: 'A To Z',
Type: 'show',
wTeaser:
'A to Z is an American romantic comedy television series created by Ben Queen. He served as an executive producer with Rashida Jones and Will McCormack for Warner Bros. Television. The series debuted on October 2, 2014, on NBC. On October 31, 2014, NBC canceled the series but aired the complete 13-episode run. The series finale aired on January 22, 2015.\nThe story follows the lives of Andrew, an employee at an internet dating site who dreams of meeting the girl of his dreams, and Zelda, a no-nonsense lawyer who was raised by a hippie mother and carries a rebellious streak. By an accidental chance of fate, Zelda meets Andrew to resolve a mismatch dating dispute and these two single people suddenly find themselves falling for each other. From there, the series chronicles their relationship timeline "from A to Z", as narrated by Katey Sagal.\n',
wUrl: 'https://en.wikipedia.org/wiki/A_to_Z_(TV_series)',
yUrl: 'https://www.youtube-nocookie.com/embed/-yNBZAN-gaI',
yID: '-yNBZAN-gaI',
},
],
},
},
};
+17 -8
View File
@@ -1,14 +1,15 @@
import nock from 'nock';
import responses from './server/services/plex/mocks/plexResponses';
import plexResponses from './mocks/plexResponses';
import tdawResponses from './mocks/tdawResponses';
const usersResponse = `${__dirname}/server/services/plex/mocks/getUsersResponse.xml`;
const authResponse = `${__dirname}/server/services/plex/mocks/authResponse.xml`;
const invalidRequestResponse = `${__dirname}/server/services/plex/mocks/error.html`;
const usersResponse = `${__dirname}/mocks/getUsersResponse.xml`;
const authResponse = `${__dirname}/mocks/authResponse.xml`;
const invalidRequestResponse = `${__dirname}/mocks/error.html`;
export const plexSections = () => {
nock('https://plex.mjrflix.com')
.get('/library/sections?X-Plex-Token=testPlexApiToken')
.reply(200, responses.sectionsRaw, {
.reply(200, plexResponses.sectionsRaw, {
'Content-Type': 'text/json',
});
};
@@ -16,7 +17,7 @@ export const plexSections = () => {
export const plexLibrary = () => nock('https://plex.mjrflix.com')
.persist()
.get(url => url.includes('/library/sections/'))
.reply(200, responses.getLibraryDataBySectionRaw, {
.reply(200, plexResponses.getLibraryDataBySectionRaw, {
'Content-Type': 'text/json',
});
@@ -30,7 +31,15 @@ export const mostWatched = () => {
nock('https://plex.mjrflix.com')
.persist()
.get(uri => uri.includes('/library/all/top?type='))
.reply(200, responses.mostWatchedRawTV, {
.reply(200, plexResponses.mostWatchedRawTV, {
'Content-Type': 'text/json',
});
};
export const newGirlTdaw = () => {
nock('https://tastedive.com/api/similar')
.get(uri => uri.includes('New'))
.reply(200, tdawResponses.newGirl, {
'Content-Type': 'text/json',
});
};
@@ -40,7 +49,7 @@ export const mostWatchedByAccount = () => {
.get(
'/library/all/top?accountId=22099864&type=2&limit=10&X-Plex-Token=testPlexApiToken',
)
.reply(200, responses.mostWatchedByAccountRaw, {
.reply(200, plexResponses.mostWatchedByAccountRaw, {
'Content-Type': 'text/json',
});
};
+1 -1
View File
@@ -1,7 +1,7 @@
import chai from 'chai';
import chaiHttp from 'chai-http';
import * as nocks from '../../../nocks';
import responses from './mocks/plexResponses';
import responses from '../../../mocks/plexResponses';
import app from '../../../../index';
chai.use(chaiHttp);
Binary file not shown.
+1 -1
View File
@@ -1,5 +1,5 @@
import nock from 'nock';
import plexResponses from './mocks/plexResponses';
import plexResponses from '../../../mocks/plexResponses';
import plexApi from '../../../../server/services/plex/plexApi';
import helpers from '../../../../server/services/helpers';
import * as nocks from '../../../nocks';
+14 -5
View File
@@ -1,16 +1,16 @@
import nock from 'nock';
// import plexResponses from './mocks/plexResponses';
import tdawResponses from '../../../mocks/tdawResponses';
import tdawApi from '../../../../server/services/tdaw/tdawApi';
import helpers from '../../../../server/services/helpers';
import * as nocks from '../../../nocks';
describe('tdawApi', () => {
it('return tdaw url object', () => {
const result = tdawApi.mediaUrl('New Girl', 'show');
const result = tdawApi.tdawMediaUrl('New Girl', 'show');
result.should.deep.equal({
host: 'https://tastedive.com/api/similar',
queryParams: {
type: 'show',
mediaType: 'show',
info: 1,
k: 'testTdawToken',
q: 'New Girl',
@@ -19,10 +19,19 @@ describe('tdawApi', () => {
});
it('returns url', () => {
const urlParams = tdawApi.mediaUrl('New Girl', 'show');
const urlParams = tdawApi.tdawMediaUrl('New Girl', 'show');
const url = helpers.buildUrl(urlParams);
url.should.equal(
'https://tastedive.com/api/similar?q=New%20Girl&k=testTdawToken&info=1&type=show',
'https://tastedive.com/api/similar?q=New%20Girl&k=testTdawToken&info=1&mediaType=show',
);
});
it('returns similar shows to new girl', async () => {
nocks.newGirlTdaw();
const urlParams = tdawApi.tdawMediaUrl('New Girl', 'show');
const url = helpers.buildUrl(urlParams);
const result = await helpers.request(url);
result.should.deep.equal(tdawResponses.newGirl);
});
});