some bug fixes after master rebase

This commit is contained in:
vitorsemeano 2020-10-18 18:58:09 +01:00
parent 3c84773792
commit a106e23ff8
9 changed files with 748 additions and 89 deletions

View File

@ -56,6 +56,7 @@
"webpack": "^5.3.2",
"webpack-cli": "^4.0.0",
"webpack-concat-plugin": "^3.0.0",
"webpack-dev-server": "^3.11.0",
"webpack-merge": "^4.2.2",
"webpack-stream": "^6.1.0",
"worker-plugin": "^5.0.0"

View File

@ -310,17 +310,6 @@ class AppRouter {
url = route.contentPath || route.path;
}
if (url.includes('configurationpage')) {
url = ApiClient.getUrl('/web' + url);
} else if (url.indexOf('://') === -1) {
// Put a slash at the beginning but make sure to avoid a double slash
if (url.indexOf('/') !== 0) {
url = '/' + url;
}
url = this.baseUrl() + url;
}
if (ctx.querystring && route.enableContentQueryString) {
url += '?' + ctx.querystring;
}

View File

@ -1,7 +1,7 @@
import { appHost } from './apphost';
import browser from '../scripts/browser';
import { set, get } from '../scripts/settings/appSettings';
import appSettings from '../scripts/settings/appSettings';
import { Events } from 'jellyfin-apiclient';
function setLayout(instance, layout, selectedLayout) {
@ -20,7 +20,7 @@ class LayoutManager {
this.autoLayout();
if (save !== false) {
set('layout', '');
appSettings.set('layout', '');
}
} else {
setLayout(this, 'mobile', layout);
@ -28,7 +28,7 @@ class LayoutManager {
setLayout(this, 'desktop', layout);
if (save !== false) {
set('layout', layout);
appSettings.set('layout', layout);
}
}
@ -36,7 +36,7 @@ class LayoutManager {
}
getSavedLayout() {
return get('layout');
return appSettings.get('layout');
}
autoLayout() {

View File

@ -14,6 +14,7 @@ import '../../assets/css/scrollstyles.css';
import '../../elements/emby-itemscontainer/emby-itemscontainer';
import '../../elements/emby-button/emby-button';
import Dashboard from '../../scripts/clientUtils';
import autoFocuser from '../../components/autoFocuser';
/* eslint-disable indent */
@ -129,9 +130,7 @@ import Dashboard from '../../scripts/clientUtils';
});
loading.hide();
import('../../components/autoFocuser').then(({default: autoFocuser}) => {
autoFocuser.autoFocus(view);
});
autoFocuser.autoFocus(view);
});
}
@ -170,9 +169,7 @@ import Dashboard from '../../scripts/clientUtils';
});
loading.hide();
import('autoFocuser').then(({default: autoFocuser}) => {
autoFocuser.autoFocus(view);
});
autoFocuser.autoFocus(view);
});
}
@ -211,9 +208,7 @@ import Dashboard from '../../scripts/clientUtils';
});
loading.hide();
import('autoFocuser').then(({default: autoFocuser}) => {
autoFocuser.autoFocus(view);
});
autoFocuser.autoFocus(view);
});
}

View File

