Skip to content

Commit

Permalink
Merge pull request #6 from antonic901/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
antonic901 authored May 1, 2022
2 parents 893000e + 9a9e64d commit 7a412d8
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 19 deletions.
2 changes: 1 addition & 1 deletion backend-for-pc/xbox-classic-streamer/backend/bin.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,4 @@ server.listen(port, host).on('error', function (e) {
logger.log('NOTICE', 'API is successfully started. Listening on http://' + host + ':' + port);
});

module.exports = {host, port}
module.exports = {host, port}
4 changes: 1 addition & 3 deletions backend-for-pc/xbox-classic-streamer/backend/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
'use strict';

const { urlencoded } = require('body-parser');

var rangeParser = require('range-parser'),
pump = require('pump'),
_ = require('lodash'),
Expand Down Expand Up @@ -151,7 +149,7 @@ api.post('/torrents/:infoHash/episode', findTorrent, function(req, res) {
if (!result) {
file.deselect();
}
else if(result.episode == episode && result.season == season) {
else if(result.episode == episode && result.season == season && (result.ext == 'mkv' || result.ext == 'mp4' || result.ext == 'avi')) {
logger.log('NOTICE', 'selecting ' + file.name)
path = file.path;
file.select();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,28 +3,28 @@
<v-subheader>Here you can change some PC-specific settings</v-subheader>
<v-list-item>
<v-text-field
v-model="XBOX_IP_ADDRESS"
v-model="HOST_IP_ADDRESS"
class="mb-2"
outlined
dense
type="text"
hide-details
label="IP Address"
:rules="rulesXboxIpAddress"
:rules="rulesHostIpAddress"
readonly
>
</v-text-field>
</v-list-item>
<v-list-item>
<v-text-field
v-model="XBOX_PORT"
v-model="HOST_PORT"
class="mb-2"
outlined
dense
type="number"
hide-details
label="Port"
:rules="rulesXboxPort"
:rules="rulesHostPort"
readonly
>
</v-text-field>
Expand All @@ -46,23 +46,18 @@
<script>
module.exports = {
name: 'BasicSettings',
computed: {
XBOX_ADDRESS() {
return this.$store.getters.getXboxAddress;
}
},
data() {
return {
XBOX_IP_ADDRESS: null,
rulesXboxIpAddress: [
HOST_IP_ADDRESS: null,
rulesHostIpAddress: [
value => !!value || 'Requried.',
value => {
const pattern = /^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/
return pattern.test(value) || 'IP Address is not valid.'
}
],
XBOX_PORT: null,
rulesXboxPort: [
HOST_PORT: null,
rulesHostPort: [
value => !!value || 'Requried.',
value => {
const pattern = /^([1-9][0-9]{0,3}|[1-5][0-9]{4}|6[0-4][0-9]{3}|65[0-4][0-9]{2}|655[0-2][0-9]|6553[0-5])$/
Expand All @@ -78,8 +73,8 @@ module.exports = {
}
},
mounted() {
this.XBOX_IP_ADDRESS = window.location.hostname;
this.XBOX_PORT = window.location.port;
this.HOST_IP_ADDRESS = window.location.hostname;
this.HOST_PORT = window.location.port;
}
}
</script>
Expand Down

0 comments on commit 7a412d8

Please sign in to comment.