refactor(playqueue): extract play queue params into shared variable

This commit is contained in:
Travis Shivers 2020-09-06 18:46:52 -05:00
parent a1d0868c2a
commit 44c515b8a9
No known key found for this signature in database
GPG Key ID: EE4CC2891B8FCD33
1 changed files with 10 additions and 12 deletions

View File

@ -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,
});