@ -1,6 +1,6 @@
import QuickConnectSettings from 'quickConnectSettings';
import globalize from 'globalize';
import toast from 'toast';
import QuickConnectSettings from '../../../components/quickConnectSettings/quickConnectSettings';
import globalize from '../../../scripts/globalize';
import toast from '../../../components/toast/toast';
export default function (view) {
let quickConnectSettingsInstance = null;

View File

@ -1,8 +1,9 @@
import loading from 'loading';
import dialogHelper from 'dialogHelper';
import keyboardnavigation from 'keyboardnavigation';
import appRouter from 'appRouter';
import * as libarchive from 'libarchive';
import { Archive } from 'libarchive.js/main.js';
import loading from '../../components/loading/loading';
import dialogHelper from '../../components/dialogHelper/dialogHelper';
import keyboardnavigation from '../../scripts/keyboardNavigation';
import { appRouter } from '../../components/appRouter';
import ServerConnections from '../../components/ServerConnections';
export class ComicsPlayer {
constructor() {
@ -93,9 +94,9 @@ export class ComicsPlayer {
loading.show();
const serverId = item.ServerId;
const apiClient = window.connectionManager.getApiClient(serverId);
const apiClient = ServerConnections.getApiClient(serverId);
libarchive.Archive.init({
Archive.init({
workerUrl: appRouter.baseUrl() + '/libraries/worker-bundle.js'
});
@ -175,7 +176,7 @@ class ArchiveSource {
}
const blob = await res.blob();
this.archive = await libarchive.Archive.open(blob);
this.archive = await Archive.open(blob);
this.raw = await this.archive.getFilesArray();
this.numberOfFiles = this.raw.length;
await this.archive.extractFiles();

View File

@ -125,7 +125,7 @@ export function alert(options) {
}
export function capabilities(appHost) {
const capabilities = {
let capabilities = {
PlayableMediaTypes: ['Audio', 'Video'],
SupportedCommands: ['MoveUp', 'MoveDown', 'MoveLeft', 'MoveRight', 'PageUp', 'PageDown', 'PreviousLetter', 'NextLetter', 'ToggleOsd', 'ToggleContextMenu', 'Select', 'Back', 'SendKey', 'SendString', 'GoHome', 'GoToSettings', 'VolumeUp', 'VolumeDown', 'Mute', 'Unmute', 'ToggleMute', 'SetVolume', 'SetAudioStreamIndex', 'SetSubtitleStreamIndex', 'DisplayContent', 'GoToSearch', 'DisplayMessage', 'SetRepeatMode', 'SetShuffleQueue', 'ChannelUp', 'ChannelDown', 'PlayMediaSource', 'PlayTrailers'],
SupportsPersistentIdentifier: window.appMode === 'cordova' || window.appMode === 'android',

View File

@ -1,7 +1,8 @@
/* eslint-disable indent */
import { AppStorage, Events } from 'jellyfin-apiclient';
function getKey(name, userId) {
class AppSettings {
#getKey(name, userId) {
if (userId) {
name = userId + '-' + name;
}
@ -9,46 +10,46 @@ import { AppStorage, Events } from 'jellyfin-apiclient';
return name;
}
export function enableAutoLogin(val) {
enableAutoLogin(val) {
if (val !== undefined) {
set('enableAutoLogin', val.toString());
this.set('enableAutoLogin', val.toString());
}
return get('enableAutoLogin') !== 'false';
return this.get('enableAutoLogin') !== 'false';
}
export function enableSystemExternalPlayers(val) {
enableSystemExternalPlayers(val) {
if (val !== undefined) {
set('enableSystemExternalPlayers', val.toString());
this.set('enableSystemExternalPlayers', val.toString());
}
return get('enableSystemExternalPlayers') === 'true';
return this.get('enableSystemExternalPlayers') === 'true';
}
export function enableAutomaticBitrateDetection(isInNetwork, mediaType, val) {
enableAutomaticBitrateDetection(isInNetwork, mediaType, val) {
const key = 'enableautobitratebitrate-' + mediaType + '-' + isInNetwork;
if (val !== undefined) {
if (isInNetwork && mediaType === 'Audio') {
val = true;
}
set(key, val.toString());
this.set(key, val.toString());
}
if (isInNetwork && mediaType === 'Audio') {
return true;
} else {
return get(key) !== 'false';
return this.get(key) !== 'false';
}
}
export function maxStreamingBitrate(isInNetwork, mediaType, val) {
maxStreamingBitrate(isInNetwork, mediaType, val) {
const key = 'maxbitrate-' + mediaType + '-' + isInNetwork;
if (val !== undefined) {
if (isInNetwork && mediaType === 'Audio') {
// nothing to do, this is always a max value
} else {
set(key, val);
this.set(key, val);
}
}
@ -56,50 +57,42 @@ import { AppStorage, Events } from 'jellyfin-apiclient';
// return a huge number so that it always direct plays
return 150000000;
} else {
return parseInt(get(key) || '0') || 1500000;
return parseInt(this.get(key) || '0') || 1500000;
}
}
export function maxStaticMusicBitrate(val) {
maxStaticMusicBitrate(val) {
if (val !== undefined) {
set('maxStaticMusicBitrate', val);
this.set('maxStaticMusicBitrate', val);
}
const defaultValue = 320000;
return parseInt(get('maxStaticMusicBitrate') || defaultValue.toString()) || defaultValue;
return parseInt(this.get('maxStaticMusicBitrate') || defaultValue.toString()) || defaultValue;
}
export function maxChromecastBitrate(val) {
maxChromecastBitrate(val) {
if (val !== undefined) {
set('chromecastBitrate1', val);
this.set('chromecastBitrate1', val);
}
val = get('chromecastBitrate1');
val = this.get('chromecastBitrate1');
return val ? parseInt(val) : null;
}
export function set(name, value, userId) {
const currentValue = get(name, userId);
AppStorage.setItem(getKey(name, userId), value);
set(name, value, userId) {
const currentValue = this.get(name, userId);
AppStorage.setItem(this.#getKey(name, userId), value);
if (currentValue !== value) {
Events.trigger(this, 'change', [name]);
}
}
export function get(name, userId) {
return AppStorage.getItem(getKey(name, userId));
get(name, userId) {
return AppStorage.getItem(this.#getKey(name, userId));
}
}
/* eslint-enable indent */
export default {
enableAutoLogin: enableAutoLogin,
enableSystemExternalPlayers: enableSystemExternalPlayers,
enableAutomaticBitrateDetection: enableAutomaticBitrateDetection,
maxStreamingBitrate: maxStreamingBitrate,
maxStaticMusicBitrate: maxStaticMusicBitrate,
maxChromecastBitrate: maxChromecastBitrate,
set: set,
get: get
};
export default new AppSettings();

718
yarn.lock

File diff suppressed because it is too large Load Diff