diff --git a/src/common/interfaces/ArInterface.ts b/src/common/interfaces/ArInterface.ts new file mode 100644 index 0000000..d9e25ed --- /dev/null +++ b/src/common/interfaces/ArInterface.ts @@ -0,0 +1,6 @@ +import AspectRatioType from '../enums/AspectRatioType.enum'; + +export interface Ar { + type: AspectRatioType, + ratio?: number +} diff --git a/src/common/interfaces/SettingsInterface.ts b/src/common/interfaces/SettingsInterface.ts index 8e6bedd..804cd94 100644 --- a/src/common/interfaces/SettingsInterface.ts +++ b/src/common/interfaces/SettingsInterface.ts @@ -366,7 +366,7 @@ export interface SiteSettingsInterface { defaults?: { // must be defined in @global and @empty crop?: {type: AspectRatioType, [x: string]: any}, stretch?: StretchType, - alignment?: any, + alignment?: {x: VideoAlignmentType, y: VideoAlignmentType}, } cropModePersistence?: CropModePersistence; diff --git a/src/csui/PlayerOverlay.vue b/src/csui/PlayerOverlay.vue index d852757..efcab38 100644 --- a/src/csui/PlayerOverlay.vue +++ b/src/csui/PlayerOverlay.vue @@ -39,11 +39,9 @@ import DebugPanel from './src/PlayerUiPanels/DebugPanel.vue' import VideoSettings from './src/PlayerUiPanels/VideoSettings.vue' import AutodetectionSettingsPanel from './src/PlayerUiPanels/AutodetectionSettingsPanel.vue' import PlayerDetectionPanel from './src/PlayerUiPanels/PlayerDetectionPanel.vue' -import { mapState } from 'vuex'; // import Icon from '../common/components/Icon'; import ResizerDebugPanel from './src/PlayerUiPanels/ResizerDebugPanelComponent'; import BrowserDetect from '../ext/conf/BrowserDetect'; -import ExecAction from './src/ui-libs/ExecAction'; import Logger from '../ext/lib/Logger'; import Settings from '../ext/lib/Settings'; import EventBus from '../ext/lib/EventBus'; @@ -85,7 +83,6 @@ export default { settings: {}, BrowserDetect: BrowserDetect, settingsInitialized: false, - execAction: new ExecAction(), eventBus: new EventBus(), logger: null, diff --git a/src/csui/src/PlayerUIWindow.vue b/src/csui/src/PlayerUIWindow.vue index ad5ddec..7870783 100644 --- a/src/csui/src/PlayerUIWindow.vue +++ b/src/csui/src/PlayerUIWindow.vue @@ -154,6 +154,7 @@ export default { selectedTab: 'videoSettings', BrowserDetect: BrowserDetect, preventClose: false, + siteSettings: null, } }, props: [ @@ -168,9 +169,12 @@ export default { // IS SUPER HARAM // THINGS WILL NOT WORK IF YOU USE ARROWS siteSupportLevel() { - return (this.site && this.settings?.active) ? this.settings.active.sites[this.site]?.type || 'no-support' : 'waiting'; + return (this.site && this.siteSettings) ? this.siteSettings.data.type || 'no-support' : 'waiting'; } }, + created() { + this.siteSettings = this.settings.getSiteSettings(this.site); + }, methods: { /** * Gets URL of the browser settings page (i think?) diff --git a/src/csui/src/PlayerUiPanels/AutodetectionSettingsPanel.vue b/src/csui/src/PlayerUiPanels/AutodetectionSettingsPanel.vue index 94964d1..6cfedaf 100644 --- a/src/csui/src/PlayerUiPanels/AutodetectionSettingsPanel.vue +++ b/src/csui/src/PlayerUiPanels/AutodetectionSettingsPanel.vue @@ -262,7 +262,6 @@ import Button from '../../../common/components/Button.vue' import KeyboardShortcutParser from '../../../common/js/KeyboardShortcutParser'; import ShortcutButton from '../../../common/components/ShortcutButton'; import EditShortcutButton from '../../../common/components/EditShortcutButton'; -import ExecAction from '../ui-libs/ExecAction'; import BrowserDetect from '../../../ext/conf/BrowserDetect'; import AspectRatioType from '../../../common/enums/AspectRatioType.enum'; import StretchType from '../../../common/enums/StretchType.enum'; @@ -286,7 +285,6 @@ export default { 'site' ], created() { - this.exec = new ExecAction(this.settings, window.location.hostname); this.eventBus.subscribe('uw-config-broadcast', {function: (config) => this.handleConfigBroadcast(config)}); }, mounted() { diff --git a/src/csui/src/PlayerUiPanels/PanelComponents/ExtensionSettings/SiteExtensionSettings.vue b/src/csui/src/PlayerUiPanels/PanelComponents/ExtensionSettings/SiteExtensionSettings.vue index 71fdf2f..d32ed02 100644 --- a/src/csui/src/PlayerUiPanels/PanelComponents/ExtensionSettings/SiteExtensionSettings.vue +++ b/src/csui/src/PlayerUiPanels/PanelComponents/ExtensionSettings/SiteExtensionSettings.vue @@ -191,26 +191,7 @@ export default { commandArguments = $event.target.value; } - if (!this.settings.active.sites[this.site]) { - this.settings.active.sites[this.site] = this.settings.getDefaultSiteConfiguration(); - } - - const optionPath = option.split('.'); - if (optionPath.length < 2) { - this.settings.active.sites[this.site][option] = commandArguments; - } else { - let currentOptionObject = this.settings.active.sites[this.site][optionPath[0]]; - let i; - for (i = 1; i < optionPath.length - 1; i++) { - if (currentOptionObject[optionPath[i]] === undefined) { - currentOptionObject[optionPath[i]] = {}; - } - currentOptionObject = currentOptionObject[optionPath[i]]; - } - currentOptionObject[optionPath[optionPath.length - 1]] = commandArguments; - } - - this.settings.saveWithoutReload(); + this.siteSettings.set(option, commandArguments); } } diff --git a/src/csui/src/PlayerUiPanels/PanelComponents/VideoSettings/CropOptionsPanel.vue b/src/csui/src/PlayerUiPanels/PanelComponents/VideoSettings/CropOptionsPanel.vue index 86672f0..9100ed9 100644 --- a/src/csui/src/PlayerUiPanels/PanelComponents/VideoSettings/CropOptionsPanel.vue +++ b/src/csui/src/PlayerUiPanels/PanelComponents/VideoSettings/CropOptionsPanel.vue @@ -132,23 +132,6 @@ -