diff --git a/frontend/js/actions/alerts.js b/frontend/js/actions/alerts.js index 3f3b8fb..c45d18d 100644 --- a/frontend/js/actions/alerts.js +++ b/frontend/js/actions/alerts.js @@ -2,8 +2,8 @@ export function addAlertError(message) { return { type: "ADD_ALERT_ERROR", payload: { - message - } + message, + }, }; } @@ -11,13 +11,13 @@ export function addAlertOk(message) { return { type: "ADD_ALERT_OK", payload: { - message - } + message, + }, }; } export function dismissAlert() { return { - type: "DISMISS_ALERT" + type: "DISMISS_ALERT", }; } diff --git a/frontend/js/actions/movies.js b/frontend/js/actions/movies.js index 0c182b4..77340b7 100644 --- a/frontend/js/actions/movies.js +++ b/frontend/js/actions/movies.js @@ -7,8 +7,8 @@ export function updateLastMovieFetchUrl(url) { return { type: "UPDATE_LAST_MOVIE_FETCH_URL", payload: { - url: url - } + url: url, + }, }; } @@ -16,8 +16,8 @@ export function selectMovie(imdbId) { return { type: "SELECT_MOVIE", payload: { - imdbId - } + imdbId, + }, }; } @@ -25,8 +25,8 @@ export function updateFilter(filter) { return { type: "MOVIE_UPDATE_FILTER", payload: { - filter - } + filter, + }, }; } @@ -43,7 +43,7 @@ export function getMovieDetails(imdbId) { configureAxios().post(`/movies/${imdbId}/refresh`), null, { - imdbId + imdbId, } ); } @@ -51,7 +51,7 @@ export function getMovieDetails(imdbId) { export function deleteMovie(imdbId, lastFetchUrl) { return request("MOVIE_DELETE", configureAxios().delete(`/movies/${imdbId}`), [ fetchMovies(lastFetchUrl), - addAlertOk("Movie deleted") + addAlertOk("Movie deleted"), ]); } @@ -84,26 +84,26 @@ export function updateMovieWishlistStore(imdbId, wishlisted) { type: "MOVIE_UPDATE_STORE_WISHLIST", payload: { imdbId, - wishlisted - } + wishlisted, + }, }; } export function fetchMovies(url) { return request("MOVIE_LIST_FETCH", configureAxios().get(url), [ - updateLastMovieFetchUrl(url) + updateLastMovieFetchUrl(url), ]); } -export const newMovieEvent = data => { - return dispatch => { +export const newMovieEvent = (data) => { + return (dispatch) => { dispatch( sendNotification({ icon: "film", autohide: true, delay: 10000, title: `${data.title} added to the library`, - imageUrl: data.thumb + imageUrl: data.thumb, }) ); }; diff --git a/frontend/js/actions/notifications.js b/frontend/js/actions/notifications.js index 6f4347e..f4b0aeb 100644 --- a/frontend/js/actions/notifications.js +++ b/frontend/js/actions/notifications.js @@ -1,9 +1,9 @@ -export const sendNotification = data => ({ +export const sendNotification = (data) => ({ type: "ADD_NOTIFICATION", - payload: data + payload: data, }); -export const removeNotification = id => ({ +export const removeNotification = (id) => ({ type: "REMOVE_NOTIFICATION", - payload: { id } + payload: { id }, }); diff --git a/frontend/js/actions/polochon.js b/frontend/js/actions/polochon.js index 3be9ca8..facf06e 100644 --- a/frontend/js/actions/polochon.js +++ b/frontend/js/actions/polochon.js @@ -11,10 +11,10 @@ export const getManagedPolochons = () => configureAxios().get("/users/polochons") ); -export const addPolochon = params => +export const addPolochon = (params) => request("ADD_POLOCHON", configureAxios().post("/polochons", params), [ () => getPolochons(), - () => getManagedPolochons() + () => getManagedPolochons(), ]); export const updatePolochon = ({ id, ...params }) => @@ -24,10 +24,10 @@ export const updatePolochon = ({ id, ...params }) => [() => getPolochons(), () => getManagedPolochons()] ); -export const deletePolochon = id => +export const deletePolochon = (id) => request("DELETE_POLOCHON", configureAxios().delete(`/polochons/${id}`), [ () => getPolochons(), - () => getManagedPolochons() + () => getManagedPolochons(), ]); export const editPolochonUser = ({ polochonId, id, ...params }) => diff --git a/frontend/js/actions/shows.js b/frontend/js/actions/shows.js index 6f0761e..70ddd4b 100644 --- a/frontend/js/actions/shows.js +++ b/frontend/js/actions/shows.js @@ -5,7 +5,7 @@ import { sendNotification } from "./notifications"; export function fetchShows(url) { return request("SHOW_LIST_FETCH", configureAxios().get(url), [ - updateLastShowsFetchUrl(url) + updateLastShowsFetchUrl(url), ]); } @@ -28,7 +28,7 @@ export function getEpisodeDetails(imdbId, season, episode) { { imdbId, season, - episode + episode, } ); } @@ -47,7 +47,7 @@ export function addShowToWishlist(imdbId, season = null, episode = null) { "SHOW_ADD_TO_WISHLIST", configureAxios().post(`/wishlist/shows/${imdbId}`, { season: season, - episode: episode + episode: episode, }), [updateShowWishlistStore(imdbId, true, season, episode)] ); @@ -85,8 +85,8 @@ export function updateShowWishlistStore( payload: { imdbId, season, - episode - } + episode, + }, }; } @@ -101,8 +101,8 @@ export function selectShow(imdbId) { return { type: "SELECT_SHOW", payload: { - imdbId - } + imdbId, + }, }; } @@ -110,8 +110,8 @@ export function updateFilter(filter) { return { type: "SHOWS_UPDATE_FILTER", payload: { - filter - } + filter, + }, }; } @@ -119,13 +119,13 @@ export function updateLastShowsFetchUrl(url) { return { type: "UPDATE_LAST_SHOWS_FETCH_URL", payload: { - url: url - } + url: url, + }, }; } -export const newEpisodeEvent = data => { - return dispatch => { +export const newEpisodeEvent = (data) => { + return (dispatch) => { dispatch( sendNotification({ icon: "video-camera", @@ -136,7 +136,7 @@ export const newEpisodeEvent = data => { data.season, data.episode )} added to the library`, - imageUrl: `img/shows/${data.show_imdb_id}-poster.jpg` + imageUrl: `img/shows/${data.show_imdb_id}-poster.jpg`, }) ); }; diff --git a/frontend/js/actions/subtitles.js b/frontend/js/actions/subtitles.js index 7f2e92f..6460791 100644 --- a/frontend/js/actions/subtitles.js +++ b/frontend/js/actions/subtitles.js @@ -1,6 +1,6 @@ import { configureAxios, request } from "../requests"; -export const searchMovieSubtitles = imdbId => { +export const searchMovieSubtitles = (imdbId) => { return request( "MOVIE_SUBTITLES_UPDATE", configureAxios().post(`/movies/${imdbId}/subtitles/refresh`), @@ -18,7 +18,7 @@ export const searchEpisodeSubtitles = (imdbId, season, episode) => { { imdbId: imdbId, season: season, - episode: episode + episode: episode, } ); }; diff --git a/frontend/js/actions/torrents.js b/frontend/js/actions/torrents.js index ecac6e9..3e38fe2 100644 --- a/frontend/js/actions/torrents.js +++ b/frontend/js/actions/torrents.js @@ -6,7 +6,7 @@ export function addTorrent(url) { return request( "ADD_TORRENT", configureAxios().post("/torrents", { - url: url + url: url, }), [addAlertOk("Torrent added")] ); @@ -14,7 +14,7 @@ export function addTorrent(url) { export function removeTorrent(id) { return request("REMOVE_TORRENT", configureAxios().delete(`/torrents/${id}`), [ - () => fetchTorrents() + () => fetchTorrents(), ]); } @@ -31,8 +31,8 @@ export function setFetchedTorrents(torrents) { type: "TORRENTS_FETCH_FULFILLED", payload: { response: { - data: torrents - } - } + data: torrents, + }, + }, }; } diff --git a/frontend/js/actions/users.js b/frontend/js/actions/users.js index 9bb312a..fd7b7a2 100644 --- a/frontend/js/actions/users.js +++ b/frontend/js/actions/users.js @@ -6,7 +6,7 @@ import { getManagedPolochons } from "./polochon"; export function userLogout() { return { - type: "USER_LOGOUT" + type: "USER_LOGOUT", }; } @@ -15,7 +15,7 @@ export function loginUser(username, password) { "USER_LOGIN", configureAxios().post("/users/login", { username: username.trim(), - password: password + password: password, }), [() => dismissAlert()] ); @@ -24,7 +24,7 @@ export function loginUser(username, password) { export function updateUser(config) { return request("USER_UPDATE", configureAxios().post("/users/edit", config), [ addAlertOk("User updated"), - () => getManagedPolochons() + () => getManagedPolochons(), ]); } @@ -48,8 +48,8 @@ export function setUserToken(token) { return { type: "USER_SET_TOKEN", payload: { - token: token - } + token: token, + }, }; } diff --git a/frontend/js/auth.js b/frontend/js/auth.js index d97588c..cbd60f4 100644 --- a/frontend/js/auth.js +++ b/frontend/js/auth.js @@ -31,7 +31,7 @@ const protectedRoute = ({ return ( { + render={(props) => { if (isAuthenticated()) { if (isActivated) { return ; @@ -50,14 +50,14 @@ protectedRoute.propTypes = { isLogged: PropTypes.bool.isRequired, isActivated: PropTypes.bool.isRequired, isTokenSet: PropTypes.bool.isRequired, - setUserToken: PropTypes.func.isRequired + setUserToken: PropTypes.func.isRequired, }; export const ProtectedRoute = connect( - state => ({ + (state) => ({ isLogged: state.userStore.get("isLogged"), isAdmin: state.userStore.get("isLogged"), isActivated: state.userStore.get("isActivated"), - isTokenSet: state.userStore.get("isTokenSet") + isTokenSet: state.userStore.get("isTokenSet"), }), { setUserToken } )(protectedRoute); @@ -66,7 +66,7 @@ const adminRoute = ({ component: Component, isAdmin, ...otherProps }) => { return ( { + render={(props) => { if (isAdmin) { return ; } else { @@ -78,8 +78,8 @@ const adminRoute = ({ component: Component, isAdmin, ...otherProps }) => { }; adminRoute.propTypes = { component: PropTypes.func, - isAdmin: PropTypes.bool.isRequired + isAdmin: PropTypes.bool.isRequired, }; -export const AdminRoute = connect(state => ({ - isAdmin: state.userStore.get("isLogged") +export const AdminRoute = connect((state) => ({ + isAdmin: state.userStore.get("isLogged"), }))(adminRoute); diff --git a/frontend/js/components/admins/modules.js b/frontend/js/components/admins/modules.js index 7c41604..d851c0d 100644 --- a/frontend/js/components/admins/modules.js +++ b/frontend/js/components/admins/modules.js @@ -15,12 +15,12 @@ const AdminModulesConnected = ({ modules, loading, getAdminModules }) => { AdminModulesConnected.propTypes = { modules: PropTypes.object, loading: PropTypes.bool, - getAdminModules: PropTypes.func.isRequired + getAdminModules: PropTypes.func.isRequired, }; -const mapStateToProps = state => ({ +const mapStateToProps = (state) => ({ loading: state.adminStore.get("fetchingModules"), - modules: state.adminStore.get("modules") + modules: state.adminStore.get("modules"), }); export const AdminModules = connect(mapStateToProps, { getAdminModules })( diff --git a/frontend/js/components/admins/stat.js b/frontend/js/components/admins/stat.js index d1aa61d..485018b 100644 --- a/frontend/js/components/admins/stat.js +++ b/frontend/js/components/admins/stat.js @@ -28,5 +28,5 @@ Stat.propTypes = { name: PropTypes.string, count: PropTypes.number, torrentCount: PropTypes.number, - torrentCountById: PropTypes.number + torrentCountById: PropTypes.number, }; diff --git a/frontend/js/components/admins/stats.js b/frontend/js/components/admins/stats.js index a0a467c..ed0c15e 100644 --- a/frontend/js/components/admins/stats.js +++ b/frontend/js/components/admins/stats.js @@ -36,11 +36,11 @@ const StatsConnected = ({ stats, getStats }) => { }; StatsConnected.propTypes = { stats: PropTypes.object, - getStats: PropTypes.func + getStats: PropTypes.func, }; -const mapStateToProps = state => ({ - stats: state.adminStore.get("stats") +const mapStateToProps = (state) => ({ + stats: state.adminStore.get("stats"), }); export const Stats = connect(mapStateToProps, { getStats })(StatsConnected); diff --git a/frontend/js/components/admins/torrentsStat.js b/frontend/js/components/admins/torrentsStat.js index 791a0b3..f68ef58 100644 --- a/frontend/js/components/admins/torrentsStat.js +++ b/frontend/js/components/admins/torrentsStat.js @@ -17,5 +17,5 @@ export const TorrentsStat = ({ count, torrentCount, torrentCountById }) => { TorrentsStat.propTypes = { count: PropTypes.number, torrentCount: PropTypes.number, - torrentCountById: PropTypes.number + torrentCountById: PropTypes.number, }; diff --git a/frontend/js/components/admins/user.js b/frontend/js/components/admins/user.js index a9508d3..b7454db 100644 --- a/frontend/js/components/admins/user.js +++ b/frontend/js/components/admins/user.js @@ -12,7 +12,7 @@ export const User = ({ polochonUrl, polochonName, polochonId, - token + token, }) => { return ( @@ -61,5 +61,5 @@ User.propTypes = { token: PropTypes.string, admin: PropTypes.bool, activated: PropTypes.bool, - polochonActivated: PropTypes.bool + polochonActivated: PropTypes.bool, }; diff --git a/frontend/js/components/admins/userEdit.js b/frontend/js/components/admins/userEdit.js index 5b9788d..f5970d6 100644 --- a/frontend/js/components/admins/userEdit.js +++ b/frontend/js/components/admins/userEdit.js @@ -21,7 +21,7 @@ const UserEditConnect = ({ polochonActivated: initPolochonActivated, updateUser, deleteUser, - publicPolochons + publicPolochons, }) => { const [modal, setModal] = useState(false); const [admin, setAdmin] = useState(initAdmin); @@ -34,7 +34,7 @@ const UserEditConnect = ({ const [password, setPassword] = useState(""); const [confirmDelete, setConfirmDelete] = useState(false); - const handleSubmit = e => { + const handleSubmit = (e) => { if (e) { e.preventDefault(); } @@ -45,12 +45,12 @@ const UserEditConnect = ({ activated, polochonId, polochonActivated, - password + password, }); setModal(false); }; - const handleDeleteUser = e => { + const handleDeleteUser = (e) => { if (e) { e.preventDefault(); } @@ -147,11 +147,11 @@ UserEditConnect.propTypes = { polochonToken: PropTypes.string, polochonId: PropTypes.string, polochonActivated: PropTypes.bool, - publicPolochons: PropTypes.instanceOf(List) + publicPolochons: PropTypes.instanceOf(List), }; -const mapStateToProps = state => ({ - publicPolochons: state.polochon.get("public") +const mapStateToProps = (state) => ({ + publicPolochons: state.polochon.get("public"), }); export const UserEdit = connect(mapStateToProps, { updateUser, deleteUser })( diff --git a/frontend/js/components/admins/userList.js b/frontend/js/components/admins/userList.js index 363b0a0..d5480a1 100644 --- a/frontend/js/components/admins/userList.js +++ b/frontend/js/components/admins/userList.js @@ -8,8 +8,8 @@ import { User } from "./user"; import { getUsers } from "../../actions/admins"; import { getPolochons } from "../../actions/polochon"; -const mapStateToProps = state => ({ - users: state.adminStore.get("users") +const mapStateToProps = (state) => ({ + users: state.adminStore.get("users"), }); const mapDispatchToProps = { getUsers, getPolochons }; @@ -57,7 +57,7 @@ const UserListConnect = ({ users, getUsers, getPolochons }) => { UserListConnect.propTypes = { getUsers: PropTypes.func, getPolochons: PropTypes.func, - users: PropTypes.PropTypes.instanceOf(List) + users: PropTypes.PropTypes.instanceOf(List), }; export const UserList = connect( diff --git a/frontend/js/components/admins/users.js b/frontend/js/components/admins/users.js index 2e76521..f09c6a0 100644 --- a/frontend/js/components/admins/users.js +++ b/frontend/js/components/admins/users.js @@ -5,7 +5,7 @@ import { List } from "immutable"; import { Button, Modal } from "react-bootstrap"; import Toggle from "react-bootstrap-toggle"; -export const UserList = props => ( +export const UserList = (props) => (
@@ -29,10 +29,10 @@ export const UserList = props => ( ); UserList.propTypes = { users: PropTypes.PropTypes.instanceOf(List), - updateUser: PropTypes.func + updateUser: PropTypes.func, }; -const User = function(props) { +const User = function (props) { const polochonConfig = props.data.get("RawConfig").get("polochon"); const polochonUrl = polochonConfig ? polochonConfig.get("url") : "-"; const polochonToken = polochonConfig ? polochonConfig.get("token") : "-"; @@ -61,15 +61,15 @@ const User = function(props) { }; User.propTypes = { data: PropTypes.object, - updateUser: PropTypes.func + updateUser: PropTypes.func, }; -const UserAdminStatus = props => ( +const UserAdminStatus = (props) => ( ); UserAdminStatus.propTypes = { admin: PropTypes.bool.isRequired }; -const UserActivationStatus = props => ( +const UserActivationStatus = (props) => ( @@ -83,7 +83,7 @@ function UserEdit(props) { const [url, setUrl] = useState(props.polochonUrl); const [token, setToken] = useState(props.polochonToken); - const handleSubmit = function(e) { + const handleSubmit = function (e) { if (e) { e.preventDefault(); } @@ -92,7 +92,7 @@ function UserEdit(props) { admin: admin, activated: activated, polochonUrl: url, - polochonToken: token + polochonToken: token, }); setModal(false); }; @@ -111,7 +111,7 @@ function UserEdit(props) { -
handleSubmit(ev)}> + handleSubmit(ev)}>
setUrl(e.target.value)} + onChange={(e) => setUrl(e.target.value)} />
@@ -149,7 +149,7 @@ function UserEdit(props) { setToken(e.target.value)} + onChange={(e) => setToken(e.target.value)} />
@@ -168,5 +168,5 @@ UserEdit.propTypes = { data: PropTypes.object, updateUser: PropTypes.func, polochonUrl: PropTypes.string, - polochonToken: PropTypes.string + polochonToken: PropTypes.string, }; diff --git a/frontend/js/components/alerts/alert.js b/frontend/js/components/alerts/alert.js index a9b5674..9655a5c 100644 --- a/frontend/js/components/alerts/alert.js +++ b/frontend/js/components/alerts/alert.js @@ -5,14 +5,14 @@ import { connect } from "react-redux"; import { dismissAlert } from "../../actions/alerts"; -const mapStateToProps = state => ({ +const mapStateToProps = (state) => ({ show: state.alerts.get("show"), title: state.alerts.get("message"), - type: state.alerts.get("type") + type: state.alerts.get("type"), }); const mapDispatchToProps = { dismissAlert }; -const Alert = props => { +const Alert = (props) => { if (!props.show) { return null; } @@ -29,7 +29,7 @@ Alert.propTypes = { show: PropTypes.bool.isRequired, title: PropTypes.string.isRequired, dismissAlert: PropTypes.func.isRequired, - type: PropTypes.string + type: PropTypes.string, }; export default connect(mapStateToProps, mapDispatchToProps)(Alert); diff --git a/frontend/js/components/buttons/download.js b/frontend/js/components/buttons/download.js index 1403e2c..ee5f2d4 100644 --- a/frontend/js/components/buttons/download.js +++ b/frontend/js/components/buttons/download.js @@ -19,7 +19,7 @@ export const DownloadAndStream = ({ url, name, subtitles }) => { DownloadAndStream.propTypes = { url: PropTypes.string, name: PropTypes.string, - subtitles: PropTypes.instanceOf(List) + subtitles: PropTypes.instanceOf(List), }; const DownloadButton = ({ url }) => ( @@ -41,7 +41,7 @@ const StreamButton = ({ name, url, subtitles }) => { { + onClick={(e) => { e.preventDefault(); setShowModal(true); }} @@ -68,7 +68,7 @@ const StreamButton = ({ name, url, subtitles }) => { StreamButton.propTypes = { name: PropTypes.string.isRequired, url: PropTypes.string.isRequired, - subtitles: PropTypes.instanceOf(List) + subtitles: PropTypes.instanceOf(List), }; const Player = ({ url, subtitles }) => { @@ -95,8 +95,8 @@ const Player = ({ url, subtitles }) => { }; Player.propTypes = { subtitles: PropTypes.instanceOf(List), - url: PropTypes.string.isRequired + url: PropTypes.string.isRequired, }; Player.defaultProps = { - subtitles: List() + subtitles: List(), }; diff --git a/frontend/js/components/buttons/showMore.js b/frontend/js/components/buttons/showMore.js index 9108b41..7bb2d18 100644 --- a/frontend/js/components/buttons/showMore.js +++ b/frontend/js/components/buttons/showMore.js @@ -27,9 +27,9 @@ export const ShowMore = ({ children, id, inLibrary }) => { ShowMore.propTypes = { id: PropTypes.string, inLibrary: PropTypes.bool.isRequired, - children: PropTypes.oneOfType([PropTypes.object, PropTypes.array]) + children: PropTypes.oneOfType([PropTypes.object, PropTypes.array]), }; ShowMore.defaultProps = { id: "", - inLibrary: false + inLibrary: false, }; diff --git a/frontend/js/components/buttons/subtitles.js b/frontend/js/components/buttons/subtitles.js index add3937..7cd80b7 100644 --- a/frontend/js/components/buttons/subtitles.js +++ b/frontend/js/components/buttons/subtitles.js @@ -8,7 +8,7 @@ export const SubtitlesButton = ({ subtitles, inLibrary, searching, - search + search, }) => { if (inLibrary === false) { return null; @@ -17,7 +17,7 @@ export const SubtitlesButton = ({ const [show, setShow] = useState(false); /* eslint-enable */ - const onSelect = eventKey => { + const onSelect = (eventKey) => { if (eventKey === null || eventKey != 1) { setShow(false); } @@ -68,5 +68,5 @@ SubtitlesButton.propTypes = { subtitles: PropTypes.instanceOf(List), inLibrary: PropTypes.bool.isRequired, searching: PropTypes.bool.isRequired, - search: PropTypes.func.isRequired + search: PropTypes.func.isRequired, }; diff --git a/frontend/js/components/buttons/torrents.js b/frontend/js/components/buttons/torrents.js index 7f061cf..94c3d2d 100644 --- a/frontend/js/components/buttons/torrents.js +++ b/frontend/js/components/buttons/torrents.js @@ -13,7 +13,7 @@ function buildMenuItems(torrents) { return []; } - const t = torrents.groupBy(el => el.get("source")); + const t = torrents.groupBy((el) => el.get("source")); // Build the array of entries let entries = []; @@ -22,7 +22,7 @@ function buildMenuItems(torrents) { // Push the title entries.push({ type: "header", - value: source + value: source, }); // Push the torrents @@ -31,7 +31,7 @@ function buildMenuItems(torrents) { type: "entry", quality: torrent.get("quality"), url: torrent.get("url"), - size: torrent.get("size") + size: torrent.get("size"), }); } @@ -52,7 +52,7 @@ const torrentsButton = ({ torrents, search, searching, addTorrent, url }) => { const entries = buildMenuItems(torrents); const count = torrents && torrents.size !== 0 ? torrents.size : 0; - const onSelect = eventKey => { + const onSelect = (eventKey) => { // Close the dropdown if the eventkey is not specified if (eventKey === null) { setShow(false); @@ -116,10 +116,10 @@ torrentsButton.propTypes = { searching: PropTypes.bool, search: PropTypes.func.isRequired, addTorrent: PropTypes.func.isRequired, - url: PropTypes.string + url: PropTypes.string, }; torrentsButton.defaultProps = { - torrents: List() + torrents: List(), }; export const TorrentsButton = connect(null, { addTorrent })(torrentsButton); diff --git a/frontend/js/components/buttons/wishlist.js b/frontend/js/components/buttons/wishlist.js index 3e3f51e..039041a 100644 --- a/frontend/js/components/buttons/wishlist.js +++ b/frontend/js/components/buttons/wishlist.js @@ -13,5 +13,5 @@ export const WishlistButton = ({ wishlisted, wishlist }) => { }; WishlistButton.propTypes = { wishlisted: PropTypes.bool.isRequired, - wishlist: PropTypes.func.isRequired + wishlist: PropTypes.func.isRequired, }; diff --git a/frontend/js/components/details/genres.js b/frontend/js/components/details/genres.js index d739ed2..d1022a6 100644 --- a/frontend/js/components/details/genres.js +++ b/frontend/js/components/details/genres.js @@ -10,7 +10,7 @@ export const Genres = ({ genres }) => { // Uppercase first genres const prettyGenres = genres .toJS() - .map(word => word[0].toUpperCase() + word.substr(1)) + .map((word) => word[0].toUpperCase() + word.substr(1)) .join(", "); return ( diff --git a/frontend/js/components/details/polochon.js b/frontend/js/components/details/polochon.js index 75a038b..704b693 100644 --- a/frontend/js/components/details/polochon.js +++ b/frontend/js/components/details/polochon.js @@ -6,14 +6,14 @@ export const PolochonMetadata = ({ container, videoCodec, audioCodec, - releaseGroup + releaseGroup, }) => { if (!quality || quality === "") { return null; } const metadata = [quality, container, videoCodec, audioCodec, releaseGroup] - .filter(m => m && m !== "") + .filter((m) => m && m !== "") .join(", "); return ( @@ -28,5 +28,5 @@ PolochonMetadata.propTypes = { container: PropTypes.string, videoCodec: PropTypes.string, audioCodec: PropTypes.string, - releaseGroup: PropTypes.string + releaseGroup: PropTypes.string, }; diff --git a/frontend/js/components/details/rating.js b/frontend/js/components/details/rating.js index 6736eb9..8847444 100644 --- a/frontend/js/components/details/rating.js +++ b/frontend/js/components/details/rating.js @@ -16,9 +16,9 @@ export const Rating = ({ rating, votes }) => { }; Rating.propTypes = { rating: PropTypes.number, - votes: PropTypes.number + votes: PropTypes.number, }; Rating.defaultProps = { rating: 0, - votes: 0 + votes: 0, }; diff --git a/frontend/js/components/details/releaseDate.js b/frontend/js/components/details/releaseDate.js index 14a831e..c4e5ff7 100644 --- a/frontend/js/components/details/releaseDate.js +++ b/frontend/js/components/details/releaseDate.js @@ -2,7 +2,7 @@ import React from "react"; import PropTypes from "prop-types"; import moment from "moment"; -const prettyDate = input => { +const prettyDate = (input) => { switch (typeof input) { case "string": if (input === "") { @@ -46,6 +46,6 @@ export const ReleaseDate = ({ date }) => { ); }; ReleaseDate.propTypes = { - date: PropTypes.oneOfType([PropTypes.string, PropTypes.number]) + date: PropTypes.oneOfType([PropTypes.string, PropTypes.number]), }; ReleaseDate.defaultProps = { date: "" }; diff --git a/frontend/js/components/details/title.js b/frontend/js/components/details/title.js index f8839a0..dfeff46 100644 --- a/frontend/js/components/details/title.js +++ b/frontend/js/components/details/title.js @@ -18,8 +18,8 @@ export const Title = ({ title, wishlist, wishlisted }) => { Title.propTypes = { title: PropTypes.string, wishlist: PropTypes.func, - wishlisted: PropTypes.bool + wishlisted: PropTypes.bool, }; Title.defaultProps = { - title: "" + title: "", }; diff --git a/frontend/js/components/details/tracking.js b/frontend/js/components/details/tracking.js index 1b1335f..302eb7a 100644 --- a/frontend/js/components/details/tracking.js +++ b/frontend/js/components/details/tracking.js @@ -5,7 +5,7 @@ export const TrackingLabel = ({ wishlisted, inLibrary, trackedSeason, - trackedEpisode + trackedEpisode, }) => { if (wishlisted === false) { return null; @@ -42,5 +42,5 @@ TrackingLabel.propTypes = { wishlisted: PropTypes.bool, inLibrary: PropTypes.bool, trackedSeason: PropTypes.number, - trackedEpisode: PropTypes.number + trackedEpisode: PropTypes.number, }; diff --git a/frontend/js/components/forms/input.js b/frontend/js/components/forms/input.js index 4fd6d8f..ba685e6 100644 --- a/frontend/js/components/forms/input.js +++ b/frontend/js/components/forms/input.js @@ -8,7 +8,7 @@ export const FormInput = ({ label, value, updateValue }) => { updateValue(e.target.value)} + onChange={(e) => updateValue(e.target.value)} /> ); @@ -16,5 +16,5 @@ export const FormInput = ({ label, value, updateValue }) => { FormInput.propTypes = { label: PropTypes.string, value: PropTypes.string, - updateValue: PropTypes.func + updateValue: PropTypes.func, }; diff --git a/frontend/js/components/forms/modal.js b/frontend/js/components/forms/modal.js index 508800d..9d0010f 100644 --- a/frontend/js/components/forms/modal.js +++ b/frontend/js/components/forms/modal.js @@ -9,9 +9,9 @@ export const FormModal = ({ title, icon, handleSubmit, - children + children, }) => { - const submit = function(e) { + const submit = function (e) { if (e) { e.preventDefault(); } @@ -27,7 +27,7 @@ export const FormModal = ({ -
submit(ev)}> + submit(ev)}> {children}
@@ -48,5 +48,5 @@ FormModal.propTypes = { icon: PropTypes.string, title: PropTypes.string, handleSubmit: PropTypes.func, - children: PropTypes.oneOfType([PropTypes.object, PropTypes.array]) + children: PropTypes.oneOfType([PropTypes.object, PropTypes.array]), }; diff --git a/frontend/js/components/list/details.js b/frontend/js/components/list/details.js index ff6c121..7b9b6b3 100644 --- a/frontend/js/components/list/details.js +++ b/frontend/js/components/list/details.js @@ -16,7 +16,7 @@ import { ReleaseDate } from "../details/releaseDate"; import { Runtime } from "../details/runtime"; import { Title } from "../details/title"; -const ListDetails = props => { +const ListDetails = (props) => { if (props.data === undefined) { return null; } @@ -68,6 +68,6 @@ ListDetails.propTypes = { data: PropTypes.instanceOf(Map), wishlist: PropTypes.func, loading: PropTypes.bool, - children: PropTypes.object + children: PropTypes.object, }; export default ListDetails; diff --git a/frontend/js/components/list/explorerOptions.js b/frontend/js/components/list/explorerOptions.js index bbb3afe..2a0527e 100644 --- a/frontend/js/components/list/explorerOptions.js +++ b/frontend/js/components/list/explorerOptions.js @@ -19,23 +19,23 @@ const ExplorerOptions = ({ display, params, options, type, history }) => { return null; } - const handleSourceChange = event => { + const handleSourceChange = (event) => { let source = event.target.value; let category = options.get(event.target.value).first(); history.push(`/${type}/explore/${source}/${category}`); }; - const handleCategoryChange = event => { + const handleCategoryChange = (event) => { let source = params.source; let category = event.target.value; history.push(`/${type}/explore/${source}/${category}`); }; - const prettyName = name => { + const prettyName = (name) => { return name .replace("_", " ") .split(" ") - .map(w => w[0].toUpperCase() + w.substr(1)) + .map((w) => w[0].toUpperCase() + w.substr(1)) .join(" "); }; @@ -62,7 +62,7 @@ const ExplorerOptions = ({ display, params, options, type, history }) => { onChange={handleSourceChange} value={source} > - {options.keySeq().map(function(source) { + {options.keySeq().map(function (source) { return (
- {props.data.map(function(value, key) { + {props.data.map(function (value, key) { return ; })} @@ -67,10 +67,10 @@ const ModuleByType = props => ( ); ModuleByType.propTypes = { type: PropTypes.string.isRequired, - data: PropTypes.instanceOf(List) + data: PropTypes.instanceOf(List), }; -const Module = props => { +const Module = (props) => { let iconClass, prettyStatus, badgeClass; const name = props.data.get("name"); @@ -121,5 +121,5 @@ const Module = props => { ); }; Module.propTypes = { - data: PropTypes.instanceOf(Map) + data: PropTypes.instanceOf(Map), }; diff --git a/frontend/js/components/movies/list.js b/frontend/js/components/movies/list.js index 4389518..2ca5024 100644 --- a/frontend/js/components/movies/list.js +++ b/frontend/js/components/movies/list.js @@ -5,7 +5,7 @@ import { connect } from "react-redux"; import { selectMovie, updateFilter, - movieWishlistToggle + movieWishlistToggle, } from "../../actions/movies"; import ListDetails from "../list/details"; @@ -24,16 +24,16 @@ function mapStateToProps(state) { movies: state.movieStore.get("movies"), filter: state.movieStore.get("filter"), selectedImdbId: state.movieStore.get("selectedImdbId"), - exploreOptions: state.movieStore.get("exploreOptions") + exploreOptions: state.movieStore.get("exploreOptions"), }; } const mapDispatchToProps = { selectMovie, updateFilter, - movieWishlistToggle + movieWishlistToggle, }; -const MovieList = props => { +const MovieList = (props) => { let selectedMovie = Map(); if (props.movies !== undefined && props.movies.has(props.selectedImdbId)) { selectedMovie = props.movies.get(props.selectedImdbId); @@ -50,10 +50,10 @@ const MovieList = props => { updateFilter={props.updateFilter} filter={props.filter} onClick={props.selectMovie} - onDoubleClick={function() { + onDoubleClick={function () { return; }} - onKeyEnter={function() { + onKeyEnter={function () { return; }} params={props.match.params} @@ -99,7 +99,7 @@ MovieList.propTypes = { updateFilter: PropTypes.func, movieWishlistToggle: PropTypes.func, selectMovie: PropTypes.func, - match: PropTypes.object + match: PropTypes.object, }; export default connect(mapStateToProps, mapDispatchToProps)(MovieList); diff --git a/frontend/js/components/movies/route.js b/frontend/js/components/movies/route.js index a4057d1..f9e5817 100644 --- a/frontend/js/components/movies/route.js +++ b/frontend/js/components/movies/route.js @@ -4,8 +4,8 @@ import { Route } from "react-router-dom"; import { connect } from "react-redux"; import { fetchMovies, getMovieExploreOptions } from "../../actions/movies"; -const mapStateToProps = state => ({ - isExplorerFetched: state.movieStore.get("exploreOptions").size !== 0 +const mapStateToProps = (state) => ({ + isExplorerFetched: state.movieStore.get("exploreOptions").size !== 0, }); const mapDispatchToProps = { fetchMovies, getMovieExploreOptions }; @@ -19,7 +19,7 @@ const MoviesRoute = ({ return ( { + render={(props) => { let fetchUrl = ""; switch (props.match.path) { case "/movies/polochon": @@ -59,7 +59,7 @@ MoviesRoute.propTypes = { match: PropTypes.object, isExplorerFetched: PropTypes.bool.isRequired, fetchMovies: PropTypes.func.isRequired, - getMovieExploreOptions: PropTypes.func.isRequired + getMovieExploreOptions: PropTypes.func.isRequired, }; export default connect(mapStateToProps, mapDispatchToProps)(MoviesRoute); diff --git a/frontend/js/components/movies/subtitlesButton.js b/frontend/js/components/movies/subtitlesButton.js index 496cddf..66d3eff 100644 --- a/frontend/js/components/movies/subtitlesButton.js +++ b/frontend/js/components/movies/subtitlesButton.js @@ -12,7 +12,7 @@ const movieSubtitlesButton = ({ imdbId, searching, searchMovieSubtitles, - subtitles + subtitles, }) => ( ( { +const mapStateToProps = (state) => { let torrentCount = 0; if ( state.torrentStore.has("torrents") && @@ -19,11 +19,11 @@ const mapStateToProps = state => { return { username: state.userStore.get("username"), isAdmin: state.userStore.get("isAdmin"), - torrentCount: torrentCount + torrentCount: torrentCount, }; }; -const AppNavBar = props => { +const AppNavBar = (props) => { const [expanded, setExpanded] = useState(false); return ( @@ -50,7 +50,7 @@ const AppNavBar = props => {