diff --git a/package-lock.json b/package-lock.json index 26e6aaf4..8a96eccb 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,5 +1,5 @@ { - "name": "SyncLounge", + "name": "synclounge", "version": "0.0.0-semantically-released", "lockfileVersion": 1, "requires": true, @@ -1774,6 +1774,7 @@ "resolved": "https://registry.npmjs.org/@types/mini-css-extract-plugin/-/mini-css-extract-plugin-0.9.1.tgz", "integrity": "sha512-+mN04Oszdz9tGjUP/c1ReVwJXxSniLd7lF++sv+8dkABxVNthg6uccei+4ssKxRHGoMmPxdn7uBdJWONSJGTGQ==", "dev": true, + "optional": true, "requires": { "@types/webpack": "*" } @@ -12121,6 +12122,12 @@ "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.2.tgz", "integrity": "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==", "dev": true + }, + "uuid": { + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz", + "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==", + "dev": true } } }, @@ -12893,6 +12900,14 @@ "faye-websocket": "^0.10.0", "uuid": "^3.4.0", "websocket-driver": "0.6.5" + }, + "dependencies": { + "uuid": { + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz", + "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==", + "dev": true + } } }, "sockjs-client": { @@ -14589,9 +14604,9 @@ "integrity": "sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM=" }, "uuid": { - "version": "3.4.0", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz", - "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==", + "version": "8.3.0", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.0.tgz", + "integrity": "sha512-fX6Z5o4m6XsXBdli9g7DtWgAx+osMsRRZFKma1mIUsLCz6vRvv+pz5VNbyu9UEDzpMWulZfvpgb/cmDXVulYFQ==", "dev": true }, "v-clipboard": { @@ -14800,6 +14815,7 @@ "resolved": "https://registry.npmjs.org/vue-loader/-/vue-loader-16.0.0-beta.5.tgz", "integrity": "sha512-ciWfzNefqWlmzKznCWY9hl+fPP4KlQ0A9MtHbJ/8DpyY+dAM8gDrjufIdxwTgC4szE4EZC3A6ip/BbrqM84GqA==", "dev": true, + "optional": true, "requires": { "@types/mini-css-extract-plugin": "^0.9.1", "chalk": "^3.0.0", @@ -14814,6 +14830,7 @@ "resolved": "https://registry.npmjs.org/chalk/-/chalk-3.0.0.tgz", "integrity": "sha512-4D3B6Wf41KOYRFdszmDqMCGq5VV/uMAB273JILmO+3jAlh8X4qDtdtgCR3fxtbLEMzSx22QdhnDcJvu2u1fVwg==", "dev": true, + "optional": true, "requires": { "ansi-styles": "^4.1.0", "supports-color": "^7.1.0" @@ -14823,7 +14840,8 @@ "version": "0.6.1", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true + "dev": true, + "optional": true } } }, @@ -15906,6 +15924,14 @@ "requires": { "ansi-colors": "^3.0.0", "uuid": "^3.3.2" + }, + "dependencies": { + "uuid": { + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz", + "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==", + "dev": true + } } }, "webpack-merge": { diff --git a/package.json b/package.json index 54206fe0..16c528f2 100644 --- a/package.json +++ b/package.json @@ -46,6 +46,7 @@ "string-similarity": "^4.0.2", "stylelint": "^13.6.1", "stylelint-config-standard": "^20.0.0", + "uuid": "^8.3.0", "v-clipboard": "^2.2.3", "vanilla-tilt": "^1.7.0", "vue": "^2.6.12", @@ -67,4 +68,4 @@ "type": "git", "url": "git+https://github.com/ttshivers/synclounge.git" } -} \ No newline at end of file +} diff --git a/src/store/modules/plex/state.js b/src/store/modules/plex/state.js index 20708935..fadcb2ce 100644 --- a/src/store/modules/plex/state.js +++ b/src/store/modules/plex/state.js @@ -1,11 +1,11 @@ -import guid from '@/utils/guid'; +import { v4 as uuidv4 } from 'uuid'; const state = () => ({ user: null, doneFetchingDevices: false, deviceFetchPromise: null, plexAuthToken: null, - clientIdentifier: guid(), + clientIdentifier: uuidv4(), }); export default state; diff --git a/src/store/modules/slplayer/actions.js b/src/store/modules/slplayer/actions.js index a843c488..ada32815 100644 --- a/src/store/modules/slplayer/actions.js +++ b/src/store/modules/slplayer/actions.js @@ -1,6 +1,6 @@ import CAF from 'caf'; -import guid from '@/utils/guid'; +import { v4 as uuidv4 } from 'uuid'; import { fetchJson, queryFetch } from '@/utils/fetchutils'; import { play, pause, getDurationMs, getCurrentTimeMs, isTimeInBufferedRange, @@ -94,7 +94,7 @@ export default { commit('SET_FORCE_TRANSCODE_RETRY', false); } - commit('SET_SESSION', guid()); + commit('SET_SESSION', uuidv4()); try { await dispatch('SEND_PLEX_DECISION_REQUEST'); diff --git a/src/store/modules/slplayer/state.js b/src/store/modules/slplayer/state.js index 44951c0a..eaa9164d 100644 --- a/src/store/modules/slplayer/state.js +++ b/src/store/modules/slplayer/state.js @@ -1,9 +1,9 @@ -import guid from '@/utils/guid'; +import { v4 as uuidv4 } from 'uuid'; import { subtitlePositions, subtitleSizes, subtitleColors } from '@/utils/subtitleutils'; const state = () => ({ session: null, - xplexsessionId: guid(), + xplexsessionId: uuidv4(), plexDecision: null, mediaIndex: 0, offsetMs: 0, diff --git a/src/store/modules/synclounge/actions.js b/src/store/modules/synclounge/actions.js index 23372dbd..aadd05dd 100644 --- a/src/store/modules/synclounge/actions.js +++ b/src/store/modules/synclounge/actions.js @@ -1,5 +1,5 @@ import CAF from 'caf'; -import guid from '@/utils/guid'; +import { v4 as uuidv4 } from 'uuid'; import eventhandlers from '@/store/modules/synclounge/eventhandlers'; import { combineUrl, combineRelativeUrlParts } from '@/utils/combineurl'; import { fetchJson } from '@/utils/fetchutils'; @@ -224,7 +224,7 @@ export default { CREATE_AND_JOIN_ROOM: ({ getters, dispatch }) => dispatch('SET_AND_CONNECT_AND_JOIN_ROOM', { server: getters.GET_BEST_SERVER, - room: guid(), + room: uuidv4(), password: null, }), diff --git a/src/utils/guid.js b/src/utils/guid.js deleted file mode 100644 index d3f03335..00000000 --- a/src/utils/guid.js +++ /dev/null @@ -1,7 +0,0 @@ -const s4 = () => Math.floor((1 + Math.random()) * 0x10000) - .toString(16) - .substring(1); - -const guid = () => s4() + s4() + s4() + s4(); - -export default guid;