Skip to content

Commit

Permalink
fix(eztv-api): Fixed not finding episodes
Browse files Browse the repository at this point in the history
  • Loading branch information
TriPSs committed Nov 18, 2020
1 parent bf9dc27 commit 3037391
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 17 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Import the necessary modules.
/* eslint-disable no-console */
const EztvApi = require('..')
const { EztvApi } = require('./src')

// Create a new instance of the module.
const eztv = new EztvApi()
Expand All @@ -21,6 +21,6 @@ const eztv = new EztvApi()
// Use the API of EZTV.
eztv.getShowData({
id: 1047,
slug: 'power-2014'
slug: 'power-2014',
}).then(res => console.log(JSON.stringify(res)))
.catch(err => console.error(err))
12 changes: 1 addition & 11 deletions packages/eztv-api/src/eztv-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ export class EztvApi {
}

const table = 'tr.forum_header_border[name="hover"]'
$(table).each(() => {
$(table).each(function () {
const entry = $(this)
const magnet = entry.children('td').eq(2)
.children('a.magnet')
Expand Down Expand Up @@ -194,14 +194,4 @@ export class EztvApi {
.then(($) => this.getEpisodeData(data, $))
}

/**
* Search for episodes of a show.
* @param {Show} data - The show to get episodes for.
* @returns {Promise<Show, Error>} - The show with additional data.
*/
public getShowEpisodes(data: Show) {
return this.get('search/')
.then(($) => this.getEpisodeData(data, $))
}

}
8 changes: 4 additions & 4 deletions workspace.json
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
"main": "packages/eztv-api/src/index.ts",
"assets": [
"packages/eztv-api/*.md",
"packages/eztv-api/examples/**",
"packages/eztv-api/example.js",
"packages/eztv-api/LICENSE"
]
}
Expand Down Expand Up @@ -125,7 +125,7 @@
"main": "packages/solidtorrents-api/src/index.ts",
"assets": [
"packages/solidtorrents-api/*.md",
"packages/solidtorrents-api/examples/**",
"packages/solidtorrents-api/example.js",
"packages/solidtorrents-api/LICENSE"
]
}
Expand Down Expand Up @@ -204,7 +204,7 @@
"main": "packages/ettv-api/src/index.ts",
"assets": [
"packages/ettv-api/*.md",
"packages/ettv-api/examples/**",
"packages/ettv-api/example.js",
"packages/ettv-api/LICENSE"
]
}
Expand Down Expand Up @@ -244,7 +244,7 @@
"main": "packages/kat-api/src/index.ts",
"assets": [
"packages/kat-api/*.md",
"packages/kat-api/examples/**",
"packages/kat-api/example.js",
"packages/kat-api/LICENSE"
]
}
Expand Down

0 comments on commit 3037391

Please sign in to comment.