Fixing some errors

This commit is contained in:
Travis Shivers 2020-05-28 03:00:29 -05:00
parent 6320d5a488
commit bae722c6e0
8 changed files with 33 additions and 37 deletions

View File

@ -22,6 +22,7 @@
"core-js": "^3.6.5",
"cors": "^2.8.5",
"express": "^4.17.1",
"lodash": "^4.17.15",
"sails-disk": "^2.1.0",
"sails-mysql": "^1.0.1",
"socket.io": "^2.3.0",

View File

@ -193,19 +193,13 @@ import './assets/css/style.css';
import { mapActions, mapGetters, mapState } from 'vuex';
import fscreen from 'fscreen';
import rightsidebar from './sidebar.vue';
import leftsidebar from './leftsidebar.vue';
import upnext from './upnext.vue';
import nowplayingchip from './nowplayingchip.vue';
import donate from './donate.vue';
export default {
components: {
rightsidebar,
upnext,
nowplayingchip,
leftsidebar,
donate,
rightsidebar: () => import('./sidebar.vue'),
upnext: () => import('./upnext.vue'),
nowplayingchip: () => import('./nowplayingchip.vue'),
leftsidebar: () => import('./leftsidebar.vue'),
donate: () => import('./donate.vue'),
},
data() {
return {

View File

@ -174,8 +174,9 @@
</template>
<script>
import plexthumb from './plexthumb.vue';
const _ = require('lodash');
const plexthumb = require('./plexthumb.vue');
export default {
@ -229,7 +230,7 @@ export default {
const data = [];
if (this.libraries) {
this.libraries.MediaContainer.Directory.forEach((library) => {
if (library.type != 'artist' || library.agent != 'tv.plex.agents.music') {
if (library.type !== 'artist' || library.agent !== 'tv.plex.agents.music') {
data.push(library);
}
});

View File

@ -31,7 +31,8 @@
<small
v-if="showServer !== undefined"
class="ma-1"
style="position:absolute; top:0;text-align:right;right:0;background: rgba(0, 0, 0, .5)"
style="position:absolute; top:0;text-align:right;right:0;
background: rgba(0, 0, 0, .5)"
>
{{ server.name }}</small>
<div

View File

@ -1,9 +1,6 @@
import Vue from 'vue';
import Router from 'vue-router';
// ===================== Pages Components ======================
import signin from '../components/signin.vue';
import signout from '../components/signout.vue';
import join from '../components/join.vue';
Vue.use(Router);
@ -21,19 +18,19 @@ export default new Router({
{
path: '/signin',
meta: {},
component: signin,
component: () => import('../components/signin.vue'),
},
{
path: '/signout',
meta: {},
component: signout,
component: () => import('../components/signout.vue'),
},
{
path: '/join',
meta: {
protected: false,
},
component: join,
component: () => import('../components/join.vue'),
},
{
path: '/clientselect',

View File

@ -116,7 +116,8 @@
>
<v-icon
v-if="getHostUser.playerState !== 'playing'"
style="font-size: 26px; opacity: 0.8; position: absolute;background-color: rgba(0,0,0,0.5)"
style="font-size: 26px; opacity: 0.8; position: absolute;
background-color: rgba(0,0,0,0.5)"
>
{{ playerState(getHostUser) }}
</v-icon>
@ -205,7 +206,8 @@
>
<v-icon
v-if="user.playerState !== 'playing'"
style="font-size: 26px; opacity: 0.8; position: absolute;background-color: rgba(0,0,0,0.7)"
style="font-size: 26px; opacity: 0.8; position: absolute;
background-color: rgba(0,0,0,0.7)"
>
{{ playerState(user) }}
</v-icon>
@ -270,9 +272,6 @@
Make Host
</v-list-item-title>
</v-list-item>
<!-- <v-list-item @click.stop="openInviteDialog(user)">
<v-list-item-title class="user-menu-list">Invite to a Plex Server</v-list-item-title>
</v-list-item>-->
</v-list>
</v-menu>
</v-list-item-action>

View File

@ -3,8 +3,7 @@ function sendNotification(message) {
}
export default {
async PLAYBACK_CHANGE({ commit, state, dispatch }, data) {
const [client, ratingKey, mediaContainer] = data;
async PLAYBACK_CHANGE({ commit, state, dispatch }, [, ratingKey, mediaContainer]) {
if (ratingKey) {
// Playing something different!
const server = state.plex.servers[mediaContainer.machineIdentifier];
@ -53,9 +52,8 @@ export default {
},
NEW_TIMELINE({
commit, state, dispatch, getters,
}, data) {
}, timeline) {
// return true
const timeline = data;
const client = state.chosenClient;
const metadata = state.chosenClient.clientPlayingMetadata || {};
// console.log(state)
@ -85,6 +83,7 @@ export default {
loading: true,
};
state.plex.servers[timeline.machineIdentifier].getPostplay(timeline.key).then((data) => {
// eslint-disable-next-line no-param-reassign
data.machineIdentifier = state.chosenClient.lastTimelineObject.machineIdentifier;
state.upNextCache[timeline.machineIdentifier][timeline.key] = data;
// Only proc upnext if the item upnext is from the same show
@ -117,23 +116,24 @@ export default {
type = metadata.type;
}
let status = 'good';
if (!state.synclounge.lastHostTimeline || isNaN(state.synclounge.lastHostTimeline.time)) {
if (!state.synclounge.lastHostTimeline
|| Number.isNaN(state.synclounge.lastHostTimeline.time)) {
status = 'error';
} else {
const hostAge = Math.abs(new Date().getTime() - state.synclounge.lastHostTimeline.recievedAt);
let hostTime = 0 + state.synclounge.lastHostTimeline.time;
if (state.synclounge.lastHostTimeline.playerState === 'playing') {
hostTime = parseInt(hostTime) + parseInt(hostAge);
hostTime = parseInt(hostTime, 10) + parseInt(hostAge, 10);
}
const difference = Math.abs(data.time - hostTime);
const difference = Math.abs(timeline.time - hostTime);
if (difference > getters['settings/GET_SYNCFLEXIBILITY']) {
status = 'notok';
}
}
const endObj = {
time: parseInt(timeline.time),
maxTime: parseInt(timeline.duration),
time: parseInt(timeline.time, 10),
maxTime: parseInt(timeline.duration, 10),
title,
rawTitle,
playerState: timeline.state,
@ -155,11 +155,14 @@ export default {
};
endObj.commandId = commandId;
if (Object.keys(state.synclounge.commands).length > 1) {
const latency = state.synclounge.commands[Object.keys(state.synclounge.commands).length - 1].difference;
const latency = state.synclounge.commands[Object.keys(state.synclounge.commands).length - 1]
.difference;
endObj.latency = latency;
}
state.synclounge.socket.emit('poll', endObj);
}
return true;
},
SET_LEFT_SIDEBAR_OPEN: ({ commit }, open) => {
commit('SET_LEFT_SIDEBAR_OPEN', open);
@ -232,7 +235,7 @@ export default {
},
SET_RANDOMBACKROUND: async ({ dispatch, commit }) => {
const result = await dispatch('getRandomThumb');
const result = await dispatch('getRandomThumb').catch(() => { });
if (result) {
commit('SET_BACKGROUND', result);
}

View File

@ -250,7 +250,7 @@ export default {
return true;
},
getRandomThumb: async ({ state, getters }) => {
getRandomThumb: async ({ getters }) => {
const validServers = getters.GET_VALID_SERVERS;
if (Object.keys(validServers).length > 1) {