-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Expand file tree
/
Copy pathutils.js
More file actions
818 lines (689 loc) · 21.8 KB
/
utils.js
File metadata and controls
818 lines (689 loc) · 21.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
import i18n from '../../i18n/index'
import {
CHANNEL_HANDLE_REGEX,
createWebURL,
getVideoParamsFromUrl,
replaceFilenameForbiddenChars,
searchFiltersMatch,
} from '../../helpers/utils'
const state = {
isSideNavOpen: false,
outlinesHidden: true,
sessionSearchHistory: [],
popularCache: null,
trendingCache: {
gaming: null,
sports: null,
podcasts: null
},
cachedPlaylist: null,
deArrowCache: {},
showProgressBar: false,
showAddToPlaylistPrompt: false,
showCreatePlaylistPrompt: false,
isKeyboardShortcutPromptShown: false,
showSearchFilters: false,
searchFilterValueChanged: false,
progressBarPercentage: 0,
toBeAddedToPlaylistVideoList: [],
newPlaylistDefaultProperties: {},
newPlaylistVideoObject: [],
regionNames: [],
regionValues: [],
recentBlogPosts: [],
searchSettings: {
sortBy: 'relevance',
time: '',
type: 'all',
duration: '',
features: [],
},
externalPlayerNames: [],
externalPlayerValues: [],
externalPlayerCmdArguments: {},
lastPopularRefreshTimestamp: '',
lastTrendingRefreshTimestamp: {
gaming: '',
sports: '',
podcasts: ''
},
subscriptionFirstAutoFetchRunData: {
videos: false,
liveStreams: false,
shorts: false,
posts: false,
},
appTitle: '',
openPrompts: new Set()
}
const getters = {
getIsSideNavOpen(state) {
return state.isSideNavOpen
},
getOutlinesHidden(state) {
return state.outlinesHidden
},
getSessionSearchHistory(state) {
return state.sessionSearchHistory
},
getDeArrowCache: (state) => {
return state.deArrowCache
},
getPopularCache(state) {
return state.popularCache
},
getTrendingCache(state) {
return state.trendingCache
},
getCachedPlaylist(state) {
return state.cachedPlaylist
},
getSearchSettings(state) {
return state.searchSettings
},
getSearchFilterValueChanged(state) {
return state.searchFilterValueChanged
},
getIsKeyboardShortcutPromptShown(state) {
return state.isKeyboardShortcutPromptShown
},
getShowAddToPlaylistPrompt(state) {
return state.showAddToPlaylistPrompt
},
getShowCreatePlaylistPrompt(state) {
return state.showCreatePlaylistPrompt
},
getShowSearchFilters(state) {
return state.showSearchFilters
},
getToBeAddedToPlaylistVideoList(state) {
return state.toBeAddedToPlaylistVideoList
},
getNewPlaylistDefaultProperties(state) {
return state.newPlaylistDefaultProperties
},
getNewPlaylistVideoObject(state) {
return state.newPlaylistVideoObject
},
getShowProgressBar(state) {
return state.showProgressBar
},
getProgressBarPercentage(state) {
return state.progressBarPercentage
},
getRegionNames(state) {
return state.regionNames
},
getRegionValues(state) {
return state.regionValues
},
getRecentBlogPosts(state) {
return state.recentBlogPosts
},
getExternalPlayerNames(state) {
return state.externalPlayerNames
},
getExternalPlayerValues(state) {
return state.externalPlayerValues
},
getExternalPlayerCmdArguments (state) {
return state.externalPlayerCmdArguments
},
getLastTrendingRefreshTimestamp(state) {
return state.lastTrendingRefreshTimestamp
},
getLastPopularRefreshTimestamp(state) {
return state.lastPopularRefreshTimestamp
},
getSubscriptionForVideosFirstAutoFetchRun(state) {
return state.subscriptionFirstAutoFetchRunData.videos === true
},
getSubscriptionForLiveStreamsFirstAutoFetchRun (state) {
return state.subscriptionFirstAutoFetchRunData.liveStreams === true
},
getSubscriptionForShortsFirstAutoFetchRun (state) {
return state.subscriptionFirstAutoFetchRunData.shorts === true
},
getSubscriptionForPostsFirstAutoFetchRun (state) {
return state.subscriptionFirstAutoFetchRunData.posts === true
},
getAppTitle (state) {
return state.appTitle
},
isAnyPromptOpen(state) {
return state.openPrompts.size > 0
}
}
const actions = {
showOutlines({ commit }) {
commit('setOutlinesHidden', false)
},
hideOutlines({ commit }) {
commit('setOutlinesHidden', true)
},
parseScreenshotCustomFileName: function({ rootState }, payload) {
const { pattern = rootState.settings.screenshotFilenamePattern, date, playerTime, videoId } = payload
const keywords = [
['%Y', date.getFullYear()], // year 4 digits
['%M', (date.getMonth() + 1).toString().padStart(2, '0')], // month 2 digits
['%D', date.getDate().toString().padStart(2, '0')], // day 2 digits
['%H', date.getHours().toString().padStart(2, '0')], // hour 2 digits
['%N', date.getMinutes().toString().padStart(2, '0')], // minute 2 digits
['%S', date.getSeconds().toString().padStart(2, '0')], // second 2 digits
['%T', date.getMilliseconds().toString().padStart(3, '0')], // millisecond 3 digits
['%s', parseInt(playerTime)], // video position second n digits
['%t', (playerTime % 1).toString().slice(2, 5) || '000'], // video position millisecond 3 digits
['%i', videoId] // video id
]
let parsedString = pattern
for (const [key, value] of keywords) {
parsedString = parsedString.replaceAll(key, value)
}
if (parsedString !== replaceFilenameForbiddenChars(parsedString)) {
throw new Error(i18n.global.t('Settings.Player Settings.Screenshot.Error.Forbidden Characters'))
}
if (!parsedString) {
throw new Error(i18n.global.t('Settings.Player Settings.Screenshot.Error.Empty File Name'))
}
return parsedString
},
showAddToPlaylistPromptForManyVideos ({ commit }, { videos: videoObjectArray, newPlaylistDefaultProperties }) {
let videoDataValid = true
if (!Array.isArray(videoObjectArray)) {
videoDataValid = false
}
let missingKeys = []
if (videoDataValid) {
const requiredVideoKeys = [
'videoId',
'title',
'lengthSeconds',
// These two properties will be missing for shorts added to a playlist from anywhere but the watch page
// 'author',
// 'authorId',
// `timeAdded` should be generated when videos are added
// Not when a prompt is displayed
// 'timeAdded',
// `playlistItemId` should be generated anyway
// 'playlistItemId',
// `type` should be added in action anyway
// 'type',
]
// Using `every` to loop and `return false` to break
videoObjectArray.every((video) => {
const videoPropertyKeys = Object.keys(video)
const missingKeysHere = requiredVideoKeys.filter(x => !videoPropertyKeys.includes(x))
if (missingKeysHere.length > 0) {
videoDataValid = false
missingKeys = missingKeysHere
return false
}
// Return true to continue loop
return true
})
}
if (!videoDataValid) {
// Print error and abort
const errorMsgText = 'Incorrect videos data passed when opening playlist prompt'
console.error(errorMsgText)
console.error({
videoObjectArray,
missingKeys,
})
throw new Error(errorMsgText)
}
commit('setShowAddToPlaylistPrompt', true)
commit('setToBeAddedToPlaylistVideoList', videoObjectArray)
if (newPlaylistDefaultProperties != null) {
commit('setNewPlaylistDefaultProperties', newPlaylistDefaultProperties)
}
},
hideAddToPlaylistPrompt ({ commit }) {
commit('setShowAddToPlaylistPrompt', false)
// The default value properties are only valid until prompt is closed
commit('resetNewPlaylistDefaultProperties')
},
showCreatePlaylistPrompt ({ commit }, data) {
commit('setShowCreatePlaylistPrompt', true)
commit('setNewPlaylistVideoObject', data)
},
showKeyboardShortcutPrompt ({ commit }) {
commit('setIsKeyboardShortcutPromptShown', true)
},
hideKeyboardShortcutPrompt ({ commit }) {
commit('setIsKeyboardShortcutPromptShown', false)
},
showSearchFilters ({ commit }) {
commit('setShowSearchFilters', true)
},
hideSearchFilters ({ commit }) {
commit('setShowSearchFilters', false)
},
updateShowProgressBar ({ commit }, value) {
commit('setShowProgressBar', value)
},
async getRegionData ({ commit }, locale) {
const localePathExists = process.env.GEOLOCATION_NAMES.includes(locale)
const url = createWebURL(`/static/geolocations/${localePathExists ? locale : 'en-US'}.json`)
const countries = await (await fetch(url)).json()
commit('setRegionNames', countries.names)
commit('setRegionValues', countries.codes)
},
async getYoutubeUrlInfo({ rootState, state }, urlStr) {
// Returns
// - urlType [String] `video`, `playlist`
//
// If `urlType` is "video"
// - videoId [String]
// - timestamp [String]
//
// If `urlType` is "playlist"
// - playlistId [String]
// - query [Object]
//
// If `urlType` is "search"
// - searchQuery [String]
// - query [Object]
//
// If `urlType` is "hashtag"
// Nothing else
//
// If `urlType` is "channel"
// - channelId [String]
//
// If `urlType` is "unknown"
// Nothing else
//
// If `urlType` is "invalid_url"
// Nothing else
if (CHANNEL_HANDLE_REGEX.test(urlStr)) {
urlStr = `https://www.youtube.com/${urlStr}`
}
const { videoId, timestamp, playlistId } = getVideoParamsFromUrl(urlStr)
if (videoId) {
return {
urlType: 'video',
videoId,
playlistId,
timestamp
}
}
let url
try {
url = new URL(urlStr)
} catch {
return {
urlType: 'invalid_url'
}
}
let urlType = 'unknown'
const channelPattern =
/^\/(?:(?:channel|user|c)\/)?(?<channelId>[^/]+)(?:\/(?<tab>join|featured|videos|shorts|live|streams|podcasts|releases|courses|playlists|about|community|channels))?\/?$/
const hashtagPattern = /^\/hashtag\/(?<tag>[^#&/?]+)$/
const postPattern = /^\/post\/(?<postId>.+)/
const feedPattern = /^\/feed\/(?<type>trending|subscriptions|history|playlists|you|library)/
const typePatterns = new Map([
['playlist', /^(\/playlist\/?|\/embed(\/?videoseries)?)$/],
['search', /^\/results|search\/?$/],
['hashtag', hashtagPattern],
['post', postPattern],
['feed', feedPattern],
['channel', channelPattern],
])
for (const [type, pattern] of typePatterns) {
const matchFound = pattern.test(url.pathname)
if (matchFound) {
urlType = type
break
}
}
switch (urlType) {
case 'playlist': {
if (!url.searchParams.has('list')) {
throw new Error('Playlist: "list" field not found')
}
const playlistId = url.searchParams.get('list')
url.searchParams.delete('list')
const query = {}
for (const [param, value] of url.searchParams) {
query[param] = value
}
return {
urlType: 'playlist',
playlistId,
query
}
}
case 'search': {
let searchQuery = null
if (url.searchParams.has('search_query')) {
// https://www.youtube.com/results?search_query={QUERY}
searchQuery = url.searchParams.get('search_query')
url.searchParams.delete('search_query')
}
if (url.searchParams.has('q')) {
// https://redirect.invidious.io/search?q={QUERY}
searchQuery = url.searchParams.get('q')
url.searchParams.delete('q')
}
if (searchQuery == null) {
throw new Error('Search: "search_query" field not found')
}
const searchSettings = state.searchSettings
const query = {
sortBy: searchSettings.sortBy,
time: searchSettings.time,
type: searchSettings.type,
duration: searchSettings.duration,
features: searchSettings.features
}
for (const [param, value] of url.searchParams) {
query[param] = value
}
return {
urlType: 'search',
searchQuery,
query
}
}
case 'hashtag': {
const match = url.pathname.match(hashtagPattern)
const hashtag = match.groups.tag
return {
urlType: 'hashtag',
hashtag
}
}
case 'post': {
const match = url.pathname.match(postPattern)
const postId = match.groups.postId
const query = { authorId: url.searchParams.get('ucid') }
return {
urlType: 'post',
postId,
query
}
}
/*
Using RegExp named capture groups from ES2018
To avoid access to specific captured value broken
Channel URL (ID-based)
https://www.youtube.com/channel/UCfMJ2MchTSW2kWaT0kK94Yw
https://www.youtube.com/channel/UCfMJ2MchTSW2kWaT0kK94Yw/about
https://www.youtube.com/channel/UCfMJ2MchTSW2kWaT0kK94Yw/channels
https://www.youtube.com/channel/UCfMJ2MchTSW2kWaT0kK94Yw/community
https://www.youtube.com/channel/UCfMJ2MchTSW2kWaT0kK94Yw/featured
https://www.youtube.com/channel/UCfMJ2MchTSW2kWaT0kK94Yw/join
https://www.youtube.com/channel/UCfMJ2MchTSW2kWaT0kK94Yw/playlists
https://www.youtube.com/channel/UCfMJ2MchTSW2kWaT0kK94Yw/videos
Custom URL
https://www.youtube.com/c/YouTubeCreators
https://www.youtube.com/c/YouTubeCreators/about
etc.
Legacy Username URL
https://www.youtube.com/user/ufoludek
https://www.youtube.com/user/ufoludek/about
etc.
*/
case 'channel': {
const match = url.pathname.match(channelPattern)
const channelId = match.groups.channelId
if (!channelId) {
throw new Error('Channel: could not extract id')
}
let subPath
switch (match.groups.tab) {
case 'shorts':
subPath = 'shorts'
break
case 'live':
case 'streams':
subPath = 'live'
break
case 'playlists':
subPath = 'playlists'
break
case 'podcasts':
subPath = 'podcasts'
break
case 'courses':
subPath = 'courses'
break
case 'releases':
subPath = 'releases'
break
case 'channels':
case 'about':
subPath = 'about'
break
case 'community':
if (url.searchParams.has('lb')) {
// if it has the lb search parameter then it is linking a specific community post
const postId = url.searchParams.get('lb')
const query = { authorId: channelId }
return {
urlType: 'post',
postId,
query
}
}
subPath = 'community'
break
case 'videos':
subPath = 'videos'
break
default:
subPath = rootState.settings.backendPreference === 'local' && !rootState.settings.hideChannelHome ? 'home' : 'videos'
break
}
return {
urlType: 'channel',
channelId,
subPath,
// The original URL could be from Invidious.
// We need to make sure it starts with youtube.com, so that YouTube's resolve endpoint can recognise it
url: `https://www.youtube.com${url.pathname}`
}
}
case 'feed': {
/** @type {'trending' | 'subscriptions' | 'history' | 'playlists' | 'you' | 'library'} */
const feedType = url.pathname.match(feedPattern).groups.type
if (feedType === 'playlists' || feedType === 'you' || feedType === 'library') {
return { urlType: 'userplaylists' }
} else if (process.env.SUPPORTS_LOCAL_API || feedType !== 'trending') {
return { urlType: feedType }
}
// Can fall through if a trending URL is detected in a build without the local API
}
default: {
// Unknown URL type
return {
urlType: 'unknown'
}
}
}
},
clearSessionSearchHistory ({ commit }) {
commit('setSessionSearchHistory', [])
},
async getExternalPlayerCmdArgumentsData ({ commit }) {
const url = createWebURL('/static/external-player-map.json')
const externalPlayerMap = await (await fetch(url)).json()
// Sort external players alphabetically & case-insensitive, keep default entry at the top
const playerNone = externalPlayerMap.shift()
externalPlayerMap.sort((a, b) => a.name.localeCompare(b.name, undefined, { sensitivity: 'base' }))
externalPlayerMap.unshift(playerNone)
const externalPlayerNames = externalPlayerMap.map((entry) => { return entry.name })
const externalPlayerValues = externalPlayerMap.map((entry) => { return entry.value })
const externalPlayerCmdArguments = externalPlayerMap.reduce((result, item) => {
result[item.value] = item.cmdArguments
return result
}, {})
commit('setExternalPlayerNames', externalPlayerNames)
commit('setExternalPlayerValues', externalPlayerValues)
commit('setExternalPlayerCmdArguments', externalPlayerCmdArguments)
},
}
const mutations = {
toggleSideNav (state) {
state.isSideNavOpen = !state.isSideNavOpen
},
setOutlinesHidden(state, value) {
state.outlinesHidden = value
},
setShowProgressBar (state, value) {
state.showProgressBar = value
},
setProgressBarPercentage (state, value) {
state.progressBarPercentage = value
},
setSessionSearchHistory (state, history) {
state.sessionSearchHistory = history
},
setDeArrowCache (state, cache) {
state.deArrowCache = cache
},
addVideoToDeArrowCache (state, payload) {
const sameVideo = state.deArrowCache[payload.videoId]
if (!sameVideo) {
state.deArrowCache[payload.videoId] = payload
}
},
addThumbnailToDeArrowCache (state, payload) {
state.deArrowCache[payload.videoId] = payload
},
removeFromSessionSearchHistory (state, query) {
state.sessionSearchHistory = state.sessionSearchHistory.filter((search) => search.query !== query)
},
addToSessionSearchHistory (state, payload) {
const sameSearch = state.sessionSearchHistory.findIndex((search) => {
return search.query === payload.query && searchFiltersMatch(payload.searchSettings, search.searchSettings)
})
if (sameSearch !== -1) {
state.sessionSearchHistory[sameSearch].data = payload.data
if (payload.nextPageRef) {
// Local API
state.sessionSearchHistory[sameSearch].nextPageRef = payload.nextPageRef
} else if (payload.searchPage) {
// Invidious API
state.sessionSearchHistory[sameSearch].searchPage = payload.searchPage
}
} else {
state.sessionSearchHistory.push(payload)
}
},
setShowAddToPlaylistPrompt (state, payload) {
state.showAddToPlaylistPrompt = payload
},
setShowCreatePlaylistPrompt (state, payload) {
state.showCreatePlaylistPrompt = payload
},
setIsKeyboardShortcutPromptShown (state, payload) {
state.isKeyboardShortcutPromptShown = payload
},
setShowSearchFilters (state, payload) {
state.showSearchFilters = payload
},
setToBeAddedToPlaylistVideoList (state, payload) {
state.toBeAddedToPlaylistVideoList = payload
},
setNewPlaylistDefaultProperties (state, payload) {
state.newPlaylistDefaultProperties = payload
},
resetNewPlaylistDefaultProperties (state) {
state.newPlaylistDefaultProperties = {}
},
setNewPlaylistVideoObject (state, payload) {
state.newPlaylistVideoObject = payload
},
setPopularCache (state, value) {
state.popularCache = value
},
setTrendingCache (state, { value, page }) {
state.trendingCache[page] = value
},
/**
* @param {typeof state} state
* @param {{page: 'gaming' | 'sports' | 'podcasts', timestamp: Date}} param1
*/
setLastTrendingRefreshTimestamp (state, { page, timestamp }) {
state.lastTrendingRefreshTimestamp[page] = timestamp
},
setLastPopularRefreshTimestamp (state, timestamp) {
state.lastPopularRefreshTimestamp = timestamp
},
/**
* @param {typeof state} state
* @param {'gaming' | 'sports' | 'podcasts'} page
*/
clearTrendingCache(state, page) {
state.trendingCache[page] = null
},
setCachedPlaylist(state, value) {
state.cachedPlaylist = value
},
setSearchFilterValueChanged (state, value) {
state.searchFilterValueChanged = value
},
setSearchSortBy (state, value) {
state.searchSettings.sortBy = value
},
setSearchTime (state, value) {
state.searchSettings.time = value
},
setSearchType (state, value) {
state.searchSettings.type = value
},
setSearchDuration (state, value) {
state.searchSettings.duration = value
},
setSearchFeatures (state, value) {
state.searchSettings.features = value
},
setRegionNames (state, value) {
state.regionNames = value
},
setRegionValues (state, value) {
state.regionValues = value
},
setRecentBlogPosts (state, value) {
state.recentBlogPosts = value
},
setExternalPlayerNames (state, value) {
state.externalPlayerNames = value
},
setExternalPlayerValues (state, value) {
state.externalPlayerValues = value
},
setExternalPlayerCmdArguments (state, value) {
state.externalPlayerCmdArguments = value
},
// Use this to set the app title / document.title
setAppTitle (state, value) {
state.appTitle = value
},
addOpenPrompt(state, id) {
state.openPrompts.add(id)
},
removeOpenPrompt(state, id) {
state.openPrompts.delete(id)
},
setSubscriptionForVideosFirstAutoFetchRun (state) {
state.subscriptionFirstAutoFetchRunData.videos = true
},
setSubscriptionForLiveStreamsFirstAutoFetchRun (state) {
state.subscriptionFirstAutoFetchRunData.liveStreams = true
},
setSubscriptionForShortsFirstAutoFetchRun (state) {
state.subscriptionFirstAutoFetchRunData.shorts = true
},
setSubscriptionForPostsFirstAutoFetchRun (state) {
state.subscriptionFirstAutoFetchRunData.posts = true
}
}
export default {
state,
getters,
actions,
mutations
}