From 44c515b8a9af8598d8cb34a6f6395cf26d6b2337 Mon Sep 17 00:00:00 2001 From: Travis Shivers Date: Sun, 6 Sep 2020 18:46:52 -0500 Subject: [PATCH] refactor(playqueue): extract play queue params into shared variable --- src/store/modules/plexservers/actions.js | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/src/store/modules/plexservers/actions.js b/src/store/modules/plexservers/actions.js index 14c1b05b..b883582d 100644 --- a/src/store/modules/plexservers/actions.js +++ b/src/store/modules/plexservers/actions.js @@ -3,6 +3,14 @@ import { fetchJson, queryFetch } from '@/utils/fetchutils'; import weightedRandomChoice from '@/utils/weightedrandomchoice'; import scoreMedia from './mediascoring'; +const playQueueParams = { + own: 1, + includeChapters: 1, + includeMarkers: 1, + includeGeolocation: 1, + includeExternalMedia: 1, +}; + export default { FETCH_RANDOM_SECTION_ID: async ({ getters }, machineIdentifier) => { const sectionId = weightedRandomChoice(getters.GET_SERVER_LIBRARY_SIZES(machineIdentifier)); @@ -332,11 +340,7 @@ export default { continuous: 1, uri: `server://${id}/com.plexapp.plugins.library/library/metadata/${ratingKey}`, repeat: 0, - own: 1, - includeChapters: 1, - includeMarkers: 1, - includeGeolocation: 1, - includeExternalMedia: 1, + ...playQueueParams, }, signal, }); @@ -348,13 +352,7 @@ export default { const { MediaContainer } = await dispatch('FETCH_PLEX_SERVER', { machineIdentifier, path: `/playQueues/${playQueueID}`, - params: { - own: 1, - includeChapters: 1, - includeMarkers: 1, - includeGeolocation: 1, - includeExternalMedia: 1, - }, + params: playQueueParams, signal, });