refactor(playqueue): extract play queue params into shared variable
This commit is contained in:
parent
a1d0868c2a
commit
44c515b8a9
|
@ -3,6 +3,14 @@ import { fetchJson, queryFetch } from '@/utils/fetchutils';
|
||||||
import weightedRandomChoice from '@/utils/weightedrandomchoice';
|
import weightedRandomChoice from '@/utils/weightedrandomchoice';
|
||||||
import scoreMedia from './mediascoring';
|
import scoreMedia from './mediascoring';
|
||||||
|
|
||||||
|
const playQueueParams = {
|
||||||
|
own: 1,
|
||||||
|
includeChapters: 1,
|
||||||
|
includeMarkers: 1,
|
||||||
|
includeGeolocation: 1,
|
||||||
|
includeExternalMedia: 1,
|
||||||
|
};
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
FETCH_RANDOM_SECTION_ID: async ({ getters }, machineIdentifier) => {
|
FETCH_RANDOM_SECTION_ID: async ({ getters }, machineIdentifier) => {
|
||||||
const sectionId = weightedRandomChoice(getters.GET_SERVER_LIBRARY_SIZES(machineIdentifier));
|
const sectionId = weightedRandomChoice(getters.GET_SERVER_LIBRARY_SIZES(machineIdentifier));
|
||||||
|
@ -332,11 +340,7 @@ export default {
|
||||||
continuous: 1,
|
continuous: 1,
|
||||||
uri: `server://${id}/com.plexapp.plugins.library/library/metadata/${ratingKey}`,
|
uri: `server://${id}/com.plexapp.plugins.library/library/metadata/${ratingKey}`,
|
||||||
repeat: 0,
|
repeat: 0,
|
||||||
own: 1,
|
...playQueueParams,
|
||||||
includeChapters: 1,
|
|
||||||
includeMarkers: 1,
|
|
||||||
includeGeolocation: 1,
|
|
||||||
includeExternalMedia: 1,
|
|
||||||
},
|
},
|
||||||
signal,
|
signal,
|
||||||
});
|
});
|
||||||
|
@ -348,13 +352,7 @@ export default {
|
||||||
const { MediaContainer } = await dispatch('FETCH_PLEX_SERVER', {
|
const { MediaContainer } = await dispatch('FETCH_PLEX_SERVER', {
|
||||||
machineIdentifier,
|
machineIdentifier,
|
||||||
path: `/playQueues/${playQueueID}`,
|
path: `/playQueues/${playQueueID}`,
|
||||||
params: {
|
params: playQueueParams,
|
||||||
own: 1,
|
|
||||||
includeChapters: 1,
|
|
||||||
includeMarkers: 1,
|
|
||||||
includeGeolocation: 1,
|
|
||||||
includeExternalMedia: 1,
|
|
||||||
},
|
|
||||||
signal,
|
signal,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue