diff --git a/src/public/js/components/buttons/actions.js b/src/public/js/components/buttons/actions.js index 04a9338..5fa0b43 100644 --- a/src/public/js/components/buttons/actions.js +++ b/src/public/js/components/buttons/actions.js @@ -1,8 +1,8 @@ -import React from 'react' +import React from "react" -import { MenuItem } from 'react-bootstrap' +import { MenuItem } from "react-bootstrap" -export class WishlistButton extends React.Component { +export class WishlistButton extends React.PureComponent { constructor(props) { super(props); this.handleClick = this.handleClick.bind(this); @@ -36,7 +36,7 @@ export class WishlistButton extends React.Component { } } -export class DeleteButton extends React.Component { +export class DeleteButton extends React.PureComponent { constructor(props) { super(props); this.handleClick = this.handleClick.bind(this); @@ -56,7 +56,7 @@ export class DeleteButton extends React.Component { } } -export class RefreshButton extends React.Component { +export class RefreshButton extends React.PureComponent { constructor(props) { super(props); this.handleClick = this.handleClick.bind(this); diff --git a/src/public/js/components/buttons/download.js b/src/public/js/components/buttons/download.js index 3729b88..89ce699 100644 --- a/src/public/js/components/buttons/download.js +++ b/src/public/js/components/buttons/download.js @@ -1,9 +1,8 @@ -import React from 'react' -import { toJS } from 'immutable' +import React from "react" -import { Button, Dropdown, MenuItem, Modal } from 'react-bootstrap' +import { Button, Dropdown, MenuItem, Modal } from "react-bootstrap" -export default class DownloadButton extends React.Component { +export default class DownloadButton extends React.PureComponent { constructor(props) { super(props); this.showModal = this.showModal.bind(this); @@ -67,7 +66,7 @@ export default class DownloadButton extends React.Component { } } -class Player extends React.Component { +class Player extends React.PureComponent { constructor(props) { super(props); } @@ -81,9 +80,9 @@ class Player extends React.Component { ); })} diff --git a/src/public/js/components/buttons/subtitles.js b/src/public/js/components/buttons/subtitles.js index 6d7c930..8d48064 100644 --- a/src/public/js/components/buttons/subtitles.js +++ b/src/public/js/components/buttons/subtitles.js @@ -1,13 +1,13 @@ -import React from 'react' +import React from "react" -import { DropdownButton, MenuItem } from 'react-bootstrap' +import { DropdownButton, MenuItem } from "react-bootstrap" -export default class SubtitlesButton extends React.Component { +export default class SubtitlesButton extends React.PureComponent { constructor(props) { super(props); this.handleClick = this.handleClick.bind(this); } - handleClick(e, url) { + handleClick(e) { e.preventDefault(); if (this.props.fetching) { return } @@ -31,7 +31,7 @@ export default class SubtitlesButton extends React.Component { {entries.map(function(e, index) { switch (e.type) { - case 'action': + case "action": return ( this.handleClick(event, e.url)}> {this.props.fetching || @@ -48,11 +48,11 @@ export default class SubtitlesButton extends React.Component { } ); - case 'divider': + case "divider": return ( ); - case 'entry': + case "entry": return ( {e.lang} @@ -87,8 +87,8 @@ function buildMenuItems(subtitles) { entries.push({ type: "entry", // Take only the last part of fr_FR - lang: sub.get('language').split("_")[1], - url: sub.get('url'), + lang: sub.get("language").split("_")[1], + url: sub.get("url"), }); } diff --git a/src/public/js/components/list/details.js b/src/public/js/components/list/details.js index 6286ece..dc93eab 100644 --- a/src/public/js/components/list/details.js +++ b/src/public/js/components/list/details.js @@ -1,21 +1,21 @@ -import React from 'react' +import React from "react" export default function ListDetails(props) { - let genres = props.data.get('genres'); + let genres = props.data.get("genres"); if (genres !== undefined) { // Uppercase first genres genres = genres.toJS().map( (word) => word[0].toUpperCase() + word.substr(1) - ).join(', '); + ).join(", "); } let wishlistStr = ""; - if (props.data.get('wishlisted') === true) { + if (props.data.get("wishlisted") === true) { wishlistStr = "Wishlisted"; } - const trackedSeason = props.data.get('tracked_season'); - const trackedEpisode = props.data.get('tracked_episode'); + const trackedSeason = props.data.get("tracked_season"); + const trackedEpisode = props.data.get("tracked_episode"); if (trackedEpisode !== null && trackedSeason !== null && trackedEpisode !== undefined && trackedSeason !== undefined) { if ((trackedSeason === 0) && (trackedEpisode === 0)) { @@ -28,18 +28,18 @@ export default function ListDetails(props) { return (
-

{props.data.get('title')}

-

{props.data.get('title')}

+

{props.data.get("title")}

+

{props.data.get("title")}

{wishlistStr !== "" && {wishlistStr} } -

{props.data.get('year')}

- {props.data.get('runtime') !== undefined && +

{props.data.get("year")}

+ {props.data.get("runtime") !== undefined &&

-  {props.data.get('runtime')} min +  {props.data.get("runtime")} min

} {genres !== undefined && @@ -50,12 +50,12 @@ export default function ListDetails(props) { }

-  {Number(props.data.get('rating')).toFixed(1)}  - {props.data.get('votes') !== undefined && - ({props.data.get('votes')} counts) +  {Number(props.data.get("rating")).toFixed(1)}  + {props.data.get("votes") !== undefined && + ({props.data.get("votes")} counts) }

-

{props.data.get('plot')}

+

{props.data.get("plot")}

{props.children}
diff --git a/src/public/js/components/list/explorerOptions.js b/src/public/js/components/list/explorerOptions.js index 1e14b4a..461cc2b 100644 --- a/src/public/js/components/list/explorerOptions.js +++ b/src/public/js/components/list/explorerOptions.js @@ -1,7 +1,7 @@ -import React from 'react' -import { Form, FormGroup, FormControl, ControlLabel } from 'react-bootstrap' +import React from "react" +import { Form, FormGroup, FormControl, ControlLabel } from "react-bootstrap" -export default class ExplorerOptions extends React.Component { +export default class ExplorerOptions extends React.PureComponent { constructor(props) { super(props); this.handleSourceChange = this.handleSourceChange.bind(this); @@ -67,7 +67,7 @@ export default class ExplorerOptions extends React.Component { onChange={this.handleSourceChange} value={source} > - {this.props.options.entrySeq().map(function([source, categories]) { + {this.props.options.keySeq().map(function(source) { return ( ) }, this)} diff --git a/src/public/js/components/list/filter.js b/src/public/js/components/list/filter.js index d8eea8a..e80d8b9 100644 --- a/src/public/js/components/list/filter.js +++ b/src/public/js/components/list/filter.js @@ -1,9 +1,9 @@ -import React from 'react' +import React from "react" export default class ListFilter extends React.PureComponent { constructor(props) { super(props); - this.state = { filter: '' }; + this.state = { filter: "" }; this.handleChange = this.handleChange.bind(this); } handleChange(ev) { @@ -16,7 +16,7 @@ export default class ListFilter extends React.PureComponent { if (value.length >= 3) { this.props.updateFilter(value); } else { - this.props.updateFilter(''); + this.props.updateFilter(""); } } render() { diff --git a/src/public/js/components/list/poster.js b/src/public/js/components/list/poster.js index 3804164..0f9f129 100644 --- a/src/public/js/components/list/poster.js +++ b/src/public/js/components/list/poster.js @@ -1,12 +1,12 @@ -import React from 'react' +import React from "react" export default class ListPoster extends React.PureComponent { constructor(props) { super(props); } render() { - const selected = this.props.selected ? ' thumbnail-selected' : ''; - const imgClass = 'thumbnail' + selected; + const selected = this.props.selected ? " thumbnail-selected" : ""; + const imgClass = "thumbnail" + selected; const displayClearFixLg = (this.props.index % 6) === 0; const displayClearFixMd = (this.props.index % 4) === 0; const displayClearFixSm = (this.props.index % 2) === 0; @@ -24,7 +24,7 @@ export default class ListPoster extends React.PureComponent {
diff --git a/src/public/js/components/list/posters.js b/src/public/js/components/list/posters.js index ce73d28..6668dbe 100644 --- a/src/public/js/components/list/posters.js +++ b/src/public/js/components/list/posters.js @@ -1,19 +1,17 @@ -import React from 'react' -import { Map, List, fromJS } from 'immutable' +import React from "react" -import fuzzy from 'fuzzy'; -import InfiniteScroll from 'react-infinite-scroller'; +import fuzzy from "fuzzy"; +import InfiniteScroll from "react-infinite-scroller"; -import ListFilter from './filter' -import ExplorerOptions from './explorerOptions' -import ListPoster from './poster' +import ListFilter from "./filter" +import ExplorerOptions from "./explorerOptions" +import ListPoster from "./poster" -import Loader from '../loader/loader' +import Loader from "../loader/loader" -const DEFAULT_LIST_SIZE = 30; const DEFAULT_ADD_EXTRA_ITEMS = 30; -export default class ListPosters extends React.Component { +export default class ListPosters extends React.PureComponent { constructor(props) { super(props); this.loadMore = this.loadMore.bind(this); @@ -62,7 +60,7 @@ export default class ListPosters extends React.Component { // Filter the list of elements if (this.props.filter !== "") { - elmts = elmts.filter((v) => fuzzy.test(this.props.filter, v.get('title')), this); + elmts = elmts.filter((v) => fuzzy.test(this.props.filter, v.get("title")), this); } else { elmts = elmts.slice(0, this.state.items); } @@ -131,7 +129,7 @@ class Posters extends React.PureComponent { className="row" > {this.props.elmts.toIndexedSeq().map(function(movie, index) { - const imdbId = movie.get('imdb_id'); + const imdbId = movie.get("imdb_id"); const selected = (imdbId === this.props.selectedImdbId) ? true : false; return ( @@ -29,51 +29,51 @@ const mapDispatchToProps = (dipatch) => refreshSubtitles, updateFilter }, dipatch) function MovieButtons(props) { - const imdb_link = `http://www.imdb.com/title/${props.movie.get('imdb_id')}`; - const hasMovie = (props.movie.get('polochon_url') !== ""); + const imdbLink = `http://www.imdb.com/title/${props.movie.get("imdb_id")}`; + const hasMovie = (props.movie.get("polochon_url") !== ""); return (
- {props.movie.get('torrents') !== null && + {props.movie.get("torrents") !== null && } - + IMDB
); } -class MovieList extends React.Component { +class MovieList extends React.PureComponent { constructor(props) { super(props); } diff --git a/src/public/js/components/movies/torrents.js b/src/public/js/components/movies/torrents.js index 0f39b67..2c19e2f 100644 --- a/src/public/js/components/movies/torrents.js +++ b/src/public/js/components/movies/torrents.js @@ -1,8 +1,8 @@ -import React from 'react' +import React from "react" -import { DropdownButton, MenuItem } from 'react-bootstrap' +import { DropdownButton, MenuItem } from "react-bootstrap" -export default class TorrentsButton extends React.Component { +export default class TorrentsButton extends React.PureComponent { constructor(props) { super(props); this.handleClick = this.handleClick.bind(this); @@ -17,17 +17,17 @@ export default class TorrentsButton extends React.Component { {entries.map(function(e, index) { switch (e.type) { - case 'header': + case "header": return ( {e.value} ); - case 'divider': + case "divider": return ( ); - case 'entry': + case "entry": return ( this.handleClick(event, e.url)}> {e.quality} @@ -41,7 +41,7 @@ export default class TorrentsButton extends React.Component { } function buildMenuItems(torrents) { - const t = torrents.groupBy((el) => el.get('source')); + const t = torrents.groupBy((el) => el.get("source")); // Build the array of entries let entries = []; @@ -57,8 +57,8 @@ function buildMenuItems(torrents) { for (let torrent of torrentList) { entries.push({ type: "entry", - quality: torrent.get('quality'), - url: torrent.get('url'), + quality: torrent.get("quality"), + url: torrent.get("url"), }); } diff --git a/src/public/js/components/navbar.js b/src/public/js/components/navbar.js index 56c1398..8813c1a 100644 --- a/src/public/js/components/navbar.js +++ b/src/public/js/components/navbar.js @@ -1,6 +1,6 @@ -import React from 'react' -import { Nav, Navbar, NavItem, NavDropdown, MenuItem } from 'react-bootstrap' -import { LinkContainer } from 'react-router-bootstrap' +import React from "react" +import { Nav, Navbar, NavItem, NavDropdown, MenuItem } from "react-bootstrap" +import { LinkContainer } from "react-router-bootstrap" export default class NavBar extends React.PureComponent { constructor(props) { @@ -25,10 +25,10 @@ export default class NavBar extends React.PureComponent { } } shouldDisplayMoviesSearch(router) { - return this.matchPath(router, 'movies'); + return this.matchPath(router, "movies"); } shouldDisplayShowsSearch(router) { - return this.matchPath(router, 'shows'); + return this.matchPath(router, "shows"); } matchPath(router, keyword) { const location = router.getCurrentLocation().pathname; @@ -103,7 +103,7 @@ class Search extends React.Component { } } -function MoviesDropdown(props) { +function MoviesDropdown() { return(