diff --git a/.eslintrc.js b/.eslintrc.js index 763c3e7e..eaab7f2f 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -17,7 +17,7 @@ module.exports = { // ignoreComments: true, // ignoreUrls: true, // ignoreStrings: true, - ignoreTemplateLiterals: true, + // ignoreTemplateLiterals: true, }, ], diff --git a/src/store/modules/plex/getters.js b/src/store/modules/plex/getters.js index 8a3f5636..1840b9d2 100644 --- a/src/store/modules/plex/getters.js +++ b/src/store/modules/plex/getters.js @@ -26,7 +26,8 @@ export default { GET_PLEX_DEVICE_NAME_HEADER: (state, getters) => getters.GET_PLEX_DEVICE_NAME, GET_PLEX_PLATFORM_HEADER: (state, getters) => getters.GET_PLEX_DEVICE_NAME, - GET_PLEX_DEVICE_SCREEN_RESOLUTION_HEADER: () => `${window.screen.availWidth}x${window.screen.availHeight},${window.screen.width}x${window.screen.height}`, + GET_PLEX_DEVICE_SCREEN_RESOLUTION_HEADER: () => `${window.screen.availWidth}x${ + window.screen.availHeight},${window.screen.width}x${window.screen.height}`, GET_PLEX_INITIAL_AUTH_PARAMS: (state, getters, rootState, rootGetters) => ({ 'X-Plex-Product': getters.GET_PLEX_PRODUCT_HEADER, diff --git a/src/store/modules/plexclients/actions.js b/src/store/modules/plexclients/actions.js index 19750126..d8e41918 100644 --- a/src/store/modules/plexclients/actions.js +++ b/src/store/modules/plexclients/actions.js @@ -226,7 +226,9 @@ export default { getters.GET_ACTIVE_SERVER_ID, ).name; await dispatch('DISPLAY_NOTIFICATION', - `Now Playing: ${contentTitleUtils.getCombinedTitle(getters.GET_ACTIVE_MEDIA_METADATA)} from ${serverName}`, + `Now Playing: ${contentTitleUtils.getCombinedTitle( + getters.GET_ACTIVE_MEDIA_METADATA, + )} from ${serverName}`, { root: true }); } diff --git a/src/store/modules/plexservers/actions.js b/src/store/modules/plexservers/actions.js index 102684ba..db8a97f2 100644 --- a/src/store/modules/plexservers/actions.js +++ b/src/store/modules/plexservers/actions.js @@ -316,15 +316,15 @@ export default { return totalSize; }, - CREATE_PLAY_QUEUE: async ({ dispatch }, { machineIdentifier, ratingKey, signal }) => { + CREATE_PLAY_QUEUE: async ({ dispatch }, { machineIdentifier: id, ratingKey, signal }) => { const data = await dispatch('FETCH_PLEX_SERVER', { - machineIdentifier, + machineIdentifier: id, method: 'POST', path: '/playQueues', params: { type: 'video', continuous: 1, - uri: `server://${machineIdentifier}/com.plexapp.plugins.library/library/metadata/${ratingKey}`, + uri: `server://${id}/com.plexapp.plugins.library/library/metadata/${ratingKey}`, repeat: 0, own: 1, includeChapters: 1, diff --git a/src/store/modules/slplayer/getters.js b/src/store/modules/slplayer/getters.js index ba061d55..cf7f9e2a 100644 --- a/src/store/modules/slplayer/getters.js +++ b/src/store/modules/slplayer/getters.js @@ -48,15 +48,19 @@ export default { : null), GET_SRC_URL: (state, getters) => makeUrl( - `${getters.GET_PLEX_SERVER_URL}/video/:/transcode/universal/start.${protocolExtension[getters.GET_STREAMING_PROTOCOL]}`, + `${getters.GET_PLEX_SERVER_URL}/video/:/transcode/universal/start.${ + protocolExtension[getters.GET_STREAMING_PROTOCOL]}`, getters.GET_DECISION_AND_START_PARAMS, ), - GET_SUBTITLE_BASE_URL: (state, getters) => `${getters.GET_PLEX_SERVER_URL}/video/:/transcode/universal/subtitles`, + GET_SUBTITLE_BASE_URL: (state, getters) => `${getters.GET_PLEX_SERVER_URL + }/video/:/transcode/universal/subtitles`, - GET_DECISION_URL: (state, getters) => `${getters.GET_PLEX_SERVER_URL}/video/:/transcode/universal/decision`, + GET_DECISION_URL: (state, getters) => `${getters.GET_PLEX_SERVER_URL + }/video/:/transcode/universal/decision`, - GET_PART_URL: (state, getters) => `${getters.GET_PLEX_SERVER_URL}/library/parts/${getters.GET_PART_ID}`, + GET_PART_URL: (state, getters) => `${getters.GET_PLEX_SERVER_URL + }/library/parts/${getters.GET_PART_ID}`, GET_TIMELINE_URL: (state, getters) => `${getters.GET_PLEX_SERVER_URL}/:/timeline`, @@ -143,9 +147,13 @@ export default { 'plex/GET_PLEX_BASE_PARAMS'](getters.GET_PLEX_SERVER_ACCESS_TOKEN), GET_PLEX_PROFILE_EXTRAS: (state, getters, rootState, rootGetters) => { - const base = `append-transcode-target-codec(type=videoProfile&context=streaming&audioCodec=aac&protocol=${getters.GET_STREAMING_PROTOCOL})`; + const base = 'append-transcode-target-codec(' + + `type=videoProfile&context=streaming&audioCodec=aac&protocol=${ + getters.GET_STREAMING_PROTOCOL})`; return rootGetters['settings/GET_SLPLAYERQUALITY'] - ? `${base}+add-limitation(scope=videoCodec&scopeName=*&type=upperBound&name=video.bitrate&value=${rootGetters['settings/GET_SLPLAYERQUALITY']}&replace=true)` + ? `${base + }+add-limitation(scope=videoCodec&scopeName=*&type=upperBound&name=video.bitrate&value=${ + rootGetters['settings/GET_SLPLAYERQUALITY']}&replace=true)` : base; }, diff --git a/src/store/modules/synclounge/actions.js b/src/store/modules/synclounge/actions.js index 69d43bb5..2db9aac1 100644 --- a/src/store/modules/synclounge/actions.js +++ b/src/store/modules/synclounge/actions.js @@ -523,7 +523,8 @@ export default { } // TODO: fix } else { - const message = `Failed to find a compatible copy of ${getters.GET_HOST_USER.media.title}. If you have access to the content try manually playing it.`; + const message = `Failed to find a compatible copy of ${getters.GET_HOST_USER.media.title + }. If you have access to the content try manually playing it.`; console.warn(message); await dispatch('DISPLAY_NOTIFICATION', message, { root: true }); } diff --git a/src/utils/contenttitleutils.js b/src/utils/contenttitleutils.js index 0f29fc57..d08fd6ce 100644 --- a/src/utils/contenttitleutils.js +++ b/src/utils/contenttitleutils.js @@ -48,14 +48,16 @@ export default { } }, - getCombinedTitle: (metadata) => { - switch (metadata.type) { + getCombinedTitle: ({ + type, grandparentTitle, title, parentIndex, index, + }) => { + switch (type) { case 'episode': { - return `${metadata.grandparentTitle} - ${metadata.title} S${metadata.parentIndex}-E${metadata.index}`; + return `${grandparentTitle} - ${title} S${parentIndex}-E${index}`; } default: { - return metadata.title; + return title; } } },