Unused code and ES6 style cleanup.
This commit is contained in:
parent
104e57800d
commit
16159489c8
|
@ -22,7 +22,7 @@
|
|||
<span class="text-danger" v-else-if="row.item.operation_text === 'delete'" :title="langDelete">
|
||||
<icon class="lg inline" icon="remove_circle"></icon>
|
||||
</span>
|
||||
<span class="text-primary" v-else>
|
||||
<span class="text-primary" v-else :title="langUpdate">
|
||||
<icon class="lg inline" icon="swap_horizontal_circle"></icon>
|
||||
</span>
|
||||
</template>
|
||||
|
|
|
@ -152,7 +152,7 @@ export default {
|
|||
this.axios.get(this.settingsUrl).then((resp) => {
|
||||
this.form = mergeExisting(this.form, resp.data);
|
||||
this.loading = false;
|
||||
}).catch((error) => {
|
||||
}).catch(() => {
|
||||
this.close();
|
||||
});
|
||||
},
|
||||
|
@ -184,7 +184,7 @@ export default {
|
|||
url: this.settingsUrl,
|
||||
data: this.form
|
||||
})
|
||||
).then((resp) => {
|
||||
).then(() => {
|
||||
this.$notifySuccess();
|
||||
this.close();
|
||||
});
|
||||
|
|
|
@ -190,7 +190,7 @@ export default {
|
|||
this.axios.get(this.apiUrl).then((resp) => {
|
||||
this.populateForm(resp.data);
|
||||
this.loading = false;
|
||||
}).catch((error) => {
|
||||
}).catch(() => {
|
||||
this.close();
|
||||
});
|
||||
},
|
||||
|
@ -218,7 +218,7 @@ export default {
|
|||
url: this.apiUrl,
|
||||
data: this.form
|
||||
})
|
||||
).then((resp) => {
|
||||
).then(() => {
|
||||
this.$notifySuccess(this.$gettext('Changes saved.'));
|
||||
this.relist();
|
||||
});
|
||||
|
|
|
@ -68,7 +68,7 @@ export default {
|
|||
clear() {
|
||||
this.$wrapWithLoading(
|
||||
this.axios.delete(this.apiUrl)
|
||||
).finally((resp) => {
|
||||
).finally(() => {
|
||||
this.relist();
|
||||
});
|
||||
},
|
||||
|
|
|
@ -203,7 +203,7 @@ export default {
|
|||
url: this.apiUrl,
|
||||
data: this.form
|
||||
})
|
||||
).then((resp) => {
|
||||
).then(() => {
|
||||
this.$emit('saved');
|
||||
|
||||
this.$notifySuccess(this.$gettext('Changes saved.'));
|
||||
|
|
|
@ -82,7 +82,7 @@ export default {
|
|||
url: this.cloneUrl,
|
||||
data: this.form
|
||||
})
|
||||
).then((resp) => {
|
||||
).then(() => {
|
||||
this.$notifySuccess();
|
||||
this.$emit('relist');
|
||||
this.close();
|
||||
|
|
|
@ -68,9 +68,6 @@ export default {
|
|||
};
|
||||
},
|
||||
methods: {
|
||||
isMe(userId) {
|
||||
return this.currentUserId === userId;
|
||||
},
|
||||
relist() {
|
||||
this.$refs.datatable.refresh();
|
||||
},
|
||||
|
|
|
@ -172,7 +172,7 @@ export default {
|
|||
getDuration() {
|
||||
return this.duration;
|
||||
},
|
||||
getProgress(x) {
|
||||
getProgress() {
|
||||
return (this.duration !== 0) ? +((this.currentTime / this.duration) * 100).toFixed(2) : 0;
|
||||
},
|
||||
setProgress(progress) {
|
||||
|
|
|
@ -393,7 +393,7 @@ export default {
|
|||
setFilter(newTerm) {
|
||||
this.filter = newTerm;
|
||||
},
|
||||
loadItems(ctx, callback) {
|
||||
loadItems(ctx) {
|
||||
let queryParams = {
|
||||
internal: true
|
||||
};
|
||||
|
|
|
@ -125,7 +125,7 @@ export default {
|
|||
this.flow.assignBrowse(this.$refs.file_browse_target);
|
||||
this.flow.assignDrop(this.$refs.file_drop_target);
|
||||
|
||||
this.flow.on('fileAdded', (file, event) => {
|
||||
this.flow.on('fileAdded', (file) => {
|
||||
file.progress_percent = 0;
|
||||
file.is_completed = false;
|
||||
file.error = null;
|
||||
|
@ -135,7 +135,7 @@ export default {
|
|||
return true;
|
||||
});
|
||||
|
||||
this.flow.on('filesSubmitted', (array, event) => {
|
||||
this.flow.on('filesSubmitted', () => {
|
||||
this.flow.upload();
|
||||
});
|
||||
|
||||
|
|
|
@ -69,7 +69,7 @@ export default {
|
|||
this.setNowPlaying(response.data);
|
||||
|
||||
setTimeout(this.checkNowPlaying, (!document.hidden) ? 15000 : 30000);
|
||||
}).catch((error) => {
|
||||
}).catch(() => {
|
||||
setTimeout(this.checkNowPlaying, (!document.hidden) ? 30000 : 120000);
|
||||
});
|
||||
}
|
||||
|
|
|
@ -38,13 +38,6 @@ export default {
|
|||
], name);
|
||||
});
|
||||
},
|
||||
labelClassWithRequired() {
|
||||
let labelClass = this.labelClass;
|
||||
if (this.isRequired) {
|
||||
labelClass += ' required';
|
||||
}
|
||||
return labelClass;
|
||||
},
|
||||
isRequired() {
|
||||
return _.has(this.field, 'required');
|
||||
}
|
||||
|
|
|
@ -119,7 +119,7 @@ export default {
|
|||
this.axios.post(url).then((resp) => {
|
||||
this.$notifySuccess(resp.data.message);
|
||||
this.$emit('submitted');
|
||||
}).catch((err) => {
|
||||
}).catch(() => {
|
||||
this.$emit('submitted');
|
||||
});
|
||||
}
|
||||
|
|
|
@ -73,7 +73,7 @@ export default {
|
|||
};
|
||||
},
|
||||
watch: {
|
||||
device: function (val, oldVal) {
|
||||
device: function () {
|
||||
if (this.source == null) {
|
||||
return;
|
||||
}
|
||||
|
@ -81,13 +81,13 @@ export default {
|
|||
}
|
||||
},
|
||||
mounted: function () {
|
||||
var base, base1;
|
||||
let base, base1;
|
||||
|
||||
// Get multimedia devices by requesting them from the browser.
|
||||
navigator.mediaDevices || (navigator.mediaDevices = {});
|
||||
|
||||
(base = navigator.mediaDevices).getUserMedia || (base.getUserMedia = function (constraints) {
|
||||
var fn;
|
||||
let fn;
|
||||
fn = navigator.getUserMedia || navigator.webkitGetUserMedia || navigator.mozGetUserMedia || navigator.msGetUserMedia;
|
||||
if (fn == null) {
|
||||
return Promise.reject(new Error('getUserMedia is not implemented in this browser'));
|
||||
|
@ -101,7 +101,7 @@ export default {
|
|||
return Promise.reject(new Error('enumerateDevices is not implemented on this browser'));
|
||||
});
|
||||
|
||||
var vm_mic = this;
|
||||
const vm_mic = this;
|
||||
navigator.mediaDevices.getUserMedia({
|
||||
audio: true,
|
||||
video: false
|
||||
|
@ -129,7 +129,7 @@ export default {
|
|||
}
|
||||
},
|
||||
createSource: function (cb) {
|
||||
var constraints;
|
||||
let constraints;
|
||||
if (this.source != null) {
|
||||
this.source.disconnect(this.destination);
|
||||
}
|
||||
|
@ -158,7 +158,7 @@ export default {
|
|||
});
|
||||
},
|
||||
setDevices: function (devices) {
|
||||
devices = _.filter(devices, function ({ kind, deviceId }) {
|
||||
devices = _.filter(devices, function ({kind}) {
|
||||
return kind === 'audioinput';
|
||||
});
|
||||
if (_.isEmpty(devices)) {
|
||||
|
|
|
@ -35,7 +35,7 @@ export default {
|
|||
};
|
||||
},
|
||||
watch: {
|
||||
position (val, oldVal) {
|
||||
position(val) {
|
||||
this.$root.$emit('new-mixer-value', val);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -225,7 +225,7 @@ export default {
|
|||
this.prepare();
|
||||
|
||||
return this.getStream().createFileSource(this.file, this, (source) => {
|
||||
var ref1;
|
||||
let ref1;
|
||||
this.source = source;
|
||||
this.source.connect(this.destination);
|
||||
if (this.source.duration != null) {
|
||||
|
|
|
@ -222,7 +222,7 @@ export default {
|
|||
startStreaming () {
|
||||
this.resumeStream();
|
||||
|
||||
var encoderClass;
|
||||
let encoderClass;
|
||||
switch (this.encoder) {
|
||||
case 'mp3':
|
||||
encoderClass = Webcast.Encoder.Mp3;
|
||||
|
|
|
@ -68,11 +68,11 @@ export default {
|
|||
};
|
||||
},
|
||||
methods: {
|
||||
onFileSuccess(file, message) {
|
||||
onFileSuccess() {
|
||||
this.hasFallback = true;
|
||||
},
|
||||
deleteFallback() {
|
||||
this.axios.delete(this.apiUrl).then((resp) => {
|
||||
this.axios.delete(this.apiUrl).then(() => {
|
||||
this.hasFallback = false;
|
||||
});
|
||||
}
|
||||
|
|
|
@ -49,7 +49,7 @@ export default {
|
|||
this.record = d;
|
||||
this.form = mergeExisting(this.form, d);
|
||||
},
|
||||
onSubmitSuccess(response) {
|
||||
onSubmitSuccess() {
|
||||
this.$notifySuccess();
|
||||
|
||||
this.$emit('needs-restart');
|
||||
|
|
|
@ -263,7 +263,7 @@ export default {
|
|||
key: 'timestamp',
|
||||
label: this.$gettext('Modified'),
|
||||
sortable: true,
|
||||
formatter: (value, key, item) => {
|
||||
formatter: (value) => {
|
||||
if (!value) {
|
||||
return '';
|
||||
}
|
||||
|
|
|
@ -37,7 +37,7 @@ export default {
|
|||
watch: {
|
||||
albumArtUrl: {
|
||||
immediate: true,
|
||||
handler(newVal, oldVal) {
|
||||
handler(newVal) {
|
||||
this.albumArtSrc = newVal;
|
||||
}
|
||||
}
|
||||
|
@ -51,7 +51,7 @@ export default {
|
|||
let formData = new FormData();
|
||||
formData.append('art', this.artFile);
|
||||
|
||||
this.axios.post(this.albumArtUrl, formData).then((resp) => {
|
||||
this.axios.post(this.albumArtUrl, formData).then(() => {
|
||||
this.reloadArt();
|
||||
}).catch((err) => {
|
||||
console.log(err);
|
||||
|
@ -59,7 +59,7 @@ export default {
|
|||
});
|
||||
},
|
||||
deleteArt() {
|
||||
this.axios.delete(this.albumArtUrl).then((resp) => {
|
||||
this.axios.delete(this.albumArtUrl).then(() => {
|
||||
this.reloadArt();
|
||||
}).catch((err) => {
|
||||
console.log(err);
|
||||
|
|
|
@ -136,21 +136,18 @@ export default {
|
|||
langErrors() {
|
||||
return this.$gettext('The request could not be processed.');
|
||||
},
|
||||
newPlaylistIsChecked() {
|
||||
return this.newPlaylist !== '';
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
doImmediateQueue(e) {
|
||||
doImmediateQueue() {
|
||||
this.doBatch('immediate', this.$gettext('Files played immediately:'));
|
||||
},
|
||||
doQueue(e) {
|
||||
doQueue() {
|
||||
this.doBatch('queue', this.$gettext('Files queued for playback:'));
|
||||
},
|
||||
doReprocess(e) {
|
||||
doReprocess() {
|
||||
this.doBatch('reprocess', this.$gettext('Files marked for reprocessing:'));
|
||||
},
|
||||
doDelete(e) {
|
||||
doDelete() {
|
||||
let buttonConfirmText = this.$gettext('Delete %{ num } media files?');
|
||||
let numFiles = this.selectedItems.all.length;
|
||||
|
||||
|
|
|
@ -80,7 +80,7 @@ export default {
|
|||
},
|
||||
deleteIntro() {
|
||||
if (this.editIntroUrl) {
|
||||
this.axios.delete(this.editIntroUrl).then((resp) => {
|
||||
this.axios.delete(this.editIntroUrl).then(() => {
|
||||
this.hasIntro = false;
|
||||
});
|
||||
} else {
|
||||
|
|
|
@ -314,7 +314,7 @@ export default {
|
|||
{value: 4, text: '4'},
|
||||
{value: 5, text: '5 - ' + this.$gettext('High')}
|
||||
];
|
||||
for (var i = 6; i <= 25; i++) {
|
||||
for (let i = 6; i <= 25; i++) {
|
||||
weightOptions.push({value: i, text: i});
|
||||
}
|
||||
|
||||
|
|
|
@ -62,7 +62,7 @@ export default {
|
|||
doClear () {
|
||||
this.$wrapWithLoading(
|
||||
this.axios.delete(this.queueUrl)
|
||||
).then((resp) => {
|
||||
).then(() => {
|
||||
this.$notifySuccess(this.$gettext('Playlist queue cleared.'));
|
||||
this.close();
|
||||
});
|
||||
|
|
|
@ -110,7 +110,7 @@ export default {
|
|||
newOrder[row.id] = i;
|
||||
});
|
||||
|
||||
this.axios.put(this.reorderUrl, {'order': newOrder}).then((resp) => {
|
||||
this.axios.put(this.reorderUrl, {'order': newOrder}).then(() => {
|
||||
this.$notifySuccess(this.$gettext('Playlist order set.'));
|
||||
});
|
||||
},
|
||||
|
|
|
@ -73,7 +73,7 @@ export default {
|
|||
},
|
||||
deleteArt () {
|
||||
if (this.editArtUrl) {
|
||||
this.axios.delete(this.editArtUrl).then((resp) => {
|
||||
this.axios.delete(this.editArtUrl).then(() => {
|
||||
this.localSrc = '';
|
||||
});
|
||||
} else {
|
||||
|
|
|
@ -59,15 +59,6 @@ export default {
|
|||
return this.isEditMode
|
||||
? this.$gettext('Edit Episode')
|
||||
: this.$gettext('Add Episode');
|
||||
},
|
||||
langSaveChanges () {
|
||||
let baseText = this.$gettext('Save Changes');
|
||||
|
||||
if (null !== this.uploadPercentage) {
|
||||
baseText = baseText + ' (' + this.uploadPercentage + '%)';
|
||||
}
|
||||
|
||||
return baseText;
|
||||
}
|
||||
},
|
||||
validations: {
|
||||
|
|
|
@ -58,6 +58,8 @@ export default {
|
|||
acceptMimeTypes: ['audio/x-m4a', 'audio/mpeg']
|
||||
};
|
||||
},
|
||||
|
||||
|
||||
watch: {
|
||||
recordHasMedia(newValue) {
|
||||
this.hasMedia = newValue;
|
||||
|
@ -82,7 +84,7 @@ export default {
|
|||
},
|
||||
deleteMedia () {
|
||||
if (this.editMediaUrl) {
|
||||
this.axios.delete(this.editMediaUrl).then((resp) => {
|
||||
this.axios.delete(this.editMediaUrl).then(() => {
|
||||
this.hasMedia = false;
|
||||
});
|
||||
} else {
|
||||
|
|
|
@ -87,11 +87,6 @@ export default {
|
|||
]
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
langAllPodcastsTab () {
|
||||
return this.$gettext('All Podcasts');
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
countEpisodes (episodes) {
|
||||
return episodes.length;
|
||||
|
|
|
@ -161,15 +161,6 @@ export default {
|
|||
embedUrl() {
|
||||
return this.baseEmbedUrl + '?theme=' + this.selectedTheme;
|
||||
},
|
||||
bgVariant() {
|
||||
switch (this.selectedTheme) {
|
||||
case 'light':
|
||||
return 'dark';
|
||||
|
||||
case 'dark':
|
||||
return 'light';
|
||||
}
|
||||
},
|
||||
embedHeight() {
|
||||
switch (this.selectedType) {
|
||||
case 'ondemand':
|
||||
|
|
|
@ -108,15 +108,6 @@ export default {
|
|||
langEnablePublicPages() {
|
||||
return this.$gettext('Enable public pages?');
|
||||
},
|
||||
publicPageEmbedCode() {
|
||||
return '<iframe src="' + this.publicPageEmbedUri + '" frameborder="0" allowtransparency="true" style="width: 100%; min-height: 150px; border: 0;"></iframe>';
|
||||
},
|
||||
publicOnDemandEmbedCode () {
|
||||
return '<iframe src="' + this.publicOnDemandEmbedUri + '" frameborder="0" allowtransparency="true" style="width: 100%; min-height: 400px; border: 0;"></iframe>';
|
||||
},
|
||||
publicRequestEmbedCode () {
|
||||
return '<iframe src="' + this.publicRequestEmbedUri + '" frameborder="0" allowtransparency="true" style="width: 100%; min-height: 850px; border: 0;"></iframe>';
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
doOpenEmbed () {
|
||||
|
|
|
@ -77,7 +77,7 @@ export default {
|
|||
is_public: false
|
||||
};
|
||||
},
|
||||
onSubmitSuccess(response) {
|
||||
onSubmitSuccess() {
|
||||
this.$notifySuccess();
|
||||
|
||||
this.$emit('needs-restart');
|
||||
|
|
|
@ -74,7 +74,7 @@ export default {
|
|||
};
|
||||
},
|
||||
methods: {
|
||||
onFileSuccess(file, message) {
|
||||
onFileSuccess() {
|
||||
this.mayNeedRestart();
|
||||
this.hasStereoToolConfiguration = true;
|
||||
},
|
||||
|
@ -84,7 +84,7 @@ export default {
|
|||
method: 'DELETE',
|
||||
url: this.apiUrl
|
||||
})
|
||||
).then((resp) => {
|
||||
).then(() => {
|
||||
this.mayNeedRestart();
|
||||
this.hasStereoToolConfiguration = false;
|
||||
this.$notifySuccess();
|
||||
|
|
|
@ -61,7 +61,7 @@ export default {
|
|||
key: 'timestampStart',
|
||||
label: this.$gettext('Start Time'),
|
||||
sortable: false,
|
||||
formatter: (value, key, item) => {
|
||||
formatter: (value) => {
|
||||
return DateTime.fromSeconds(value).toLocaleString(
|
||||
{...DateTime.DATETIME_MED, ...App.time_config}
|
||||
);
|
||||
|
@ -72,7 +72,7 @@ export default {
|
|||
key: 'timestampEnd',
|
||||
label: this.$gettext('End Time'),
|
||||
sortable: false,
|
||||
formatter: (value, key, item) => {
|
||||
formatter: (value) => {
|
||||
if (value === 0) {
|
||||
return this.$gettext('Live');
|
||||
}
|
||||
|
|
|
@ -73,7 +73,7 @@ export default {
|
|||
},
|
||||
deleteArt() {
|
||||
if (this.editArtUrl) {
|
||||
this.axios.delete(this.editArtUrl).then((resp) => {
|
||||
this.axios.delete(this.editArtUrl).then(() => {
|
||||
this.localSrc = '';
|
||||
});
|
||||
} else {
|
||||
|
|
Loading…
Reference in New Issue