space to comma separation

This commit is contained in:
Jonathan Baecker 2020-07-06 11:55:30 +02:00
parent 7b10df10fb
commit 9993a1e6d7
6 changed files with 1759 additions and 3530 deletions

View File

@ -7,7 +7,7 @@
"playout_config": "/etc/ffplayout/ffplayout.yml", "playout_config": "/etc/ffplayout/ffplayout.yml",
"net_interface": "lo", "net_interface": "lo",
"media_disk": "/", "media_disk": "/",
"extra_extensions": ".jpg .jpeg .png" "extra_extensions": ".jpg,.jpeg,.png"
} }
}, { }, {
"model": "api_player.messengepresets", "model": "api_player.messengepresets",

View File

@ -6,14 +6,14 @@ from platform import uname
from subprocess import PIPE, STDOUT, run from subprocess import PIPE, STDOUT, run
from time import sleep from time import sleep
import psutil from pymediainfo import MediaInfo
import psutil
import yaml import yaml
import zmq import zmq
from apps.api_player.models import GuiSettings from apps.api_player.models import GuiSettings
from django.conf import settings from django.conf import settings
from natsort import natsorted from natsort import natsorted
from pymediainfo import MediaInfo
def read_yaml(): def read_yaml():
@ -48,7 +48,7 @@ def write_json(data):
config = read_yaml()['playlist']['path'] config = read_yaml()['playlist']['path']
y, m, d = data['date'].split('-') y, m, d = data['date'].split('-')
_path = os.path.join(config, y, m) _path = os.path.join(config, y, m)
if not os.path.isdir(_path): if not os.path.isdir(_path):
os.makedirs(_path, exist_ok=True) os.makedirs(_path, exist_ok=True)
@ -295,7 +295,7 @@ def get_path(input):
def get_media_path(extensions, _dir=''): def get_media_path(extensions, _dir=''):
config = read_yaml() config = read_yaml()
media_folder = config['storage']['path'] media_folder = config['storage']['path']
extensions = extensions.split(' ') extensions = extensions.split(',')
playout_extensions = config['storage']['extensions'] playout_extensions = config['storage']['extensions']
gui_extensions = [x for x in extensions if x not in playout_extensions] gui_extensions = [x for x in extensions if x not in playout_extensions]
media_root, search_dir = get_path(_dir) media_root, search_dir = get_path(_dir)

File diff suppressed because it is too large Load Diff

View File

@ -171,7 +171,7 @@
:placeholder="inputPlaceholder" :placeholder="inputPlaceholder"
drop-placeholder="Drop files here..." drop-placeholder="Drop files here..."
multiple multiple
:accept="extensions.replace(/ /g, ', ')" :accept="extensions.replace(/,/g, ', ')"
:file-name-formatter="formatNames" :file-name-formatter="formatNames"
/> />
<b-row> <b-row>
@ -296,7 +296,7 @@ export default {
}, },
created () { created () {
this.extensions = [...this.configPlayout.storage.extensions, ...this.configGui.extra_extensions].join(' ') this.extensions = [...this.configPlayout.storage.extensions, ...this.configGui.extra_extensions].join(',')
this.getPath(this.extensions, '') this.getPath(this.extensions, '')
}, },

View File

@ -337,7 +337,7 @@ export default {
async created () { async created () {
await this.getStatus() await this.getStatus()
this.extensions = this.configPlayout.storage.extensions.join(' ') this.extensions = this.configPlayout.storage.extensions.join(',')
await this.getPath(this.extensions, '') await this.getPath(this.extensions, '')

View File

@ -48,7 +48,7 @@ export const actions = {
} }
if (response.data && response.data[0]) { if (response.data && response.data[0]) {
if (response.data[0].extra_extensions) { if (response.data[0].extra_extensions) {
response.data[0].extra_extensions = response.data[0].extra_extensions.split(' ') response.data[0].extra_extensions = response.data[0].extra_extensions.split(',')
} else { } else {
response.data[0].extra_extensions = [] response.data[0].extra_extensions = []
} }
@ -68,7 +68,7 @@ export const actions = {
async setGuiConfig ({ commit, state }, obj) { async setGuiConfig ({ commit, state }, obj) {
const stringObj = JSON.parse(JSON.stringify(obj)) const stringObj = JSON.parse(JSON.stringify(obj))
stringObj.extra_extensions = obj.extra_extensions.join(' ') stringObj.extra_extensions = obj.extra_extensions.join(',')
let response let response
if (state.configPlayout.length === 0) { if (state.configPlayout.length === 0) {